Commit Graph

463 Commits

Author SHA1 Message Date
Alx Sa 4de7c7defb themes: Removing padding constraints on GimpToolDialog
Resolves Issue #9955.
GimpToolDialog CSD buttons were being singled out to only
have padding of 2px. This was inconsistent with other dialogues
without this constraint. Since the larger padding style seems to
be preferred, we'll remove the constraint for GimpToolDialog
CSD buttons.
2024-05-16 15:49:10 +00:00
Alx Sa bcf5697289 themes: Define GtkListBox row styles
Resolves #11531

GtkListBox's CSS was previously defined, but GtkListBoxRow
did not inherit those values. This patch explicitly defines this
so we do not have system theme leaks.
2024-05-14 15:13:49 +00:00
Alx Sa 094ae8eec3 themes: Apply 77ee80f3 to generic spinbuttons
Resolves #11337
2024-04-18 18:57:37 +00:00
Alx Sa 77ee80f329 themes: Removing more instances of -gtk-icon-shadow
Per Bruno Lopes, we should extend aefdb84b to also cover
dropdown box arrows and GimpSpinScale buttons.
2024-04-18 18:06:35 +00:00
Alx Sa 337ec4cd57 themes: Prevent "bold" button icons when focused
Extends aefdb84b to all buttons with images.
2024-04-17 10:37:49 +00:00
Alx Sa aefdb84bb4 themes: Prevent too thick image button border
Resolves #11337

"gtk-icon-shadow" is applied to all buttons with images,
which creates a bold effect on symbolic icons.
This patch zeroes this effect out and makes them highlight
the background in the same way as the toolbox buttons.
2024-04-17 04:15:17 +00:00
Alx Sa 841d926f4b themes: Prevent .text-button from overwriting radio button background
Resolves #11244

GtkRadioButtons can also have the .text-button CSS class set. This class was overwriting
the radiobutton background color, making it appear dark and box-like.
This adds a specific radiobutton.text-button definition to ensure the background color
is consistent (as we had to do with checkbutton.text-button)
2024-04-07 00:06:52 +00:00
Bruno Lopes 06b18b9c58 themes: Fix title bar mode (following 879cec87)
After the referenced commit, the title bar became to tall. This was
due to lack of testing. Now, both title bar and header bar are 36px.
2024-04-06 09:26:10 -03:00
Alx Sa d0d63efac9 themes: Define box-shadow for tooltips on System theme
Applying cc120f1b to the System theme as well, so that the issue
is resolved for both.
2024-04-03 20:37:59 +00:00
Alx Sa cc120f1bd9 themes: Define box-shadow for tooltips
Resolves #9795

(Solution provided by Andreas G, @uriesk)
Some system themes provide errant values for tooltip
box-shadows which cause flickering effects.
This patch defines the tooltip box-shadow to 0px to
prevent the issue.
2024-04-03 13:38:01 +00:00
Bruno Lopes 879cec8786 Issue #9999: Fix arbitrary headerbar height
The merged menu + title bar (headerbar mode) wasn't matching the height of
the title bar mode. This is inconsistent and, worse, ugly even in 768p.
2024-03-24 17:07:14 +00:00
Alx Sa db88383abb themes: Define no box-shadow on unselected tabs
As shown in a video for issue 11087, some system themes
may add a white box-shadow on the side of unselected
tabs. This patch forces box-shadow to "none" to prevent
this.
2024-03-22 16:27:55 +00:00
Bruno Lopes 683c6a3063 Issue #10960: Make disabled checkboxes less confusing 2024-03-02 12:59:33 -03:00
Alx Sa 8686e3f542 themes: Remove deprecated GtkPaned style
Resolves #10934.

GtkPaned's handle-size attribute has been deprecated.
Since we have our own custom paned separator, it is not
needed anyway.
2024-02-26 18:08:46 +00:00
Jehan 495523db39 themes: removing "Darker" theme.
I believe there is a real use case for darker or lighter themes, but this
particular theme is not particularly maintained and has no light variant (or to
be accurate: the light variant is just a link to the "Default" one). If someone
is interested in such themes, we'll welcome contributions to revive a new theme
which should have at the very least both a light and dark version, and we could
name it "Contrast" (rather than "Darker" which focuses on a dark variant only).

I think it's better to do it this way rather than releasing with a half-done
job.
2024-01-31 15:27:50 +01:00
Jehan 87a3073b04 app, themes: get rid of Compact theme and move its logic into code.
The Compact theme code is nearly the same as the Default one, apart from setting
palette icon size to small (which is already something done by the "Override
icon sizes" setting in Preferences), setting font-size to small (which can be
independently set by our "Font Scaling" setting) and setting 3 paddings.

Rather than having this separate theme, it feels like just moving the padding
changes as part of the icon size makes sense. In particular since, when setting
icons to "Small" right now, the default padding really feels a bit huge and out
of place. So all-in-one seems a better choice.

