Add standard CSD titlebutton icons + fix mac hover icons (GTK3 + GTK4)#591
Open
newman2x wants to merge 5 commits intovinceliuice:masterfrom
Open
Add standard CSD titlebutton icons + fix mac hover icons (GTK3 + GTK4)#591newman2x wants to merge 5 commits intovinceliuice:masterfrom
newman2x wants to merge 5 commits intovinceliuice:masterfrom
Conversation
- Add %standard_window_button placeholder with background-image rules - Use $asset-suffix for light/dark SVG switching - Add dark SVG copies (*-symbolic-dark.svg) with white fill for dark variant - Apply %standard_window_button in @else branch when not mac_style - Fix unmaximize selector: drop .default-decoration for XFCE compatibility - Add @else branch for unmaximize icon in maximized state - Fix button size, padding and active state animation ripple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The standard (non-macos) variants of Orchis had no styling for CSD titlebuttons.
Without
--tweaks macos, window buttons rendered using GTK's default fallback —no themed icons, no hover or active states.
Under
--tweaks macos, the%firefox_window_buttonhover icons had two issues:SVG references pointed at the standard symbolic icons (not the mac-specific ones),
and the selector required
.default-decorationwhich plain GTK3 CSD apps likeCelluloid never have, so hover icons were silently skipped on those apps.
From top to bottom:
GTK4
GTK3
XFWM4
Changes
src/_sass/gtk/_common-3.20.scss%standard_window_buttonplaceholder:background-imageSVG icons sized andcentered on the button node,
image { opacity: 0 }to hide GTK's native icon child,hover/active background using
if($variant == 'light', rgba(black, 0.15), rgba(white, 0.15)),animation: noneon active to prevent GTK ripple from expandingbackground-size%standard_window_buttonvia new@elsebranch inbutton.titlebuttonblockwhen
$mac_style != 'true'@elsebranch for standard unmaximize icon when window is maximized$space-sizeto$space-size + 4px%mac_window_buttonmargin:$space-size - 2px→$space-size%firefox_window_button:&:hover, &:active)*-symbolic-mac.svg)background-size: 0 0at rest, revealed to16px 16pxon hover/active, so the iconis invisible until hovered without requiring
background-imageto be unsetimage { opacity: 0 }to suppress native GTK icon.titlebar.default-decorationto.titlebar— plain GTK3CSD apps (e.g. Celluloid) never have
.default-decoration, so they were silentlyexcluded from hover icons under
--tweaks macos.default-decorationfor same reason,update SVG reference to
unmaximize-symbolic-mac.svgsrc/_sass/gtk/_common-4.0.scss%standard_window_buttonplaceholder with same approach as GTK3, using> image(direct child selector, required in GTK4) withopacity: 0to hide thenative icon
%standard_window_buttonvia@elsebranch, replacing the previous bareimage reset block
headerbar border-radiuscorner-cropping when maximized/tiled/fullscreen byadding a
.maximized &override blockheaderbar windowcontrols border-spacing:$space-size→2px%mac_window_buttonmargins:$space-size - 2px→$space-size> imagedirectly — required because%mac_window_buttondraws colored circles via
> image { background-color }, sobackground-imageon thebutton node renders behind the child and is invisible
color: transparenton mac> imageto suppress native GTK symbolic icon(rendered via currentColor) without affecting
background-colororbackground-image@if/@elseunmaximize block targeting> imageon hover/activesrc/gtk/scalable/*-symbolic-dark.svg/@2.svgcopies withfill:#fffffffor dark variant,used automatically via
$asset-suffixinterpolation*-symbolic-mac.svg/@2.svgfiles withfill:#fffffffor mac hover icons(used by
%firefox_window_buttonGTK3 and mac hover blocks GTK4)Notes
%mac_window_buttoncolored circles are completely unchangedGTK4/libadwaita (gnome-calendar, baobab)
-gtk-recolor(url(...))does not work reliably on this GTK3 version for non-blackfills — separate SVG copies are used instead
/* FIXME */next to-gtk-scaled()in GTK4 — display bugin the Inspector only, SVG loads correctly at runtime
core.shis not modified — it already copiessrc/gtk/scalable/to bothgtk-3.0/assets/andgtk-4.0/assets/on every install