Commit Graph

437 Commits

Author SHA1 Message Date
Alx Sa a87afa7255 themes: Set default background-color for buttons
Resolves #9996.
While GIMP has background-colors set for specific buttons,
it did not have a default button background-color. This resulted
in "random" buttons showing system theme colors like the
[Reload Current Theme] button.
This patch defines a default background-color while leaving the
specific button themes intact.
2023-09-30 01:38:37 +00:00
Alx Sa e4c362a9c3 themes: Highlight when hovering over grid view icons
This adds a border when hovering over icons in various
grid views (brushes, gradients, etc). This makes it more
visually apparent which option you can click to select.
2023-09-28 19:01:05 +00:00
Jehan 0a905649c2 themes: make the switch neutral in our Default theme.
Actually just use the foreground color as background when it is checked.
2023-09-25 15:19:56 +02:00
Alx Sa 5211a2c3e8 themes: Define background color for spinbutton buttons
Resolves #9997.

Another system theme leak, this time for the +/- buttons on
GimpSpinButton. This patch specifically defines them to
bg-color.
2023-09-22 18:51:10 +00:00
Alx Sa 59ce1a7255 themes: Define treeview checkbox colors
Resolves #8756 (along with !1065)

The system theme leaked due to the checkbox styling not being
defined for GtkTreeView checkboxes.
The background-image in particular overpowers other settings.
The normal checkbox styling is now specifically applied to
these checkboxes as well.
2023-09-21 22:36:31 +00:00
Alx Sa d928bd2c93 themes: Define menu checkbox border color
Resolves #10015.

The border color of the menu checkboxes was not
specifically defined by the CSS stylesheet, causing
the boxes to appear invisible when unchecked in
certain system themes. This defines the border color
to the same as the menu text to ensure visibility.
2023-09-19 10:59:28 +00:00
Alx Sa aa1cce620c themes: Define menu separator color
Resolves #10007.

The menu separator color was not defined in the stylesheet,
so it could vary based on the system stylesheet.
It is now set to @stronger-border-color.
2023-09-19 02:26:27 +00:00
Alx Sa 8653957b96 themes: Define Save Image actionbar border
Resolves #10040.

A System Theme leak could cause a large border to be drawn around
the export options at the bottom of the Save Image dialogue.
This patch defines them specifically as 1px border with the
@strong-border-color CSS styling.
2023-09-18 20:39:16 +00:00
Alx Sa cb8384e213 themes: Define notebook header border color
Resolves #10000.

The border around notebook headers was not specifically defined in
GIMP's CSS stylesheet, so if the system theme used a different color this
would also change. It has now been defined as @strong-border-color.
The existing CSS was also moved to the same area as the other notebook
header definitions.
2023-09-18 19:32:13 +00:00
Alx Sa eb1a623728 themes: Fix black border bug in scrolled window viewports
Resolves #10020
For some reason, not having the border-radius CSS style set
in widgets inside scrollwindow viewports causes them to have
a giant black order if they're not a full height. This was previously
fixed for GtkGrids. This patch fixes it for GtkBoxes as well, such as
the Procedure Browser description area.
2023-09-16 18:24:45 +00:00
Alx Sa f5ae105f49 themes: Add border for canvas size in Resize Dialog
Adds a class "gimp-offset-area-frame" to the frame containing a GimpOffsetArea in resize dialogues.
This allows the styling from 2.10 to be applied to indicate canvas size when resizing layers.
Since GimpOffsetArea is a GtkDrawingArea object, it can't have CSS directly
applied to it - that's why the class is added to the frame instead.
2023-09-11 20:07:17 +00:00
Alx Sa 48845bdd6f themes: Prevent image tab close button from overflowing...
...the tab itself. Noted by @user062. This adds a right margin to the
close button on the image tabs so that the tab size is pushed out
to fit the button.
2023-07-17 06:43:23 +00:00
Alx Sa 019c1ba5d9 themes: Remove "corners" around combo-boxes
The combo box button is contained within a box element.
The box was also having its background-color set,
so there were small square "corners" around each dropdown menu.
This patch separates the box color from the button color to prevent
this.
2023-07-15 02:51:41 +00:00
Alx Sa 69ddbeba29 themes: Hide 1/0 labels on GtkSwitch sliders
Resolves #9676.
Per @pixelmixer and @programmer_ceds's research,
setting the color attribute on the switch's image children
removes the 1/0 labels on non-System themes.
2023-07-07 18:56:34 +00:00
Jehan 23a87ce4e3 Issue #9350: fix GimpMenu separator lines being randomly thick (other case).
The previous commit did fix one such reason (multiple separators next to each
other), but I realized there is one other case where single separators are just
too big: when the menu is embedded in a GtkHeaderBar, each separator would have
a weird margin of several pixels (at least in my case, probably taken from the
underlying system theme). And worse, this margin was using another background
color.

