|
163 | 163 | .titlebar-buttonbox { |
164 | 164 | z-index: 1; |
165 | 165 | 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 | + ); |
166 | 171 | } |
167 | 172 |
|
168 | 173 | @media (-moz-gtk-csd-reversed-placement) { |
|
177 | 182 | align-items: center; |
178 | 183 | padding: 0; |
179 | 184 | 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); |
180 | 191 | /* In GTK applications, you can drag the window by titlebar buttons */ |
181 | 192 | -moz-window-dragging: drag; |
182 | 193 |
|
|
207 | 218 | } |
208 | 219 | } |
209 | 220 |
|
| 221 | +.titlebar-restore, |
210 | 222 | .titlebar-max { |
211 | | - order: env(-moz-gtk-csd-maximize-button-position); |
| 223 | + --titlebar-button-position: env(-moz-gtk-csd-maximize-button-position); |
| 224 | + |
212 | 225 | > .toolbarbutton-icon { |
213 | 226 | background-image: -moz-symbolic-icon(window-maximize-symbolic); |
214 | 227 | } |
215 | | -} |
216 | 228 |
|
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; |
221 | 231 | } |
222 | 232 | } |
223 | 233 |
|
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); |
229 | 236 | } |
230 | 237 |
|
231 | 238 | .titlebar-close { |
232 | | - order: env(-moz-gtk-csd-close-button-position); |
| 239 | + --titlebar-button-position: env(-moz-gtk-csd-close-button-position); |
233 | 240 |
|
234 | 241 | > .toolbarbutton-icon { |
235 | 242 | background-image: -moz-symbolic-icon(window-close-symbolic); |
|
241 | 248 | } |
242 | 249 |
|
243 | 250 | .titlebar-min { |
244 | | - order: env(-moz-gtk-csd-minimize-button-position); |
| 251 | + --titlebar-button-position: env(-moz-gtk-csd-minimize-button-position); |
245 | 252 |
|
246 | 253 | > .toolbarbutton-icon { |
247 | 254 | background-image: -moz-symbolic-icon(window-minimize-symbolic); |
|
0 commit comments