Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge beta (133) to master #863

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CSD: Rewrite styles to match new window buttons layout (FF133)
  • Loading branch information
rafaelmardojai committed Nov 27, 2024
commit 7696cafa33ecd9a6d4ef6102077ab4715cfbbf27
20 changes: 12 additions & 8 deletions theme/parts/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
/* Buttons */
menulist,
.customizationmode-button,
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton),
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not(.titlebar-button),
:root[inFullscreen] .titlebar-button.titlebar-restore,
link[href="chrome://global/content/elements/moz-button.css"] + button,
.subviewbutton.panel-subview-footer,
.panel-footer button,
Expand Down Expand Up @@ -65,7 +66,8 @@ button.close,
}

/* Flat Buttons */
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton),
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not(.titlebar-button),
:root[inFullscreen] .titlebar-button.titlebar-restore,
link[href="chrome://global/content/elements/moz-button.css"] + button:is([type~="icon"], :has([type~="icon"])),
.close-icon:not(.tab-close-button),
.dialog-button-box button,
Expand All @@ -78,7 +80,7 @@ button.close,
}

/* Buttons with margins */
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton),
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not(.titlebar-button),
.notification-button,
.subviewbutton.panel-subview-footer:not(:only-of-type),
.panel-footer button:not(:only-of-type) {
Expand Down Expand Up @@ -159,7 +161,8 @@ menulist:hover .menulist-label-box,
}

/* Hover flat buttons */
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not([open]):not([disabled="true"]):not([checked]):hover,
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not(.titlebar-button):not([open]):not([disabled="true"]):not([checked]):hover,
:root[inFullscreen] .titlebar-button.titlebar-restore:hover,
link[href="chrome://global/content/elements/moz-button.css"] + button:is([type~="icon"], :has([type~="icon"])):not([disabled="true"], [aria-pressed="true"]):hover,
.close-icon:not(.tab-close-button):hover,
button.close:hover,
Expand Down Expand Up @@ -202,9 +205,10 @@ menulist[open] .menulist-label-box,
}

/* Active flat buttons */
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not([disabled="true"]):not(#hack):active,
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not(.subviewbutton):not([disabled="true"])[open],
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not([disabled="true"])[checked],
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not(.titlebar-button):not([disabled="true"]):not(#hack):active,
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not(.titlebar-button):not(.subviewbutton):not([disabled="true"])[open],
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.subviewbutton):not(.titlebar-button):not([disabled="true"])[checked],
:root[inFullscreen] .titlebar-button.titlebar-restore:active,
link[href="chrome://global/content/elements/moz-button.css"] + button:is([type~="icon"], :has([type~="icon"])):not([disabled="true"]):active,
link[href="chrome://global/content/elements/moz-button.css"] + button:has(.button-background:not([type~="ghost"])):not([disabled="true"]),
.close-icon:not(.tab-close-button):active,
Expand All @@ -218,7 +222,7 @@ button.close:active,
}

/* Disabled buttons */
#nav-bar toolbarbutton:not(#urlbar-zoom-button)[disabled="true"],
#nav-bar toolbarbutton:not(#urlbar-zoom-button):not(.titlebar-button)[disabled="true"],
#appMenu-popup .toolbaritem-combined-buttons toolbarbutton[disabled="true"],
#context-navigation menuitem[disabled="true"],
.dialog-button-box button[disabled="true"] {
Expand Down
244 changes: 97 additions & 147 deletions theme/parts/csd.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,171 +2,121 @@

@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/* Headerbar top border corners rounded */
:root[tabsintitlebar][sizemode="normal"]:not([gtktiledwindow="true"]) #nav-bar {
border-radius: env(-moz-gtk-csd-titlebar-radius, 8px) env(-moz-gtk-csd-titlebar-radius, 8px) 0 0 !important;
}


/* Window buttons: at least 1 button */
@media (-moz-gtk-csd-minimize-button), (-moz-gtk-csd-maximize-button), (-moz-gtk-csd-close-button) {
:root {
--gnome-navbar-csd-offset: 43px;
}
}
/* Window buttons: at least 2 buttons */
@media (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-maximize-button),
(-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-close-button),
(-moz-gtk-csd-maximize-button) and (-moz-gtk-csd-close-button) {
:root {
--gnome-navbar-csd-offset: 80px;
}
}
/* Window buttons: 3 buttons */
@media (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-maximize-button) and (-moz-gtk-csd-close-button) {
:root {
--gnome-navbar-csd-offset: 117px;
:root[tabsintitlebar] {
/* Headerbar top border corners rounded */
&[sizemode="normal"]:not([gtktiledwindow="true"]) #nav-bar {
border-radius: env(-moz-gtk-csd-titlebar-radius, 8px) env(-moz-gtk-csd-titlebar-radius, 8px) 0 0 !important;
}
}

/* Right window buttons offset by button count */
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
padding-left: 3px !important;
padding-right: var(--gnome-navbar-csd-offset) !important;
}
/* Fullscreen headerbar padding for 1 button */
:root[tabsintitlebar][inFullscreen]:not([inDOMFullscreen]) #nav-bar {
padding-right: 43px !important;
}

