Commit Graph

359 Commits

Author SHA1 Message Date
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 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
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 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
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