Commit Graph

15 Commits

Author SHA1 Message Date
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
Jehan d3458a82d0 Issue #7023: icon size selection on GIMP 2.99.
This kinda reverts commit 6aebd30de1 ("app: remove
icon sizing preferences"), except that the code base is different enough since
this old commit was mainly for GIMP 2.10.x.
In any case, after initially thinking that GTK+3 handling for high density
display would be enough, we finally decide that adding back a Preferences-wide
setting for overriding the theme-set icon size is a good idea (additionally to
GTK+3 automatic support).

The base idea for removing the feature was that GTK+3 has high density display
support, through the "scale factor". Typically a high density display will
normally be set as using a ×2 scale factor so all icons will be double size.
Unfortunately it turns out it's not enough.

For instance, on very small screen estate, even with a scale factor of 1, if the
theme sets 24px toolbox icons, it may still take too much space.
Oppositely on huge screens, even with ×2 factor scale detected by the OS, the
icons may still feel too small (this is possibly what happens with #7023).

Furthermore there is also a matter of taste. Some people like small icons even
when they have the space. Others may want bigger icons, easy to click on.

Finally you can like a theme for its color scheme for instance, but it may not
have the icon size you want. Right now, we'd need to duplicate every theme in
small or bigger size. Instead of doing so, let's just have this global setting
overriding the theme rules.

Comparison with the 2.10 implementation:

- We still provide 4 sizes: small, medium, large and huge.
- We don't have the "Guess ideal size" setting anymore. Instead this is now a
  mix of the GTK+3 scale factor logic and the theme-set or custom size. I.e.
  that on a high density display with ×2 scale factor, we could have toolbox
  icons up to 96 pixels (48×2)!
- We now try to have less custom code in widgets as we append the CSS rules to
  the theme (similar to what we were already doing for dark theme or icon
  variants). What happens in widget code is mostly to connect to changes in
  themes and redraw the widgets which need to be.
- The custom size will now affect: toolbox icons, the FG/BG editor widget (in
  both the toolbox and the color dockable), dockable tab icons, the main
  dockable buttons, eye and lock header icons in item tree views, eye and lock
  cell icons in the item lists.

There are still a bunch of areas where it is not taken into account, such as
plug-ins, and various dialogs, but even in custom-made interface in dockables.
Ultimately it might be interesting to have a way to sync more buttons and
widgets to a global size settings.

Lastly, I fixed a bunch of existing bugs where we were updating icon sizes with
gtk_image_set_from_icon_name() using the const icon name taken from
gtk_image_get_icon_name(). As this was reusing the same string pointer, we were
ending with freeing the icon name.
2022-09-28 21:11:58 +02:00
woob 505a78e715 app: Add option to re-enable previous drag-to-zoom behavior
Adds a new configuration option "drag-zoom-mode" to choose whether to
zoom by distance of movement (newly added) or by duration of movement
(previous behavior) when zooming via dragging the mouse, defaulting to
distance.
This option can be found in the preferences dialog as:
  Image Windows -> Zoom & Resize Behavior -> Drag-to-zoom behavior
2022-04-05 12:31:11 +00:00
Jehan fc063cb2ca app: use the unobtrusive cursor only in no-pointer+no-outline case.
We take a step back from the original MR which was proposing the "single
dot" cursor as a new "Pointer mode" option. I was really unsure this was
the best solution, especially reading again the whole original report.
It means that now nearly all of the original patch has been rewritten
another way, but let's leave the contributor commit as a start point to
get to where we are, and as acknowledgement of the contribution.

The reporter was annoyed by the crosshair when none were requested and
probably mostly for painting tools only (at least examples were about
brush or pencil, etc.) while showing outline. It looks to me like the
real issue was maybe when we were showing the big crosshair when using
the 4-arc fallback outline, for instance when using a dynamics changing
size. If so, this main issue is already fixed by my commit 64dc26064b.
No need of a new option for this, especially if the option can be as
confusing as a barely visible dot-cursor (I can already imagine the bug
reports of people tweaking random preferences and unhappy because the
pointer became invisible, while they don't know how they did it).

Instead I would say that when people specifically uncheck both "Show
brush outline" and "Show pointer" options, showing a huge crosshair
feels quite counter-productive. This is where I think that our small
unobtrusive cursor (probably a better name than "Single dot" by the way,
as it's not a single dot anymore) might be of use, the ultimate case
when someone really want a cursor as inconspicuous as possible, while
still having a visible feedback of the pointer position (even with
display-tablets, parallax issues make such a visual feedback important
to target where one paints).
So let's try this first and see how it goes.
2022-03-13 16:04:40 +01:00
Jehan ba21196c48 app, cursors: add meson rules for single dot cursor mode implemented…
… in previous commit.

Also fix some coding style bugs.
Finally change s/"Single Dot"/"Single dot"/ to have the same label
syntax (only capitalize the first letter of the label) as other labels.

Cf. #7034 and !466.
2022-03-13 16:04:40 +01:00
L amander 187d2e3390 Issue #7034: Add single dot cursor mode 2022-03-13 16:04:40 +01:00
Richard McLean bfbad0a5ca Issue #1299 - Add selection of default export file type
Patch cleaned up by Alexandre Prokoudine and Michael Natterer.
2018-12-10 09:28:36 +01:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Jehan 6aebd30de1 app: remove icon sizing preferences.
With GTK+3, high or low density is taken care by the screen scale
factor. Having a separate preferences for this is redundant, and likely
even wrong.
It may be interesting though to have a new preference later, which would
allow smaller scale icon sizing since some people like their icon
slightly smaller or bigger, and also when you are using screens whose
density is at a limit scale factor. Right now, this can be done through
themes, but a GUI settings may be interesting. If I add such feature,
let's just do it from scratch later.
2018-05-31 04:12:05 +02:00
Jehan d339aef75c app: add icon size auto-guess from monitor resolution.
Current code only guess resolution for a single monitor. Ideally
the widget sizes could be different depending on the window where a
given widget is on. But that's a start.
2017-03-21 17:52:22 +01:00
Michael Natterer 59488ffa68 app: order config-enums.h alphabetically 2017-03-11 16:47:24 +01:00
Jehan cfae83623c Bug 745835 - Small icons as Option, not theme
Allow overriding icon sizes set in themes from the preferences.
This initial commit updates only toolbox icons. More to come.
4 options are available: small, medium, large and huge (the later would
likely be useful for HiDPI screens).
Uses a new widget GimpIconSizeScale.
2017-03-11 02:51:59 +01:00
Jehan b2e40c4ca7 Bug 667169 - Single window mode: allow tabs position setting. 2013-10-11 23:16:29 +13:00
Alexander Hämmerle 421ca4114e Bug 641187 - GIMP needs a left-handed cursor option
Add a cursor-handedness setting and flip the cursor when it's set to
left-handed.
2011-07-24 22:09:21 +02:00
Martin Nordholts ed2d178da3 app: Get rid of config -> display module dependency
In order to make a clear separation between the core modules and the
UI modules, move the necessary enums from display-enums.h and
widgets-enums.h to config-enums.h and the files
gimpdisplayoptions.[ch] from the display to the config module. This
removes the config -> display dependency.

This change has three main benefits
 * It lets us remove includes of display files from the config module
 * We don't have to link gimp-console and test-config with a subset of
   object files from the display module
 * It is reflected in devel-docs/gimp-module-dependencies.svg that the
   application is made up of core modules and UI modules and that no
   core module depends on any UI module
2010-02-01 21:56:48 +01:00