/* Left window buttons */
@media (-moz-gtk-csd-reversed-placement) {
/* Window controls offset by button count */
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
padding-left: var(--gnome-navbar-csd-offset) !important;
padding-right: 3px !important;
}

/* Window buttons box */
:root[tabsintitlebar] #titlebar .titlebar-buttonbox-container {
left: 0;
right: auto !important;
/* Always show nav bar window buttons*/
#nav-bar > .titlebar-buttonbox-container {
display: flex !important;
}

/* Fullscreen headerbar padding for 1 button */
:root[tabsintitlebar][inFullscreen]:not([inDOMFullscreen]) #nav-bar {
padding-left: 50px !important;
padding-right: 3px !important
}
}

/* Remove close and minimize buttons from fullscreen buttons */
:root[tabsintitlebar][inFullscreen] #titlebar .titlebar-buttonbox-container .titlebar-min,
:root[tabsintitlebar][inFullscreen] #titlebar .titlebar-buttonbox-container .titlebar-close {
display: none !important;
}

/* Force the restore button to appear regardless of maximize button's status */
:root[tabsintitlebar][inFullscreen]:not([inDOMFullscreen]) #titlebar .titlebar-buttonbox-container {
visibility: visible !important;
}
:root[tabsintitlebar][inFullscreen]:not([inDOMFullscreen]) #titlebar .titlebar-buttonbox-container .titlebar-restore {
display: inherit !important;
}
#toolbar-menubar {
/* Prevent menubar from breaking */
&:not([inactive=true]) {
height: 30px !important;
margin-bottom: 8px;
}

/* Remove tabsbar titlebar blank spaces */
:root[tabsintitlebar] #TabsToolbar .titlebar-placeholder {
display: none !important;
}
/* Always hide menu bar window buttons*/
& > .titlebar-buttonbox-container {
display: none !important;
}
}

/* Prevent menubar from breaking */
:root[tabsintitlebar] #toolbar-menubar:not([inactive=true]) {
height: 30px !important;
margin-bottom: 8px;
}
&[inFullscreen] {
/* Remove close and minimize buttons from fullscreen buttons */
.titlebar-buttonbox-container .titlebar-min,
.titlebar-buttonbox-container .titlebar-close {
display: none !important;
}

/* Remove default style of titlebar */
:root[tabsintitlebar] #titlebar {
appearance: none !important;
}
/* Force the restore button to appear regardless of maximize button's status */
&:not([inDOMFullscreen]) {
.titlebar-buttonbox-container {
visibility: visible !important;
}
.titlebar-restore {
display: inherit !important;
}
}
}

/* Fix the issue when dragging tabs */
:root[tabsintitlebar] #navigator-toolbox[movingtab] #TabsToolbar {
padding-bottom: 0 !important;
}
&:not([inFullscreen]) {
.titlebar-buttonbox-container {
padding: 0 8px;
}

/* Window buttons box */
:root[tabsintitlebar] #titlebar .titlebar-buttonbox-container {
appearance: none !important;
padding: 5px;
position: absolute !important;
right: 0;
top: 0;
display: block !important;
}
:root[tabsintitlebar] #titlebar .titlebar-buttonbox {
appearance: none !important;
}
/* Window buttons style */
.titlebar-button {
background: var(--gnome-button-background) !important;
border-radius: 100% !important;
height: 24px !important;
transition: background 0.3s;
width: 24px !important;

/* Window buttons style */
:root[tabsintitlebar]:not([inFullscreen]) #titlebar .titlebar-button {
padding: 0 2px !important;
background: var(--gnome-button-background) !important;
transition: background 0.3s;
}
&:not([disabled]):hover {
background: var(--gnome-button-hover-background) !important;

:root[tabsintitlebar] #titlebar .titlebar-button {
border-radius: 100% !important;
height: 24px !important;
width: 24px !important;
margin: 6px 6px !important;
}
& > .toolbarbutton-icon {
background: none !important;
}
}

