Skip to content

Commit 35eef39

Browse files
fix: make titlebar fully responsive (#1688)
1 parent 06a5bea commit 35eef39

File tree

2 files changed

+46
-8
lines changed

2 files changed

+46
-8
lines changed

src/less/components/commands.less

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,43 @@ header {
44
box-shadow: 0 0 0 1px rgba(16, 22, 26, 0.2), 0 0 0 rgba(16, 22, 26, 0), 0 1px 1px rgba(16, 22, 26, 0.4);
55
background-color: @background-3;
66
-webkit-app-region: drag;
7+
8+
#version-chooser .bp3-button-text::before {
9+
content: "Electron v";
10+
}
11+
12+
@media (max-width: 980px) {
13+
#version-chooser .bp3-button-text::before{
14+
content: "v";
15+
}
16+
}
17+
18+
@media (max-width: 800px) {
19+
.bp3-button:not(#version-chooser){
20+
display: flex;
21+
justify-content: center;
22+
align-items: center;
23+
.bp3-button-text{
24+
display: none;
25+
}
26+
}
27+
28+
.bp3-button > *{
29+
margin-right: 0;
30+
}
31+
32+
.bp3-button .bp3-icon-compressed{
33+
margin-right: 7px;
34+
}
35+
36+
.address-bar .bp3-input{
37+
padding-right: 36px !important;
38+
}
39+
}
40+
}
41+
42+
.address-bar .bp3-input{
43+
padding-right: 116px !important;
744
}
845

946
.disabled-menu-tooltip {
@@ -69,7 +106,7 @@ header {
69106
}
70107

71108
.address-bar {
72-
width: 420px;
109+
width: ~"min(max(200px, 30vw), 420px)";
73110
transition: width 0.4s;
74111

75112
input,
@@ -78,7 +115,7 @@ header {
78115
}
79116

80117
&.empty {
81-
width: 300px;
118+
width: ~"min(max(160px, 25vw), 300px)";
82119
}
83120

84121
&:focus-within {
@@ -90,13 +127,14 @@ header {
90127
}
91128

92129
& > .title {
130+
display: inline-block;
131+
max-width: 20vw;
132+
white-space: nowrap;
133+
overflow: hidden;
134+
text-overflow: ellipsis;
93135
align-self: stretch;
94136
flex-shrink: 0;
95-
96-
flex-flow: column nowrap;
97-
justify-content: center;
98137
user-select: none;
99-
100-
margin: 0 10px;
138+
margin: auto 10px;
101139
}
102140
}

src/renderer/components/version-select.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export const VersionSelect = observer(
256256
>
257257
<Button
258258
id="version-chooser"
259-
text={`Electron v${version}`}
259+
text={version}
260260
icon={getItemIcon(currentVersion)}
261261
onContextMenu={(e: React.MouseEvent<HTMLButtonElement>) => {
262262
renderVersionContextMenu(e, version);

0 commit comments

Comments
 (0)