Skip to content

Commit ee89fea

Browse files
committed
Bug 1974861 - Increase end padding on the last titlebar button. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D256122
1 parent 5bae3c8 commit ee89fea

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

browser/themes/linux/browser.css

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@
163163
.titlebar-buttonbox {
164164
z-index: 1;
165165
align-items: stretch;
166+
--max-titlebar-button-position: max(
167+
env(-moz-gtk-csd-maximize-button-position),
168+
env(-moz-gtk-csd-minimize-button-position),
169+
env(-moz-gtk-csd-close-button-position)
170+
);
166171
}
167172

168173
@media (-moz-gtk-csd-reversed-placement) {
@@ -177,6 +182,12 @@
177182
align-items: center;
178183
padding: 0;
179184
padding-inline: calc(env(-moz-gtk-csd-titlebar-button-spacing) / 2);
185+
/* We want double the end spacing for the last button */
186+
padding-inline-end: max(
187+
env(-moz-gtk-csd-titlebar-button-spacing) / 2,
188+
env(-moz-gtk-csd-titlebar-button-spacing) * (var(--titlebar-button-position) - var(--max-titlebar-button-position) + 1)
189+
);
190+
order: var(--titlebar-button-position);
180191
/* In GTK applications, you can drag the window by titlebar buttons */
181192
-moz-window-dragging: drag;
182193

@@ -207,29 +218,25 @@
207218
}
208219
}
209220

221+
.titlebar-restore,
210222
.titlebar-max {
211-
order: env(-moz-gtk-csd-maximize-button-position);
223+
--titlebar-button-position: env(-moz-gtk-csd-maximize-button-position);
224+
212225
> .toolbarbutton-icon {
213226
background-image: -moz-symbolic-icon(window-maximize-symbolic);
214227
}
215-
}
216228

217-
.titlebar-restore {
218-
order: env(-moz-gtk-csd-maximize-button-position);
219-
> .toolbarbutton-icon {
220-
background-image: -moz-symbolic-icon(window-restore-symbolic);
229+
@media not (-moz-gtk-csd-maximize-button) {
230+
display: none;
221231
}
222232
}
223233

224-
@media not (-moz-gtk-csd-maximize-button) {
225-
.titlebar-restore,
226-
.titlebar-max {
227-
display: none;
228-
}
234+
.titlebar-restore > .toolbarbutton-icon {
235+
background-image: -moz-symbolic-icon(window-restore-symbolic);
229236
}
230237

231238
.titlebar-close {
232-
order: env(-moz-gtk-csd-close-button-position);
239+
--titlebar-button-position: env(-moz-gtk-csd-close-button-position);
233240

234241
> .toolbarbutton-icon {
235242
background-image: -moz-symbolic-icon(window-close-symbolic);
@@ -241,7 +248,7 @@
241248
}
242249

243250
.titlebar-min {
244-
order: env(-moz-gtk-csd-minimize-button-position);
251+
--titlebar-button-position: env(-moz-gtk-csd-minimize-button-position);
245252

246253
> .toolbarbutton-icon {
247254
background-image: -moz-symbolic-icon(window-minimize-symbolic);

0 commit comments

Comments
 (0)