@media not (-moz-bool-pref: "gnomeTheme.noThemedIcons") {
:root[tabsintitlebar] #titlebar .titlebar-button > .toolbarbutton-icon {
appearance: none !important;
height: 16px !important;
padding: 0 !important;
stroke: none !important;
width: 16px !important;
-moz-context-properties: fill, fill-opacity !important;
}
}
&:not([disabled]):active {
background: var(--gnome-button-active-background) !important;
}

.titlebar-button { /* Override config */
@media (-moz-bool-pref: "widget.gtk.non-native-titlebar-buttons.enabled") {
&:-moz-lwtheme {
& > .toolbarbutton-icon {
appearance: auto !important
&::-moz-window-inactive {
filter: opacity(0.5);
}
}
}
}

:root[tabsintitlebar] #titlebar .titlebar-button:not([disabled]):hover {
background: var(--gnome-button-hover-background) !important;
}
:root[tabsintitlebar] #titlebar .titlebar-button:hover > .toolbarbutton-icon {
background: none !important;
}
:root[tabsintitlebar] #titlebar .titlebar-button:not([disabled]):active {
background: var(--gnome-button-active-background) !important;
}

:root[tabsintitlebar] #titlebar .titlebar-button:-moz-window-inactive {
filter: opacity(0.5);
}

/* Restore button (fullscreen) */
:root[tabsintitlebar][inFullscreen] #titlebar .titlebar-buttonbox-container {
padding: 0 !important;
}
.titlebar-buttonbox-container {
align-items: center;
padding: 0 3px;

.titlebar-buttonbox {
appearance: none !important;
gap: 13px;

.titlebar-button {
appearance: none !important;
padding: 0 !important;
margin: 0 !important;

&:hover > .toolbarbutton-icon {
background: none !important;
}

@media not (-moz-bool-pref: "gnomeTheme.noThemedIcons") {
& > .toolbarbutton-icon {
appearance: none !important;
height: 16px !important;
padding: 0 !important;
stroke: none !important;
width: 16px !important;
-moz-context-properties: fill, fill-opacity !important;
}
}

@media (-moz-bool-pref: "widget.gtk.non-native-titlebar-buttons.enabled") {
&:-moz-lwtheme { /* Override config */
& > .toolbarbutton-icon {
appearance: auto !important
}
}
}
}
}
}

:root[tabsintitlebar][inFullscreen] #titlebar .titlebar-button {
border-radius: 6px !important;
height: 34px !important;
width: 34px !important;
transition: background .3s;
.titlebar-spacer {
display: none;
}
}

/* OPTIONAL: Allow draging the window from headerbar buttons */
Expand Down
13 changes: 5 additions & 8 deletions theme/parts/icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -301,24 +301,21 @@ button.close::before {
}

/* Window buttons */
:root[tabsintitlebar] #titlebar .titlebar-buttonbox .titlebar-close .toolbarbutton-icon {
:root[tabsintitlebar] .titlebar-buttonbox .titlebar-close .toolbarbutton-icon {
list-style-image: url("../icons/window-close-symbolic.svg") !important;
}
:root[tabsintitlebar] #titlebar .titlebar-buttonbox .titlebar-max .toolbarbutton-icon {
:root[tabsintitlebar] .titlebar-buttonbox .titlebar-max .toolbarbutton-icon {
list-style-image: url("../icons/window-maximize-symbolic.svg") !important;
}
:root[tabsintitlebar] #titlebar .titlebar-buttonbox .titlebar-restore .toolbarbutton-icon {
:root[tabsintitlebar] .titlebar-buttonbox .titlebar-restore .toolbarbutton-icon {
list-style-image: url("../icons/window-restore-symbolic.svg") !important;
}
:root[tabsintitlebar][inFullscreen] #titlebar .titlebar-buttonbox .titlebar-restore .toolbarbutton-icon {
:root[tabsintitlebar][inFullscreen] .titlebar-buttonbox .titlebar-restore .toolbarbutton-icon {
list-style-image: url("../icons/view-restore-symbolic.svg") !important;
}
:root[tabsintitlebar] #titlebar .titlebar-buttonbox .titlebar-min .toolbarbutton-icon {
:root[tabsintitlebar] .titlebar-buttonbox .titlebar-min .toolbarbutton-icon {
list-style-image: url("../icons/window-minimize-symbolic.svg") !important;
}
:root[tabsintitlebar][inFullscreen] #window-controls #restore-button .toolbarbutton-icon {
list-style-image: url("../icons/view-restore-symbolic.svg") !important;
}

/* Sound icons */
.tab-icon-overlay[soundplaying] {
Expand Down