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.
Creates two new parasites to save the black point compensation status
and rendering intent simulation settings in GimpImage.
The parasites are saved and loaded as part of the image in the
.xcf file.
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.
Until now we were sizing the FG/BG area with hardcoded size ((40, 38)
which I'm not sure where it came from!). Now this allocation size will
depend on the toolbox icon size (I made so that the FG/BG area is more
or less the same size as former hardcoded values with large toolbar
icons).
I had to tweak a bit the size of the default FG/BG icons and the swap
icons, which were also hardcoded. They now also depend on the allocation
size, hence the icons size.
Note that this code still has a limitation: it won't resize when you
switch from a theme with one size to another size of icons. A restart
will be necessary. This is something we should improve.
… 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.
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.
This way, what will happen is that:
- We can have a single "Default" theme which will have both the light
and dark versions.
- With our Default theme, when "Use dark theme variant if available" is
unchecked, we just follow the system-wide dark settings. (though I'm
unsure we actually do with current code; we do load our theme over the
system theme, which may be dark, but I don't think we'd load a dark
theme variant then)
- If the option is checked, we will load the specific dark variant,
bypassing system settings specifically for GIMP.
Technically for theme designers, all it takes to have a dark variant is
to add a gimp-dark.css next to gimp.css. `gimp-dark.css` is loaded
instead of `gimp.css` when the settings is checked.
Note: there is apparently a new freedesktop portal for setting the
prefered variant (and now it's apparently either light, dark or
default), which is now implemented by GNOME, KDE and Elementary at
least. It would be nice if we could grab this settings and use it if
available. The below link has code sample showing how to do it with
DBus:
https://gitlab.gnome.org/GNOME/Initiatives/-/wikis/Dark-Style-Preference
- 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.
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
Optionally includes the previously saved
Duotone color space data on PSD export.
New load dialogue alerts user if duotone data was imported.
New export dialogue appears if the image is still grayscale and
the parasite exists.
If selected, the mode is set to PSD_DUOTONE in the header and
the original duotone data is written in the color space section.
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.
Add the info about max dimension of WebP with WEBP_MAX_DIMENSION macro.
There is also a test about (picture->width / 4 > INT_MAX / 4), resp.
height, but this should anyway never happen as the C spec says the
smaller range for int is [-32767, 32767], which is an order bigger than
the current WEBP_MAX_DIMENSION (16383).
So we are probably fine assuming all VP8_ENC_ERROR_BAD_DIMENSION errors
will happen because of WEBP_MAX_DIMENSION.
Actually our X11 implementation is right, and the implementation from
the Freedesktop portal is "as far as it can do", i.e. that we get the
returned RGB value, which is unfortunately in display space. And it
doesn't return any space information together (we don't even know which
display the color comes from, in multi-display setups).
Therefore let's check if we are running GIMP on X11 and if so, let's
call this implementation first.
See this report on xdg-desktop-portal to get proper space info:
https://github.com/flatpak/xdg-desktop-portal/issues/862
We should set these explicitly, otherwise it will usually default to the
first of the enum, which is perceptual (which is usually not a proper
choice).
Relative colorimetric is usually the recommended default.
The GimpColorProfileComboBox widget requires the profile chooser dialog
to be explicitly constructed. It doesn't create it by itself.
I guess I hadn't tested clicking this "Select color profile from disk…"
combo item during review. I only selected visible profiles in the list!
This adds a Soft-Proofing pop-over menu when right-clicking the toggle
in GimpStatusBar. It lets users toggle proofing, using BPC and showing
out-of-gamut colors. It also lets users change the profile and
rendering intent.
Opacity and brush size are among the 2 most common tool options which
people might want to often change, though we should likely later add all
other common types of tool settings angle, aspect ratio, spacing, etc.
I am also unsure using the enum action is the right call because what it
does is just taking into account the distance from initial click to
compute an opacity. Instead it might be more interesting to increase or
decrease slowly or rapidly by going right or left from the initial
click. We'll see. But it's a first step.
The mouse controller had many limitations:
* It was not per-device.
* It was a long hard-coded list of events, which made its evolution
annoying and scrolling the list boring.
* It was starting at button 8, while the first buttons were supposed to
be hardcoded interactions. And it stopped at button 12, while some
device might have more buttons nowadays. See !386.
* The "Grab event" does not seem to work in many cases, according to
feedbacks.
The new GimpModifiersEditor will now handle any button (except the first
button, which is reserved for tools), you can even override or change
default canvas actions (panning, rotation, etc.). It should not be
limited with a max button number either (though I haven't tested with a
device really having a lot of buttons since I don't have any such device
but I did emulate huge button numbers on my stylus with xsetwacom and it
did work well; hopefully I'll get feedbacks). And now it can even run
custom actions.
So basically it should deprecate the mouse controller as the modifiers
editor can do everything the controller could, and more (unless I missed
anything).
Custom actions are basically any action (currently GtkAction) which can
be assigned a shortcut. Now they can also be assigned to an input device
button (with modifier or not).
* The relative brush size change was not implemented anyway. Maybe later.
* Also changing the defaults to GIMP_MODIFIER_ACTION_BRUSH_PIXEL_SIZE
which I think might be the most understandable size variant.
* Finally re-label "Rotate" to "Rotate View" as per Aryeom's feedback
because just "Rotate" is indeed confusing as it could mean several
different actions in GIMP.
Actually I am renaming GIMP_MODIFIER_ACTION_BRUSH_PIXEL_SIZE into
GIMP_MODIFIER_ACTION_BRUSH_RADIUS_PIXEL_SIZE, which allows to set the
brush size on-canvas, starting from center to border.
The new GIMP_MODIFIER_ACTION_BRUSH_PIXEL_SIZE now sets the brush size
from one border to another.
Space: panning
Ctrl-space: zooming
Shift-space: rotating
Ctrl-shift-space: constrained rotating
Note that these are still hardcoded, unlike the actions through
modifiers + pointer buttons.
There is really no need to make back and forth between a string and
int/enum representations, and it actually cause problems at times.
It's also a problem for the button representation where a modifier will
be represented as a key.
For now GimpModifiersManager returns the same modifiers as what was
previously hardcoded and we have no GUI yet to change the settings. But
the core of the new feature is in place.
This object's goal will be to manage customized modifiers per input
device button, which is why I add it to GimpDisplayConfig. It is in its
own new config file (`modifiersrc` in config dir) because it requires
GDK types access (well I could have done without, but it would have been
less semantic, hence not as good of an API). Anyway it is only useful
when running GIMP as GUI.
The GUI widget and the usage code to make this actually useful will come
in upcoming commits.
When no accelerator was set yet, display relevant information, and when
the button is toggled (waiting for shortcut input), display also
relevant info.