So anyway this CSS rules takes care of not adding weird margins to menu
separators.
2023-06-25 19:28:54 +02:00
Alx Sa addc37880e themes: Fix "box" on highlighted checkbox label
The checkbox label wasn't included the :hover CSS, so its background
color didn't change. This created a "box" around the label without the
highlight color when the mouse was over it.
2023-06-17 19:01:39 +00:00
Mark 45e91bd550 fixes menu bar being todark for gray theme 2023-06-17 17:48:57 +00:00
Ville Pätsi c9cd4cea2a themes: less thick menu separators and thick dark borders in menu tooltips. 2023-06-16 01:15:39 +02:00
Jehan 317aa803d2 Issue #7172: option to apply Client-Side decoration on image windows.
This patch does the following things:

- An option "Merge menu and title bar" (this is hopefully more understandable
  than calling it "Client-side decoration" or again "header bar") is added in
  Preferences > Image Windows. This option triggers the restart warning.
  Moreover when checked a small warning message will tell that in some cases, it
  may not work (there are feedbacks of people having 2 title bars when using GTK
  applications using CSD).
- For the reason evoked above (sometimes 2 title bars) and also because the CSD
  concept seem really to divide people a lot (some love this as much as others
  hate this), this new option "custom-title-bar" on GimpGuiConfig is FALSE by
  default.
- When the option is checked, the image windows will use a GTK header bar
  containing the menu, the window title (image name and information) as well as
  the usual minimize/maximize/close buttons per your OS conventions.
- Since the header bar is set to be hidden when maximizing, if you checked "Show
  menubar" for the "Default Appearance in Fullscreen Mode" in Preferences >
  Image Windows > Appearance, the menu will be moved to its "old style"
  position, i.e. above the canvas. This makes the menu possibly visible (if
  relevant option is checked) even in fullscreen mode.
- I tweaked the Default theme to show the header bar with minimal height,
  because I find GTK default theme's headerbar height unreasonably high
  (especially if the point of the header bar is to save screen space). I am
  unsure if this was the right move though, because maybe the default theme
  should not do such choices (maybe this should go in the Compact theme?).
2023-06-09 20:19:01 +02:00
Michael Natterer 26dce72d2c Remove autotools 2023-05-27 00:03:52 +02:00
Jehan 821711badb themes: "System" theme should not use smaller font size.
What we call "System" theme should have very minimal edits over the
actual system theme. So let's drop all the "font-size" properties (one
"larger" one, but especially the many "smaller" ones).
This means that the "Default" theme also will keep system font size.

This is as discussed with Ville and Liam, the later saying he can barely
read dockable texts because of this.

On the other hand, we use "small" font size as a general rule in the
"Compact" theme, which is especially meant for people who want a compact
theme.
2023-05-25 18:10:56 +02:00
Jehan a660a378ac themes: updated Default theme by Ville Pätsi.
The Default theme may have been a bit too dark. Instead let's have it a
tiny bit lighter (and also foreground color a bit less white).

For now, the old "Default" dark theme doesn't disappear totally and is
moved to a "Darker" theme as we have been discussing and wondering on
whether this is prefered by some people (it is). Aryeom also thought a
darker theme may be a good idea.

Moreover Liam actually thought that losing some of the contrast
(especially with the text a tiny bit less white now) is not desired in
his case where eyes may not be as sharp as they used to. Therefore a
"High Contrast" theme may be needed.