At first, I wanted to set a padding proportional to the icon size, but it didn't
work well. For now, I'll just choose padding sizes manually.
2024-01-31 15:27:50 +01:00
Jehan c32e803679 app, themes: merge the Gray and Default themes and add theme color scheme concept.
Until now, we were following a similar concept of color schemes as what most OS
are doing. For instance, Freedesktop recently introduced a tri-state color
scheme of "Prefer Light", "Prefer Dark" and "Default", the latter being either
whatever the software prefers (e.g. we prefer either Dark or Gray for graphics
software usually) or what the system prefers. See #8675.

Until now, with GTK, we only had a boolean "prefer dark" setting through the
"gtk-application-prefer-dark-theme" settings. There is not even a "prefer
light".

Nevertheless for graphics application, there is clearly a third case (fourth if
we added a "follow system color preferences" which we don't implement for now):
gray mode and in particular middle gray. Having a middle gray UI is often
considered a necessity when working on colors in order to protect our perception
of color from being influenced by surrounding UI.
To fill this need, we were proposing a Default vs. a Gray theme in GIMP, but
this was a bit confusing and felt illogical, as discussed on IRC some time ago.
Also depending on whether you chose "prefer dark" or not for the gray theme,
this one was itself 2 themes, which made things odd and harder to work on.

Instead this commit:

- adds a color scheme concept in GIMP with 3 variants so far: light, gray and
  dark. A possible fourth (future) variant might be to follow the system
  preference (do all OS provide such a queriable option?).
- Our Gray theme is merged into Default (as the gray color scheme variant).
- Custom themes can add the following CSS files: gimp-light.css, gimp-gray.css,
  gimp-dark.css which are the base file for their respective scheme. gimp.css is
  still used as a fallback though it is not necessary (our own Default theme
  does not provide a gimp.css anymore). Custom themes don't have to provide all
  3 variants. A theme can just provide one or 2 variants if it only wants to
  support 1 or 2 use cases.
2024-01-25 18:56:13 +01:00
Alx Sa 2aa0a9d42b themes: Prevent system theme leak on stacks and viewports
If a system theme sets the background-image property for stacks,
it recolors the main canvas when empty. It also adds a border to
the toolbox Wilber area.
Additionally, the Credits page of the GtkAboutDialog has odd colors
due to general viewport grid styles overriding the GTK default.
This patch fixes these problems, and adds a custom CSS class to
the GimpAboutDialog for current and future work.
2024-01-11 20:03:48 +00:00
Alx Sa 0351f48dfe themes: Defining menu, tab, and tooltip styles
This is intended to prevent system theme background-images
and borders from overriding those set by GIMP.
The minimum size of tabs is also explicitly defined.
2023-12-28 16:47:10 +00:00
Alx Sa 820e96c67b Themes: Fix button shadow on dark theme hover
Resolves #10477.

The dark theme box-shadow for buttons does not blend well
when hovering over it, compared to the light & gray themes.
This patch adds an additional CSS rule to make the box-shadow
no longer clash in dark theme.
2023-12-14 19:39:54 +00:00
Alx Sa 3c261a2334 themes: Define button and header edges
This continues the theme definition work from bd398d5c.
A new edge-border-color tag was created
to allow for defined widget edges in both
light and dark themes.
The box-shadow highlights for buttons
and header/menubars was defined to
reduce system theme leaks. Some CSS
attributes were rearranges as well.
2023-12-02 18:57:20 +00:00
Alx Sa bd398d5cff themes: Define some widget's border colors
Adds specific definitions for some widget borders that
are currently only defined by the system. This avoids
clashing colors depending on the system theme.
2023-12-01 17:09:35 +00:00
Alx Sa 75c78bf19c themes: Define border-radius for radio buttons
Resolves #10033

Not all system themes set a GtkRadioButton border-radius, so it
can default to 0. This creates a "box" around the radio button.
This patch defines the border-radius at 100% to make it universal.
2023-11-29 12:03:39 +00:00
Alx Sa a8369f57c1 themes: Define more GimpSpinButton styling
As shown in issue 10287, the system theme can create a
large white border around GimpSpinButton.
This patch fixes this, and also improves the border appearance
by assigning it to the background color rather than system default.
2023-11-09 13:26:55 +00:00
Alx Sa 0faaf7c379 themes: Define behavior for clicking already selected button
Resolves #9989

In 2.10/GTK2, clicking an already selected toolbutton caused the
background color to change to indicate this action.
This patch restores that behavior through CSS updates.
It also slightly rearranges the CSS to group related button styles.
2023-10-22 16:59:29 +00:00
Alx Sa 208e22da3a themes: Define file dialog path buttons hover colors
Resolves #10039.

This keeps the highlight style consistent for the file
dialogues, no matter the underlying system theme.
2023-10-20 02:30:14 +00:00
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