Skip to content

Commit

Permalink
Theme the Caja file manager in Icon / Compact view correctly
Browse files Browse the repository at this point in the history
Despite the name of the file manager's mode, Icon View (in Caja) does not
use a GtkIconView like one would expect.  It uses a purpose-built,
file-manager-specific widget called CajaIconContainer.

When one renames a file while Caja is in Icon View or Compact View mode
(both use CajaIconContainer), another specialty, non-standard widget is
used: the EelEditableLabel.  The editable label widget is supposed to
look like a GtkEntry widget, but they are not quite implemented the same,
and as such theme designers need to add style declarations for the editable
label separate from the declarations for GtkEntry.

Gtk-Theme-Raleigh did not theme EelEditableLabels in the past, but this
commit now themes the labels like GtkEntry widgets.
  • Loading branch information
thesquash committed May 12, 2022
1 parent 17b6ac1 commit 18f06f7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
21 changes: 21 additions & 0 deletions themes/Raleigh/gtk-3.0/application-styles/caja.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,24 @@ widget.view.rubberband
{
background-color: alpha (@selected_bg_color, 0.6);
}

/*
* The following style declaration themes EelEditableLabels, which are used
* primary by Caja (and possibly other file managers) for the pop-up text
* fields used for renaming files in Icon and Compact views.
*
* Even though an EelEditableLabel is not a GtkEntry, we try our best to make
* the two look identical.
*/
widget.entry:not(:selected)
{
/*
* Oddly, `background-color` does not work here; we must use
* `background` in order for EelEditableLabels to have an appropriate
* background.
*/
background: @color_2;
border-image-width: 2px;
border-image-slice: 2;
border-radius: 0;
}
4 changes: 3 additions & 1 deletion themes/Raleigh/gtk-3.0/gtk-assets.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ frame > border
/* From widgets/lists-and-views.css */
entry,
textview,
:not(stack) > list
:not(stack) > list,
/* From application-styles/caja.css */
widget.entry:not(:selected)
{
border-image-source: url('../gtk-assets/light/borders/entry-border.png');
}
Expand Down
4 changes: 3 additions & 1 deletion themes/Raleigh/gtk-3.0/gtk-dark-assets.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ frame > border
/* From widgets/lists-and-views.css */
entry,
textview,
:not(stack) > list
:not(stack) > list,
/* From application-styles/caja.css */
widget.entry:not(:selected)
{
border-image-source: url('../gtk-assets/dark/borders/entry-border.png');
}
Expand Down

0 comments on commit 18f06f7

Please sign in to comment.