Aryeom also suggested that sliders to choose colors could be a much more
generic solution, which might be possible yet would require more ugly
hacks generating on-the-fly theme changes (we do something similar for
dark theme choice already).

This is all work-in-progress and a result from Wilber Week 2023 work.
2023-05-25 02:23:24 +02:00
Michael Natterer 9c9d3aaa35 themes: minimize spinbutton height in docks too
but add 2px top and bottom padding so all of those entries don't look
like the just escaped the garbage compactor.
2023-05-24 15:17:27 +02:00
Michael Natterer ee6108aa04 themes: minimize the height of all entries in docks 2023-05-24 14:47:42 +02:00
Stanislav Grinkov d1eb30d863
themes: Set smaller Compact theme separator width...
for better consistency with the overall theme.
2023-02-14 16:50:38 +06:00
Stanislav Grinkov bbbbc671eb
themes: Increase dockable panel separator width...
to make panel resizing action more accessible.
2023-02-14 16:50:38 +06:00
Stanislav Grinkov 49cbe651a6
themes: Add three-dot handle to paned separators ...
to improve their accessibility to Default, Gray,
and Compact themes.

Resolves: #9144
2023-02-14 16:50:32 +06:00
Jehan 6c0c2f15c4 themes: toggle buttons were not styled at all when toggled. 2022-10-15 22:33:25 +02:00
Jehan 9aa32ffe42 themes: fix textview background color.
It seems I had forgotten some hardcoded color in there. I didn't notice it until
now, because it was not that bad in the few instances where it was shown (for
instance the comment field in export plug-ins), but I really realized there was
a problem with the Python console which was not too practical (white writing on
kinda light background).
2022-09-30 00:51:33 +02:00
Jehan 4e08ab9659 themes: add some border theming to default and active buttons.
I noticed some buttons had a bluish border, showing the system theme leaking
over our default theme. So I'm just overriding this with a grayscale color.

These 2 new rules are especially useful in dialogs so that you know what happens
when you hit "Enter". The "default" action (.suggested-action in GTK CSS) is the
action we set to be the active one by default. E.g. if you open a dialog and hit
Enter immediately, without touching any widget focus, this is what will be
activated.

The GTK CSS .default action on the other hand seems to simply be the button with
focus right now, which can be changed through Tab or other ways. If both types
of styles are visible, the .default one is the actually activated action (not
.suggested-action), which is why I make its style a bit stronger (solid rather
than dotted and a bit more opaque).

Also I discover the shade() function to reuse a color and adding it
transparency!
2022-09-29 21:06:47 +02:00
Jehan 5c53fe7b49 themes: no different background for checked check/radio buttons.
Checked buttons had a background using the @selected-color. This was because of
a too broad rule on `.text-button:checked`. Basically it looks like the broad
rules are not good because they sometimes override more accurate rules for
specific widgets.

I also make a few more rules a bit more accurate. Also I extend some CSS rules
for check and radio buttons.
2022-09-29 19:59:55 +02:00
Jehan 91ec8a34f3 themes: have the "extreme" CSS colors a bit less extreme.
We had some concept of slightly more extreme theme colors (i.e. darker in dark
themes) to color differently in some widget-in-widget cases.

For instance, we use this in the treeview list to separate it better from nearby
interface. But this extreme dark background may have been a bit "too dark", as
reported by Jacob. The goal is for this list to stand out, but maybe it was
standing out too much. Hopefully it's better now.

