{{ message }}
Repository navigation
fix(css): fix desktop rename box styling on dark themes (#3843) - #3859
Open
ronitgupta138 wants to merge 1 commit into
Open
ronitgupta138 wants to merge 1 commit into
ronitgupta138 wants to merge 1 commit into
Conversation
When renaming an icon on the desktop, .nemo-window .nemo-window-pane widget.entry in nemo-style-fallback-mandatory.css matches the rename entry with higher specificity (0,3,1) than .nemo-desktop.view .entry (0,3,0) in nemo-style-application.css. Because the mandatory sheet only overrode color and background-color, background-image and caret-color fell through to the hardcoded light-theme defaults (#000000 caret and white linear gradient). On dark themes, this caused white text to be rendered over a white gradient with an invisible black caret. Neutralize both leftovers by setting background-image: none and caret-color: @theme_fg_color on .nemo-window .nemo-window-pane widget.entry, and ensure background-image: none is also set on widget.entry:selected. Fixes linuxmint#3843
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.

Fixes #3843
Cause
When renaming an icon on the desktop with dark GTK themes (such as
Adwaita-dark), the filename appears as near-white text on a white gradient background with an invisible black text caret.This occurs due to a CSS cascade specificity conflict between the two shipped stylesheets:
nemo-style-application.cssdefines:nemo-style-fallback-mandatory.cssdefines:Because the desktop window carries both
.nemo-window/.nemo-window-paneand.nemo-desktop, the mandatory rule matches the desktop rename entry (widget.entry) with higher specificity (0,3,1vs0,3,0).The mandatory rule overrides
color(to@theme_fg_color, light in dark theme) andbackground-color(to@theme_bg_color, dark in dark theme), but omitsbackground-imageandcaret-color. As a result:nemo-style-application.cssis not overridden and is painted over@theme_bg_color, producing near-white text on a white gradient.caret-colorremains hardcoded to#000000, making the caret invisible against the dark background.Solution
In
gresources/nemo-style-fallback-mandatory.css:background-image: none;andcaret-color: @theme_fg_color;to.nemo-window .nemo-window-pane widget.entry.background-image: none;to.nemo-window .nemo-window-pane widget.entry:selectedfor consistency across entry selection states.Verification
GtkStyleContextresolution using GTK 3 (gi.repository.Gtk):EelEditableLabelwidget path resolution (window.nemo-window.nemo-desktop-window > box.nemo-window-pane > box.nemo-desktop.view > widget.entry).background-imageresolves toNonein both normal and selected states,caret-colorresolves to@theme_fg_color, and text/background colors properly adhere to theme tokens (@theme_fg_color/@theme_bg_color).@theme_and@variable naming conventions handled bysrc/nemo-application.c.