Commit Graph

2487 Commits

Author SHA1 Message Date
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
programmer_ceds ff219fb0e2 Resize Canvas Problems (fixes issue #10225) 2023-12-13 18:31:38 +00:00
Anders Jonsson bdf0d88456 app, plug-ins: mark missing strings as translatable 2023-12-13 17:44:35 +00:00
Jacob Boerema 1add942fa6 app: fix #10349 Stroke Path on 2.99.16+ doesn't work reliably
Due to a bug in commit de5c805cbb, which
changed the choice widget between line and paint tool to a
GtkStackSwitcher, changing that choice did not work anymore.

The reason being that the stroke method wasn't being updated on clicking
stroke. We fix this by setting the stroke method when OK is clicked.

When creating the dialog we also set the stroke method, to reflect the
last used choice, since that was also missing.
2023-12-08 16:03:28 -05:00
Carlos Garnacho 573d2f5380 widgets: Add UI for pad configuration
The UI is heavily inspired in the existing one for midi devices
and the such, as the restrictions are somewhat similar. Since there
is not enough information to introspect the device without the help
of libwacom (and the UI should work with tablets unsupported by
it, regardless) the list starts empty, and there exists a "grab
event" button to press pad buttons (or use rings/strips) and
create/focus a list item for the button/mode.

Double clicking on an action (or pressing the "edit" button) spawns
a different dialog with a GimpActionEditor to select an action.
And lastly, actions can be deleted with the "delete" button.

Pads may have different modes (e.g. leds in the tablet) that apply
to all pad features, the list will allow different actions to be
set on the same button in different modes. This basically multiplies
the amount of mappable actions by the number of available modes.
2023-12-08 12:35:34 +00:00
Shubham 41e0151478 app: Make the layer auto expand options shared between tools
Also added option in Edit->Preferences->"Tool Options"->"Paint Options
Shared Between Tools" that decides weather the options should be shared
between different tools.
2023-11-25 16:19:43 +00:00
James Golden 22b28df391 app: save dialog now adjusts size up to monitor height
Fixes: #9373
2023-10-20 14:28:30 +00:00
Alx Sa ad8b47bff7 gui: Change Windows title bar based on theme
On Windows, the title bar can be set to light or dark mode via DwmSetWindowAttribute ().
This adds code to update the main title bar and dialogue title bars based on the current theme.
The main title bar uses "prefer-dark-theme", while the dialogue title bars
uses the color of the widget background to assume the correct color.
2023-10-18 16:48:25 +00:00
Jehan f38449115f Issue #2902: Preference option to set "Interface/Theme" font size.
Though GTK+3 is supposed to take care of scaling fonts with high density
displays, it turns out it is not enough for many, for various reasons (taste,
eyesight, distance to the display…). So we add this additional settings to tweak
further the font size.

With Aryeom, we experimented/discussed both a percentage UI vs. an absolute font
size field (e.g. as they provide in GNOME Tweaks). In the end, we went for a
percentage UI because we realize that we don't necessarily know what is the
current size at all. Mostly you just want bigger or smaller, and don't
necessarily care so much at which value is the font size.

This settings only has a single limitation (that we could find), which is when
used on a theme with widget rules using absolute font-size rules (px, or
keywords such as small/medium/large). As long as the CSS rules are relative
though (either to the parent widget, or to the root size), then it works fine.
Basically a theme hard-coding font sizes won't fare well with this settings, but
since we can consider this bad practice, it's an acceptable limitation.
2023-09-25 23:05:38 +02: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 19050ce7c0 dialog: Use column value from imported palettes
GIMP's .gpl palette format and Swatchbooker's .sbz format can contain
metadata on the number of columns. This value was ignored before;
now the import dialogue checks for this value and uses it.
2023-09-06 01:12:48 +00:00
mr.fantastic c47f4954ef Adding snapping by equidistance functionality 2023-07-25 15:31:16 +02:00
mr.fantastic 0aa8ac4660 Adding initial support for snapping layers/path_points by layers bounding boxes 2023-07-25 15:31:16 +02:00
Jacob Boerema 18408ce966 app, libgimp, libgimpwidgets, plug-ins, etc: rename behaviour to behavior
We use US English which uses behavior. So we replace all occurrences of
behaviour.

Most notable is File Open behavior in preferences. Besides that several
mentions in function documentation and a few in comments.
2023-07-21 15:35:23 -04:00
Sabri Ünal 84124a9f40 app: Mark two strings as translatable
- Welcome
- Release Notes
2023-07-18 19:07:42 +03:00
Jehan 1319523de7 app: no need to show the "Merge menu and title bar" option on macOS.
This doesn't do anything in this case, so better hide the settings.
2023-07-07 13:51:29 +02:00
Jehan c95b8518fe app, icons: use the Python executable found by pythonmod.find_installation().
We already search for a compatible Python version in the root meson file, no
need to look up Python 3 again in the PATH, each time we run an external Python
script in the build.

This should hopefully fix #9687.
2023-07-04 19:00:55 +02:00
Alx Sa ca3c709d56 core: Add color/pattern only fill options
Resolves issue with #8461.
This provides a conditional value for the fill options to only show
a color and pattern, rather than fore/background colors.
Currently only used for the text editor.
2023-06-24 19:42:58 +00:00
Jehan 5bf0ece215 app: fix build warning.
Though not a bug, this change will get rid of the following warning:

> app/dialogs/module-dialog.c:291:28: warning: ‘location’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   291 |       text[INFO_LOCATION]  = gimp_module_is_on_disk (module) ?
2023-06-24 18:42:44 +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
Alx Sa 6041d01655 dialogs: Set default response to "OK"
This allows users to just press Enter/Return to run it with defaults as
you could do in 2.10.
2023-06-05 13:25:45 +00:00
Alx Sa 493156cc7a dialogs: Fix header bar assumption
The Extensions dialogue assumed that it had a header bar. Since this is 
not always the case, conditional checks were added to prevent
GtkHeaderBar code from running. This also fixes a crash when you
double-click to expand the extension description.
2023-05-31 03:19:24 +00:00
Michael Natterer 26dce72d2c Remove autotools 2023-05-27 00:03:52 +02:00
Alx Sa fa22ee23c0 dialogs: Fix typo in "Lock Visibility" label 2023-05-26 03:27:55 +00:00
Michael Natterer 58c40a1871 app: add "lock visibility" to the layer,channel,path property dialogs
and make the lock toggles use the same icons as in in the popover in
the dockable dialogs.

Fixes #9306
2023-05-26 02:46:53 +02:00
Michael Natterer 41894be71a app: make the rotation import dialog more similar to profile import
and some general cleanup in both dialogs.
2023-05-25 16:56:07 +02:00
Michael Natterer 652fbe47fa app: use the prefs color management icon in the profile import dialog 2023-05-25 10:26:43 +02:00
Michael Natterer 7ada432690 app: big porting of weak pointers to g_set,clear_weak_pointer()
This started as review of weak pointers, but using
g_set_weak_pointer() and g_clear_weak_pointer() is almost always
better, and shorter.
2023-05-22 18:16:09 +02:00
Michael Natterer bbad91d85d quit-dialog: remove write after free in quit_close_all_dialog_response()
This reverts 83397cbb15 except for the
unrelated typo fix.
2023-05-21 18:56:32 +02:00
Michael Natterer ea61efe679 app: remove gtk_container_set_focus_chain(), it's deprecated and
our use cases were overengineering anyway.
2023-05-21 18:56:32 +02:00
Niels De Graef a4c3eacc02 libgimpmodule: Convert ModuleDB to GListModel
This commit converts `GimpModuleDB` into a `GListModel`. This allows us
to drop quite a bit of custom code to have an adaptive list of modules
by just becoming a `GListModel` implementation.

Next to that, this commit also rewrites `GimpModule` to use the `notify`
signal for its 2 new properties: "auto-load" and "on-disk", rather than
trying to define a custom signal for that. This in turn allows us to use
basic methods like `g_object_bind_property()`.

Finally, the module manager dialog now uses `GtkListBox`, which can
easily bind to that new `GListModel` infrastructure.
2023-05-20 22:15:13 +00:00
Niels De Graef e5820261ec app: Use a GtkListBox for the themes list
Use a `GtkListBox` to show the list of GIMP themes rather than a
treeview. The idea is that we can expand this a bit more to give a
preview of the theme later on.
2023-05-20 22:15:13 +00:00
Simon Budig 27af306a8a libgimp: un-deprecate and fix gexiv2 usage. 2023-05-20 18:06:21 +02:00
Alx Sa bca4535c40 icons: Restore GIMP icons replaced by GTK defaults
Five icons in the Layer dockable were being replaced by GTK defaults at
runtime. A "gimp-" prefix was added so that GIMP's version would always
be used. A few dialogues were fixed to use constants rather than
hardcoding the filename, to make it easier to update the icon in the
future.
2023-04-30 13:58:39 +00:00
Shubham de5c805cbb app: Modify stroke selection dialog
Changed stroke selection dialog to use GtkStackSwitcher instead of radio
buttons. Make options hidden under "Advanced options" visible by
default.
2023-04-25 12:59:35 +00:00
Jehan beb093f549 app: remove the "Save" button from the "Configure Keyboard Shortcuts" dialog.
This was always confusing to people that they had to click "Save" then "Close".
With new code anyway, any change is instantly put into effect, and the only
point of "Save" is to actually store immediately in the shortcutsrc file. But
this is clearly not very clear to people (and it can be done in the Preferences
dialog too).

Instead let's just have a "OK" button. The file will be actually updated on exit
only (if "Save keyboard shortcuts on exit" is checked). And that's it.

The only missing feature would be the ability to cancel the latest changes
before hitting OK, i.e. having a "Cancel" button too. Let's see to do this
later.
2023-04-12 22:07:09 +02:00
Jehan 38d0abc026 app: prevent multiple registrations of a same action.
Pre-GIMP-3.0 code logics would re-allocate several GimpMenuFactory or
GimpUIManager for no good reason. While it was still working with old GtkAction
code, with our new GAction-based code, we were ending up overriding an action
with a new version of the same action, while keeping reference to old actions.
This made for discrepancies of the enabled or visible state of actions.

The new code keeps singleton of some objects and references to already
registered GimpUIManager or GimpActionGroups objects and make sure no actions
with the same name are created twice.
2023-04-12 22:07:09 +02:00
Jehan 3f85fee2e7 app: GimpActionEditor now keeps a Gimp object instead of GimpUIManager. 2023-04-12 22:07:08 +02:00
Jehan 9b568f960c app: Quit dialog now uses GAction directly.
Note that I could edit the GimpUiManager directly to use the GAction API, but I
feel like it is adding a level of complexity to existing GIO/GTK API. So right
now, I am planning to either get rid of it or really simplifying it a lot.
2023-04-12 22:07:07 +02:00
Jehan 385b697a60 app: "gtk-can-change-accels" feature is ignored since GTK+ 3.10.
We had this feature "can-change-accels" where people could change their shortcut
directly by browsing the menu. It was on the property "gtk-can-change-accels" in
GtkSettings. Unfortunately this got deprecated in GTK+ 3.10 (more accurately in
dev version 3.9.8, according to GTK's NEWS file), and is therefore ignored since
then. In other words, whether we check the box or not in our Preferences, it
doesn't do a difference.

If we want to get the feature back some day, we'll have to reimplement it with
custom code. In the meantime, there is no need to leave this visible in
Preferences.
2023-04-12 22:07:07 +02:00
Jehan 4f8357d7f6 app: Action Search does not use GimpUiManager anymore.
It directly uses the action added to the GtkApplication/GActionMap.
2023-04-12 22:07:07 +02:00
kotvkvante 708af26890 fix typo 2023-02-06 15:24:27 +00:00
Jehan 9ec7c155a6 app: make Stroke Paths actions multi-paths aware.
These were also the last usages of the macro return_if_no_vectors.
2023-01-11 01:56:29 +01:00
Jehan d96c13de2b app: "Fill Paths" action, multi-paths aware. 2023-01-11 01:31:10 +01:00
Jehan b674fd33f0 app: fix a critical for release demos with a dockable and no specific widget.
Fixes:

> GLib-CRITICAL **: 13:39:39.804: g_strchug: assertion 'string != NULL' failed
2022-11-09 15:22:05 +01:00
Jehan fa2fa71619 app: add a tooltip to "_Don't ask me again" checkbox.
I find these options always a bit unwise when people have no idea how to change
their mind. Therefore adding a tooltip with the information (though maybe we
should even do it even more clearly and adding that in checkbox text too?).
2022-11-01 17:36:45 +01:00
Jehan 092627fdb3 Issue #8697: do not make conversion to another profile the default behavior.
For this to happen, I've updated the main question to be "Keep the Embedded
Working Space?" instead of "Convert to * Working Space?". Basically now we put
emphasis on keeping the image's color profile as being the proposed action.
Therefore "Keep" is the default answer, on the right.
Yet "Convert" stays on the right too. There is no "Cancel" button anymore
because it is not a question we can really escape even though "Esc" still works,
and it still corresponds to "Keep", same as Enter now. The reason is that "Keep"
is actually the non-destructive option. So if someone really doesn't want to
answer and make an explicit choice, we do it for them with the only
non-destructive choice possible.

Also I'm changing "Convert" mnemonic to 'c'. I guess that earlier devs might
have used 'o' because it is the usual mnemonic for "OK", so it was right when
the question was "Convert?". But since now the question is the opposite, there
is no reason to make it look like "OK". Let's just use the first letter, which
is easier to guess (and not taken by any other button here).

I've been hesitating because I don't think "Convert" was the right default
anymore with our anyRGB move. Until now, it was kinda implying that sRGB (when
no preferred color profile was set) was kinda the recommended space. It's not.
If a file already has another space, it's probably much better to keep it.
First because "Convert" is often a destructive change (even more if the target
is sRGB), so for people who don't necessarily understand all the ins and outs,
we were kinda promoting a destructive default behavior.

On the other hand (and that's why I was hesitating):

* "Keep" is also what happens when we hit "Esc" so some might complain that
  there is no easy "Convert" key anymore (there is alt-c, but it's for sure not
  as easy as Esc or Enter). Basically it makes the "Convert" option always a
  much more explicit choice (yet it is likely for the best for people who care
  about their colors).
* There might have been many people who would just use the default (Convert
  until now) without thinking too much of what was asked, and that was working
  good because they would just publish on the web or similar basic usage. If
  they continue just accepting with Enter without reading and understanding what
  is asked, now they could publish images with a color profile (and we know it
  doesn't always work perfectly on the web).
  In other words, it might be the best default for professional usage now, yet
  it requires to understand a bit what you are doing.

It's really a hard call!
2022-11-01 17:24:22 +01:00
Jehan 9fc8260c7c app: "vectors-copy" and "vectors-export" are now multi-paths aware. 2022-10-12 22:13:38 +02: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
Jehan 08b7de3b13 Issue #8520: show devel download link when relevant.
This is shown in the About dialog when a new version is available, but
also in the debug dialog (also when a new version is available).

Of course, for stable versions, we should still show the main download
page (which I double-checked current code does).
2022-08-31 13:13:27 +02:00
Jehan ca230cb770 meson: fix warnings of deprecated features.
Now that we bumped our meson requirement, meson is complaining about
several features now deprecated even in the minimum required meson
version:

s/meson.source_root/meson.project_source_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.

s/meson.build_root/meson.project_build_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.build_root. use meson.project_build_root() or meson.global_build_root() instead.

Fixing using path() on xdg_email and python ExternalProgram variables:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead

s/get_pkgconfig_variable *(\([^)]*\))/get_variable(pkgconfig: \1)/ to
fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead
2022-08-31 01:29:37 +02:00
Jehan 89f55336a2 app: add a page in Preferences to set the canvas modifiers up.
Finally everything is getting assembled with this commit. It is now
possible to customize the modifiers which will be used on canvas.
2022-08-17 14:20:18 +02:00
Jehan a853052768 app: new "Canvas Interaction" setting.
Moving the "Space Bar", the "Snapping" and the new "Zoom" (MR !570)
settings there. The idea is that it will also be where we'll customize
more on-canvas related abilities, such as the new zooming behavior
preferences, but also possibility to customizing or disabling the
various canvas action, and finally customizing the new contextual
settings such as brush sizing or other.
2022-08-17 14:20:18 +02:00
Alx Sa 94414c1ca8 core: Add simulation settings to Create New Image
Adds a dropdown for Simulation Profile, Intent, and BPC
to the Create a New Image dialog.
This allows users to assign a soft-proofing profile when the image is
first created. It defaults to "None", however. Users can also set the
default simulation rendering intent and BPC status per image.
These options are also removed from the Preferences dialog.
2022-08-14 17:25:25 +00:00
Jehan 4ca9cef332 Issue #1918: fix CRITICAL in MWM when reopening close dock while…
… an image is opened.
2022-07-27 10:59:31 +02:00
Lukas Oberhuber 831623f33f meson, macos: missing libraries and directories
These changes make it possible to build against homebrew for mac
libraries. Homebrew stores it's libraries in seperate folders and so
blanket includes were not working.

PYTHONPATH is not needed and interferes with homebrew build.
2022-07-21 13:25:22 +00:00
Nikc 93399de7cd Converting CMYK sample points to babl process 2022-07-20 22:35:13 +00:00
Jehan 0cff1ebe91 Revert "app: force re-querying all plug-ins after a language change."
This reverts commit 82f9ae1ab7.

This is not needed anymore. Cf. previous commit which implements the
force-requery differently and much more widely based on actual language
being stored and compared between runs.
2022-07-06 19:41:00 +02:00
Lukas Oberhuber 83397cbb15 quit-dialog: stops crashing on quit dialog
@jralls found uninitialized variables in the quit dialog that can cause
crashes.
2022-07-06 12:54:04 +00:00
Jehan 9ef10c8764 app: allow to disable the new version check altogether through a key…
… in the gimp-release file.

This will be useful to disable the update check for the Windows Store
even though we use the same build as the installer. All it will take
will be to append the line `check-update=false` to the file
`share/gimp/2.10/gimp-release` and it will behave as though the update
check is disabled (even though it is actually built-in).
2022-06-06 01:09:08 +02:00
Jehan 916c5f9d11 app, libgimpbase: improve preferences and checkboard defaults.
- Slightly nicer layout for the checkboard color widgets.
- Also set the 2 color widgets insensitive when the check type is not
  GIMP_CHECK_TYPE_CUSTOM_CHECKS.
- Default the custom colors to the same colors as the basic default
  grayscale. I mean, red and blue defaults are fun and all, but that's
  like radioactive colors burning the eyes! Ahahah!
- Unlike the gimp-2-10 commit (cf. !274), on the main dev branch, use
  the new GimpLabelColor widget.

Fixed Conflicts from !274:
	app/dialogs/preferences-dialog.c
2022-05-14 16:31:58 +02:00
Ben Rogalski d90b84ba9d Custom transparency checkerboard colors
Reviewer (Jehan) note: cherry picked from MR !274. Still deciding
whether this will be pushed to gimp-2-10 branch too.

Fixed Conflicts from !274:
	app/dialogs/preferences-dialog.c
	app/display/gimpdisplayshell-draw.c
	app/plug-in/gimppluginmanager-call.c
	libgimp/gimp.c
	libgimp/gimp.h
	libgimpwidgets/gimppreviewarea.c
	libgimpwidgets/gimppreviewarea.h
	libgimpwidgets/gimpscrolledpreview.c
2022-05-14 16:27:15 +02:00
Jehan f0dc690935 app: improve a bit the restart-triggering change list.
When you change a settings in Preferences which requires a restart of
GIMP, the current list was pretty ugly. I am still not fond of the popup
but at least now the list formatting is slightly better:

- Use a unicode bullet point character in UTF-8 encoding (since
  gtk_message_dialog_new() expects UTF-8 input) on each list element,
  instead of just writing them without any kind of formatting.
- Use the "nick" of the changed config, not the name. The "name" is an
  internal string which is really not meant to be viewed by people,
  while the "nick" is more like a short human-readable name or title,
  exactly what we want to show here.
2022-04-27 15:35:33 +02:00
Jehan 82f9ae1ab7 app: force re-querying all plug-ins after a language change.
Some strings might be generated during query() call, in particular all
strings related to procedure parameters. The core will only know the
localized version at query() time, so you could end up in situation with
the core showing you the wrong language. This can be reproduced in the
Procedure Browser when it shows localized procedure data: when you
change the language and restart GIMP, if the plug-ins aren't re-queried,
then it will still show the localization of query time.

Note that it doesn't matter on plug-in side, i.e. anything in the run()
call is properly localized, included the plug-in GUI using the same
procedure parameters for widget labels or tooltips. Only the "vision" of
the core is stuck at what it got when the plug-in was last queried, and
until the next update of the plug-in.
2022-04-27 15:22:32 +02:00
woob eb58b277d2 app: Add drag-to-zoom speed preference
Adds the new configuration option "drag-zoom-speed" to adjust the rate
at which mouse movement can zoom the canvas, ranging from 25% to 300%
of the base rate and applying to both drag-to-zoom modes.
This option can be found in the preferences dialog as:
  Image Windows -> Zoom & Resize Behavior -> Drag-to-zoom speed
2022-04-05 12:31:11 +00: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 7c3122e55b Issue #8010: Help button in File Open dialog closes dialog and opens…
… main help page.

Also fixed for save and export dialogs.
2022-03-25 15:51:50 +01:00
Jehan 365478f24d app: tweak the tool pointers options in Preferences.
- Rename "Mouse Pointers" frame to just "Pointers". It's not just about
  mice but all input devices.
- Move the "Pointers" options from "Image Windows" to "Input Devices"
  tab in Preferences. It looks to me it's more about how you configure
  the device pointers than anything really image window-related.
- Move the paint tool options in their own frame "Paint Tools" to really
  differentiate the generic pointer options from the ones specific to
  paint tools. This frame is added side by side to the "Pointers" frame
  to hopefully underline they are related.

I'm still annoyed by the fact that if you uncheck both the "Show brush
outline" and the "Show pointers for paint tools", it will actually show
a big crosshair in such case. I can understand the logic (not to end up
in a case with absolutely no indication of your pointer position). But
then shouldn't we rather forbid unchecking them both at once? It would
be clearer IMO. On the other hand, are they people who like this big
crosshair and use this?

Other thing I was annoyed about was whether you would not want to have
the "Single dot" only on paint tools. But as Aryeom told me, maybe let's
just try it like this and see if people ask for a double option (pointer
on paint tools vs. pointer on other tools) as it is already very
complicated settings as it is. I mean, at some point, I even thought
about a per-device pointer. I also studied the possibility of detecting
whether you are on a display-tablet (when you are more likely to want an
unobtrusive pointer) or not (then you may be very annoyed each time you
can't even spot easily your pointer on screen). But GTK doesn't give
this later information, and as Carlos reminded me, even a display-tablet
can be mapped to another display, so even if we could detect a
display-tablet, it would not mean it is reliable information for making
a decision on whether we want a light pointer.
2022-03-13 16:04:40 +01:00
Jehan 10d8765101 app, tools: pre-process release items from AppStream as well.
Since we are pre-processing anyway the AppStream metadata file (because
appstream-glib doesn't pass unknown XML attributes, cf. a previous
commit), it does feel silly now to continue loading the file at runtime
too. Let's just pre-process more data into the constructed C files, i.e.
get the introduction paragraphs and the change items too.

The only other remaining advantage of appstream-glib was that it was
handling the localization but since we also have these localized strings
in our gettext files, we can as well translate with gettext as any other
strings and it works just fine.

It will also get rid of any packaging issue, forgetting to package the
metadata file (as we had on the Windows installer, and still have on the
macOS package). Now it will just always work because data is internal.
2022-03-08 16:32:58 +01:00
Jehan adc03deb3a app: clearer release note tours.
The changes include:

* A popover will be displayed on tool buttons and relevant property
  widgets.
* Now the welcome dialog gives focus up to its parent window because
  really the whole focus styling issue in GTK is a bit maddening. The
  colors are all faded, the popover widgets are barely visible, and so
  on.
* Timing is tweaked a bit to give more time reading the popover tips.
2022-03-07 13:25:39 +01:00
Jehan 622d0da43e app, libgimpwidgets: allowing changing a dockable settings value while…
… blinking it.

This will be necessary to demo new features available only in some
situations. E.g. a new option in line art detection mode of bucket fill
would require said mode to be enabled.
2022-03-06 19:30:31 +01:00
Jehan 4dc41f1aaf app: make demo scripting even simpler/cleaner.
First I strip now every pieces of text. What it allows it to span the
script elements for instance on several lines, indent them and all that.

The second thing is that since all the dockable start with "gimp-", we
may as well allow use shorter names (both are allowed). Same for tool
(which we special-case), all the tool buttons ID start with "tools-"
since we reused the action names. So let's just allow the shorter
versions.

Finally I create a new gimp_blink_toolbox() which is a specialized
gimp_blink_dockable() for the toolbox in particular. I also move there
the whole code about selecting the right tool.
2022-03-06 13:47:32 +01:00
Jehan 3a6965d519 app: improve discoverability of release item demos.
Make a different bullet points for items with demos and items without,
and add an info text explaining you can click on items with the right
bullet point to get a demo.
2022-03-06 13:14:07 +01:00
Jehan eb871a12e7 app: make welcome-dialog-data.[ch] deps relative to $(top_srcdir).
Hopefully it will fix the following CI errors:

> make[4]: *** No rule to make target '../../tools/generate-welcome-dialog-data.py', needed by 'welcome-dialog-data.h'.  Stop.

I thought using relative paths was fine too here, but I might have been
wrong (even though it worked locally).
2022-03-06 11:53:14 +01:00
Jehan 4942a9caf3 app: add a bold dot in front of each release note item.
Even when using a GtkListBox, it's just prettier and clearer when having
a text list with dots IMO, especially since some text might wrap on
several lines. Let's just go with that.
2022-03-06 00:29:28 +01:00
Jehan 3904c40dc1 app, tools: allow creating demo "scenarios" from the AppStream metadata.
The idea is to add some "demo" attribute to a list item inside the
<release> tag, since we already decided that (for now at least) we'd
keep a strict "intro + list" logics, as we did until now.

This demo attribute uses an internal format to specify successive
widgets to blink (like a demo path towards a feature). For now, what it
allows is:

* raise the toolbox, select a tool and blink the tool button.
* raise a dockable, blink any widgets in there.

Now it is still limited and needs to evolve. In particular:

* What happens if the blinked tool button was explicitly removed from
  Preferences? Should we re-add it for the demo? And once done, should
  we remove it again? Then should we select back the tool previously
  selected?
* What happens if the dockable widget is not visible? Should we allow
  changing the settings to be able to demo correctly the new/changed
  settings? Should it be temporary? If temporary, it can be annoying as
  you'd still have to look attentively the demo to find back the path to
  the new settings. If not temporary, some people may dislike we touch
  their settings.
* What if docks are hidden? Should we unhide them, then hide them back
  after demo time?

Also regarding the implementation: originally I wanted to just grab the
demo attribute directly from the AppStream metadata file, but I realized
that appstream-glib cleans out unknown attribute from the XML. I could
then simply parse the file with a generic XML parser, but I found
simpler to pre-parse it into a header built within GIMP. I still use
appstream-glib at runtime as it takes care of localization for us
(though in the same time, we also have the localization in the main po
files, so maybe we could just embed the release note strings as well).

See appstream-glib report: https://github.com/hughsie/appstream-glib/issues/431
2022-03-05 23:39:14 +01:00
Jehan 3011795407 app: display the release notes as a GtkListBox instead of text.
What it means is that we will be a bit strict over our <release>
formatting which will have to always be a <p> introduction followed by a
list of items. This is what gimp_appstream_to_pango_markups() expects.

Since so far, this is how all our <release> tags were formatted anyway,
this is not too much of a problem.

Note that I keep the less strict gimp_appstream_to_pango_markup() and
use it for extension's appstream description as we will have no control
over these.

The main reason for this new rule and new display of our release notes
is that I am going to add the ability to click independent release items
so that people can get "blinking" indications of what changed when
relevant.
2022-03-05 17:42:54 +01:00
Jehan 63a530f9d1 app: don't use build-time path for the desktop datadir.
Build time directory won't work on Windows (and most likely neither on
macOS with their relocatable packages).
2022-02-28 20:57:48 +01:00
Jehan eb9b936d23 app: let's also check the appstream in the legacy location as fallback.
For some reason, our flatpak is moving the appstream file elsewhere,
after installation (since all our scripts explicitly install it under
metainfo/).

So in flatpak, it is in /app/share/appdata/ (i.e. $DATADIR/appdata/).

This is not right and should not be done by the flatpak system, but
let's still verify this other location as it is legacy so it would not
be totally impossible that some distributions do something similar when
packaging GIMP.

See also: https://github.com/flatpak/flatpak/issues/4775
2022-02-23 21:23:24 +01:00
Jehan f32bca6bc5 app: trying a new logic for the image size of the welcome dialog.
As Jacob reports in #6445, on a big-size monitor, the dialog is just too
big, this can be seen in particular with all the space left between info
text. Trying a new logic where I simply leave the dialog to be
allocated, then once I get its size, I generate an image roughly this
same size. This should avoid overly big images.
2022-02-22 21:05:38 +01:00
Jehan e5509ffcdb app: fix sentence and typo.
Thanks to Liam for the fix/feedback on IRC. There was a typo (s/if/it)
and some better wording proposition.
s/You can call if again/You can show it again/
2022-02-22 15:32:13 +01:00
Jehan d31d417cf1 app: make sure the welcome dialog is centered on the GIMP main window.
If there are several windows (when loading files on startup), let's just
use the first. This avoids weird placements in some cases.
2022-02-22 13:19:06 +01:00
Jehan 62a76d7856 app: new welcome dialog to appear only at first launch after a new…
… installation or an update.
2022-02-22 12:23:46 +01:00
Jehan a9551bbb3c app: update/fix the About's authors.xsl.
I realized the "recent-contributor" template was checking
`last-active >=2 and minor version >= 8`. Because of the second part of
this test, anyone with a last a last-active value of 3.0 was ironically
not included as recent contributors!

Meanwhile, I am bumping the definition of recent as 2.10 and over
(rather than 2.8 and over), for GIMP 3.0 release. Last thing, I am now
sorting by descending last-active (so contributors in GIMP 3.0 are shown
first).
2022-02-19 16:02:14 +01:00
Jehan ab1fc79a07 app, libgimpwidgets: move GimpSpinScale to libgimpwidgets.
There is really nothing specific to the core application, it is quite a
generic widget, so it would be nice for plug-ins to be able to use this
widget.
2022-02-17 23:13:42 +01:00
Jehan 9d23216566 app: remove the "Linked" switch from the item options dialog. 2021-12-23 13:39:42 +01:00
Jehan 5ac6d57b7b app: add a preferences for choosing your prefered search pattern format.
The 3 available formats are: simple text search, regular expressions and
glob patterns (cf. previous commit). I did a small step back from
previous commit by getting "is-pattern" property back in GimpItemList
instead of having this case as a value of GimpSelectMethod. The reason
is that it would render a useless value in the Preferences combo box.

Text search is the default.
2021-12-23 13:39:42 +01:00
Jehan b9eb289b5c app: implement multi-paths selection.
For now, highlighting, snapping and moving (position change with move
tool) have been implemented.
2021-12-23 12:55:11 +01:00
Jehan 58302ee332 app, pdb: get rid of various gimp_image_get_active_channel().
Replace them with gimp_image_get_selected_channels().
2021-12-23 12:55:11 +01:00
Jehan bd038b1864 app: implement multi-channel selection.
Similar to commit 592cea6b87, but this
type for the Channels dockable.
2021-12-23 12:55:11 +01:00
Jehan 2a404cb41d app: more "select-item" signal handlers changed to "select-items" ones. 2021-12-23 12:55:11 +01:00
Jehan 8a91d973cd app: fix clicking on unsaved images in Quit / Close All dialog.
Let's now use the "select-items" signal only (even in cases where we
expect only one selection per construction).
2021-12-23 12:55:11 +01:00
Jacob Boerema 352ef68c46 app, libgimp: Add metadata preference for saving thumbnail by default
Saving a thumbnail is closely related to the other metadata preferences,
but so far this was the only one that didn't have a preference for a
default user value.
This commit adds a preference in the metadata section where a user can
select whether thumbnail saving is enabled by default or not.
2021-10-12 13:20:47 -04:00
Jehan 6374481f4f Issue #6909: Crash after cancelling out of avif export dialog.
Do not leave dangling signal handler.
2021-09-26 16:30:29 +02:00
Luca Bacci 012df8514a
Add a config enum for the pointer input API to use on Windows 2021-08-25 18:24:54 +02:00
Jehan c43de62e99 app: config folder migration update for GIMP 3.
Fix the search for previous folders, which was broken as it was
specifically expecting 1-digit numbers so far.

The differences of the GIMP 3 config import are:

- update sizes and positions in the sessionrc according to the scale
  factor, because GTK2 doesn't have scale support. It means that, e.g.
  with a 2× display, all sizes and positions in GIMP 2.x must be divided
  by 2 (otherwise the first thing many people will get when testing GIMP
  3 for the first time is an off-screen window).
  Of course, I even wondered if it would not be nice to just drop the
  sessionrc altogether and start with a nice blank slate, but then you
  also lose the opened dock and their organization and some settings
  (such as whether you chose single or multi window mode, etc.).
- scripts/ and plug-ins/ are not imported. Probably makes no sense so
  far as they would end up broken (but maybe it's not true for all
  script-fu scripts?).
2021-08-23 13:37:11 +02:00
Jehan ef87f34ba4 Issue #6843: "Canvas Size" dialog takes too much vertical space.
Since the recent changes to add template ability, there are just too
many widgets stacked up vertically. Let's use a little better the
horizontal space.

To do this, I moved the preview on the right side of the "Canvas Size"
and "Offset" number fields, and the "Center" button just below it.
2021-08-22 18:21:37 +02:00
Jehan 3fa68be264 app: date string in the About dialog was not always freed.
Let's move the g_date_time_format() to the inner block when it's
actually used, hence also make sure we allocate and free at the same
code level, which is a better practice to limit leaks.

Reported by Massimo.
2021-08-22 12:01:38 +02:00
Jehan 0fe7e147b5 app: unref the GtkSizeGroup-s.
As explained in GTK docs, size groups are referenced by every internal
widget hence can be immediately unref-ed after we added widgets in it.
In the end, when the widgets are destroyed (thus removed from the
group), the group will end up freed too.

Reported by Massimo.
2021-08-22 11:55:12 +02:00
Jehan 1ece3675c9 app: another leaked GtkTreePath.
Thanks to Massimo, again and again. ;-)
2021-08-20 22:00:03 +02:00