As a side change, I also add some borders to the top icon header (with "eye" and
"lock" icons) just above the list. I think it better explain the separation.
2022-09-29 19:01:00 +02:00
Jehan 4ab1102ae2 themes: switch should have a border otherwise it's hard to understand. 2022-09-29 00:04:12 +02:00
Jehan 7c96fc723c Issue #8670: the color of the "selected text" field seems too dark.
Just use an inverted logic for the selected text (i.e. white on black in light
mode, or black on white in dark mode). This is the usual logic for rendering
selected text anyway (except that we don't use non-grayscale colors, e.g. blue
background is common in system themes).
2022-09-28 23:27:50 +02:00
Jehan b48bd7d337 themes: do not set a background-color on all .horizontal class widgets.
This was massively breaking GtkScale rendering. Or at least the marks (and mark
texts) added by gtk_scale_add_mark() were simply invisible.
I tried to figure why, staring at the GTK inspector and testing various CSS
rules to fix it without removing this line, but just couldn't make sense of it.
In the end, I'll just remove this line. It looks like in CSS (or just GTK CSS?),
it might be better to set rules on accurate widgets rather than too broad rules. 🤷
2022-09-28 20:49:54 +02:00
Jehan d2cf2813dd themes: new "Middle Gray" theme.
So what we read on the topic is to use (as base color) the gray which is
perceptually half-way between black and white. Unfortunately it can mean
different colors. For instance if using the sRGB TRC, the #808080 color is
sometimes cited.

Instead I went with the color LCH (50, 0, 0), i.e. with half perceptual
lightness in "CIE LCH(ab) float" babl space, i.e. #777777 in sRGB. It
corresponds to the 18.42% gray which is often refered to, so it seemed a fine
choice.

This replaces proposal in !683 because the contributor is not responding
anymore, and also it uses the common theme base CSS files used by all other
official themes.
2022-09-26 18:37:16 +02:00
Jehan e916e93c1d themes: better styling for background dialog.
This linear gradient really doesn't render any feeling of "background"
IMO. I only initially implemented it this way because the underlying
theme seemed to use such gradient effect on headerbar for background
dialogs, so I wanted to test this.

