Commit Graph

33 Commits

Author SHA1 Message Date
Ell
f6229c921a app: in gimp_tool_gui_set_response_sensitive(), allow non-existent ID
In gimp_tool_gui_set_response_sensitive(), silently ignore non-
existent response IDs, instead of emitting a CRITICAL, to match the
behavior of GtkDialog and GimpOverlayDialog.  This simplifies code
with optional dialog responses.

(cherry picked from commit 92216a635a)
2019-03-13 05:28:36 -04:00
Ell
21f76df21b app: fix unused variable warning in gimp_tool_gui_new()
... due to commit b23fae86f0.

(cherry picked from commit 7fb1d05ca4)
2019-03-07 16:49:03 -05:00
Ell
8d20b7c665 app: add gimp_tool_gui_add_button()
In GimpToolGui, add gimp_tool_gui_add_button() and
gimp_tool_gui_add_buttons_valist(), which allow adding dialog
buttons after construction.

(cherry picked from commit b23fae86f0)
2019-03-07 16:27:27 -05:00
Ell
31b369d09f app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:41:35 -04:00
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
4cc8481b66 app: get rid of a few forgotten stock-ids and new_from_stock() 2018-04-29 04:50:17 +02:00
9a365eaf8b Bug 794378 - GIMP crashed while I was moving the image window
Use a weak pointer in GimpToolGui to not keep a dangling
private->viewable around.
2018-03-20 19:02:43 +01:00
0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
e21be2f3d9 app: rename GimpToolInfo's "blurb" and "help" members
to "label" and "tooltip". More standard names, less confusion.
2017-07-04 21:58:11 +02:00
bd9e59a9f0 app: add "title", "icon_name" and "help_id" to gimp_tool_gui_new()
so things are the same at the API and the inside, which makes
GimpImageMapTool's use of GimpToolGui a little more obvious.
2016-01-22 23:41:45 +01:00
06a5b2fa3f app: bring dialog titles and help IDs to GEGL filter dialogs
Add "title" and "help_id" parameters and members/properties to
GimpToolDialog, GimpToolGui, GimpOperationTool. Also make the order of
parameters more consistent.
2016-01-17 20:17:07 +01:00
526a3a6020 Bug 755363 - Non-void function should return a value
Use g_return_val_if_fail() in function returning non-void.
2015-09-21 20:37:29 +02:00
29fee56914 app: fix visibility of the color picker tools info window
Since commit 867b1f7e the window did always pop if it was set to
visible once, even if closed and "Use info window" disabled.

Fix this by adapting the show logic to the fact that we now keep the
widget alive across images/displays.
2015-09-20 00:37:05 +02:00
df2a485907 Bug 754713 - On-canvas dialog of color picker tool always displays...
...in initially active tab

gimp_tool_gui_update_shell(): implement the "overlay" case and hide the
gui on the previous shell, then show it on the new one.
2015-09-08 21:53:24 +02:00
072cb068b2 app: add a "detach" button to all on-canvas tool dialogs
which turns them from being automatically attached/detached (depending
on canvas size) into always being a separate window.
2015-05-01 18:00:05 -04:00
cd479ce04e app: add an "auto overlay" API to GimpToolGui
which makes tool dialogs auto-overlay if the canvas is large
enough. Set all tools dialogs except GimpImageMapTool's dialog to
auto.
2014-06-09 03:08:43 +02:00
17bd4d2c28 app: make GimpOverlayDialog's title and icon-name settable after construction 2014-06-09 01:42:09 +02:00
453882c81e app: add gimp_tool_gui_set_icon_name() 2014-05-22 23:29:24 +02:00
843866e7e7 app: make things behave more reasonable with multiple monitors
There is now a preference option that determines whether windows
should be opened on the same monitor as before. It should be disabled
when the machine gets monitors plugged/unplugged dynamically ("laptop")
and enabled when there is a static multi-monitor setup ("wokstation").
This is merely the current simplistic policy on top of the newly added
underlying infrastructure:

- pass integer monitor numbers around in all places where we already
  pass around a GdkScreen. Pass the "current" monitor to these changed
  APIs, where "current" is either the monitor where the action-triggering
  widget is, or if that is unavailable the monitor where the mouse is.

- add gimp_widget_get_monitor() in order to easily get to the monitor,
  just like gtk_widget_get_screen().

- add screen and monitor parameters in some places that were missed
  before.

- in sessionrc, save all window positions relative to the window's
  monitor, and save the monitor separately, if it's not the screen's
  primary monitor.

- when restoring window positions, use the stored monitor when the new
  prefs options says so (use the screen's primary monitor if there is
  no stored monitor), otherwise use current monitor that is now passed
  around.
2014-05-02 03:01:23 +02:00
55a70729ae app: add some function stubs to GimpOverlayDialog
and move the TODO comments from GimpToolGui to the stubs.
2013-08-03 02:32:02 +02:00
fb078df6fb Bug 704432 - Warning occurs when using a tool with a GimpToolGui
gimp_tool_gui_update_buttons(): set the alternative order on the
buttons only if it was already provided.
2013-07-23 08:55:13 +02:00
25cc5922b6 app: add gimp_tool_gui_set_focus_on_map() and use it 2013-06-08 15:34:23 +02:00
1982cf1db7 app: add gimp_tool_gui_set,get_overlay()
which allow to toggle embedded and dialog style gui.
2013-06-08 01:32:34 +02:00
ad8d12ed69 app: add "response" signal to GimpToolGui
and connect to it instead of to gimp_tool_gui_get_dialog()'s signal.
One more step towards on-the-fly embedding/detaching.
2013-06-07 23:45:11 +02:00
e7bb2805c2 app: keep around all settable stuff in GimpToolGui
so the gui can be recreated when switching from embedded to detached
or vice versa.
2013-06-07 23:20:20 +02:00
0afa7d30f0 app: add gimp_tool_gui_set_description() and use it 2013-06-07 17:01:39 +02:00
9a811d276e app: add gimp_tool_gui_set_alternative_button_order() and use it
Also make some of GimpToolGui's memory management proper, there was
no leak but it needs to be proper in order to add runtime switching
between dialog and overlay.
2013-06-07 15:18:24 +02:00
170b987b99 app: put tool overlays into the canvas upper-right corner 2013-06-07 12:21:38 +02:00
88387d6e8d app: remove the "shell" parameter from gimp_tool_dialog_new() and gui_new() 2013-06-07 12:19:42 +02:00
3def3a1ade app: raise the dialog if already visible in gimp_tool_gui_show() 2013-06-07 12:12:28 +02:00
60b7dc15f1 app: add gimp_tool_gui_set_default_response() 2013-06-07 11:39:24 +02:00
761ddf0835 app: add gimp_tool_gui_set_response_sensitive() 2013-06-07 11:02:42 +02:00
2876e43d00 app: add new helper object GimpToolGui
which delegates a tool's dialog to either a GimpToolDialog or an
embedded GimpOverlayDialog.
2013-06-07 10:24:51 +02:00