Anyway simply using the "disabled" color seem to work well. After all,
the semantic is similar too (if it's in the background, a dialog can be
considered inactive in some way). In any case, the meaning definitely
comes across now.
2022-08-21 12:44:30 +02:00
Jehan c4682be682 themes: use the disabled color more globally.
Don't use it only on menus. For instance, there were disabled checkboxes
(and their label) in plug-ins which were not showing different at all,
and it's confusing. Now both menu items, and other type of settings will
show similar "disabled" style.
2022-08-21 12:12:32 +02:00
Jehan 64113d67bc themes: new Compact theme.
Something which is regularly asked is to use smaller icons. We used to
have a "Small" theme in 2.8, which got away in 2.10 with icon sizing (cf
issue #6121).

This is a revival of such a theme (except I call it "Compact" because it
feels more appropriate than "Small"). The theme is basically the same as
"Default" (through an include), just tweaking some size related CSS
rules.
2022-08-21 00:05:10 +02:00
Jehan ebbcf67dd9 theme: transform the Light theme into a Default theme and add a dark…
… variant.

Now with my recent code, instead of creating 2 different themes, I make
it a single theme containing both a Light and Dark variant.

I move all semantic logic into common.css which will be included by both
variants after they set up their color definitions.

For choosing the basic gray to use for the dark variant, I first looked
up what is usually recommended. Most articles on the web about dark
themes would cite some "Material design" project (apparently originated
from Google) which makes guidelines for Android/iOS/Flutter and web
applications. Their guidelines recommend #121212 ("Dark Grey") as
background color. I tried, it's **really** dark. Maybe I'm just not used
to it, but it feels like it might be OK for small phone "apps" which
people might want to watch in the dark, but possibly not for a full
grown desktop software. I don't really know, I might be wrong and some
people might want to edit their pictures with such dark GUI.

Anyway for now, I settled for a base background #303030, which is
already quite dark, darker than Adwaita dark or than our 2.10 dark
variant, but at least doesn't feel like a black hole.
2022-08-20 20:10:57 +02:00
Jehan 05fd811662 themes: parameterize colors of our Light theme.
Instead of hardcoding the colors in CSS rules, make variables of them,
with meaningful semantic names. It will help with making consistent
design where a color means something and is reused in several places
(e.g. a color for "hovering" or "selecting").

I add some variants but not too much (e.g. treeviews had even lighter
background, with an inversion of logic, where selected items are on
darker background instead of lighter).
Colors in this theme are mostly the same before and after this commit,
except for a few parts where I felt that having more variants was
detrimental for consistency and maintenance.

As part of the changed colors:

- check and radio buttons' background just reuse the lighter background
  color (as used e.g. in treeviews and entries).
- menus also use this lighter background color with the color inversion
  (same as treeviews) for hovered items.

This commit also brings some improvements to disabled cases:

- Stylize also disabled tree view items (e.g. disabled actions in action
  search were styled the same way as runnable actions).
- Stylize the same way disabled buttons drawn directly or with an image
  widget.

The last use for this change is that it will help to create a dark
variant for the same theme using nearly the same code, hence get
consistent styling.
2022-08-20 19:23:38 +02:00
Jehan 5b17d08809 themes: improve themes.
- Indent all rules in Light theme with the same number of spaces for
  style consistency.
- When GIMP was set in "Prefer dark variant", spin buttons and other
  entries had too dark borders. Fix this.
- Fix the spinbutton entry's border radius which was at 0, but since the
  buttons of the spin button are themselves rounded, it looks weird only
  on the top and bottom left corners. So apply a 3px radius. I did this
  in the System theme.
2022-08-20 14:04:28 +02:00
Alx Sa 0f5431b590 themes: updates to Light theme
Makes the following changes:
*Toolbox Wilber is now visible
*Large black border removed from ScrolledWindow
*"Duplicate text" effect removed from labels
*Toolbox tabs are now stationary when changing selection
*"Add Tabs" menu background color changed to match Light theme
*Unnecessary border around Check Updates box removed
2022-08-20 03:11:53 +00:00
Jehan 6b3d69a3c5 themes: some fix to the new Light theme.
These are issues which appeared to me only when GIMP was set to use the
dark theme variant. In such a case, I guess we see quite well CSS rules
coming from parent themes, such as the globally set system theme.

* Remove any background image (which may come from the system theme?) on
  buttons.
* The headerbar was dark and when in the background, it had a dark
  linear gradient (probably coming from my system theme). So make sure
  the background color is right as a general rule, and add back a
  (small) light gradient to indicate the background state.
* GtkListBox had a dark background. We don't have a lot of usage for
  this widget yet, but a few (for instance in icon theme settings, or in
  the modifiers editor).
* The GtkSwitch buttons were dark on dark. Set a light background. Also
  when the switch is ON, I add a bit of color, not too strong, but
  enough to indicate the checked status, because I find this widget
  design not so obvious. Since I don't think we use switch buttons
  anywhere else but in Preferences, this is probably not a big problem
  as it should not affect color perception when working on the canvas.
2022-08-19 20:27:57 +02:00
Akkana Peck 947bd1666a themes: add Light theme
It still has some issues, but it's already pretty usable.
2022-08-19 17:40:49 +00:00
Jehan 6b5037f039 libgimpwidgets, themes: more compact GimpSpinScale.
There were some complaint about the height of these scale.
The min-height was clearly too high. I also made the buttons a bit more
compact by removing a bit of padding.

Finally I add a CSS name to the class, in order to avoid using the
parent class name ("spinbutton"). This makes for clearer and more
customizable themes (ability to style the GimpSpinScale without styling
GtkSpinButton too).
2022-02-17 23:13:42 +01:00
Stanislav Grinkov 65fcda3b70 themes: Add a bit of padding around treeview header column icons 2022-02-16 04:07:50 +00:00
Stanislav Grinkov 50ae1d1a68 themes: issue #7303. Add on-hover indicator around...
... inactive/unset eye/locked toggles in Layer/Channels/Paths dialogs.

Resolves: #7303 (GNOME gitlab tracker)
2022-02-16 04:07:50 +00:00
Ell 887d6a3670 app, themes: fix display-shell statusbar height
In gimp.css, don't set a minimum height for GimpDisplayShell
statusbars.  Instead, in GimpStatusbar, set the widget's minimum
height to the maximum of its children's natural heights.  Note that
we have to do this manually, instead of using a size group, since
GtkSizeGroup::ignore-hidden is deprecated (and nonfunctional) in
GTK3.
2020-06-18 13:12:29 +03:00
Ell a5535dc9c9 themes: improve GimpColor{Notebook,Scales} spin-button style 2020-06-17 10:40:42 +03:00