Commit Graph

238 Commits

Author SHA1 Message Date
Michael Natterer 29456b96f9 Bug 744127 - Restore tab hover delay during drag-n-drops
Fix the return values of drag_motion() and drag_drop() callbacks.

Commit 7b85cf4de8 started mixing up
the two unrelated concepts

- the widgets has handled the event
- a drop here would do something / did something successfully

into one boolean value being both the function's return value and
a success indicator for the DND operation.

Untangle the concepts again by returning FALSE when
gimp_paned_box_will_handle_drag() returns TRUE (indicating that the
docking DND mechanism will kick in), and always returning TRUE
otherwise; and by using the state "drop was / would be successful"
only for calling gdk_drag_status() and gtk_drag_finish().

This way we make sure that:

- drag_leave() is called reliably again (because we return TRUE if no
  other widget will handle the event)
- drag data is freed reliably again (because we always call
  gtk_drag_finish())
2015-02-19 22:42:18 +01:00
Michael Natterer d0a6d95dad app: remove a bunch of file-utils.h includes 2014-07-08 00:23:34 +02:00
Michael Natterer 0f8d84d5e9 app: port all file_open() and file_save() functions to GFile 2014-07-07 23:58:11 +02:00
Michael Natterer 7f23fbec34 app: add screen and monitor to all display and image window constructors
so they appear on the proper monitor as well.
2014-05-02 20:21:41 +02:00
Michael Natterer 7e273bc6d0 Bug 686929 - Newly created toolbox is too tall and too narrow
Set the dock window's geometry hints after the tool palette's style is
known, not after the toolbox' style is known, so we get the right tool
button dimensions for minimum size and size increments.
2013-01-17 19:37:03 +01:00
Michael Natterer 819ad3b4d9 app: use g_object_bind_property() to set widget visibility
instead of connecting to "notify::boolean-property" of something just
to set "widget::visible" in the callback.
2012-10-31 23:17:47 +01:00
Michael Natterer 53cf2c657b app: move the GTK-free cairo utility functions to core/gimp-cairo.[ch] 2012-05-02 17:51:02 +02:00
Michael Natterer 867da8f293 app: add gimp_context_get_foreground,background_pixel()
which takes a Babl format to convert from/to.
Include <gegl.h> in a million places.
2012-05-02 17:50:41 +02:00
Michael Natterer c166e494ce Bug 662948 - Wilber is squeezed
Separate Wilber sizing from GimpDock::set_host_geometry_hints()
because that method is never called in single-window mode.
2011-11-02 00:31:23 +01:00
Michael Natterer 11239c4b17 app: don't use g_list_length() to check if a list is empty 2011-10-09 00:27:53 +02:00
Michael Natterer 3e336199b9 app: use gtk_box_new() 2011-09-30 11:29:11 +02:00
Martin Nordholts 1a8a806d43 app: Make GimpToolbox use parent UI manager
Make GimpToolbox and GimpToolPalette use the GimpUIManager and
GimpDialogFactory of the top container instead of holding references
on their own. If they hold references on their own, we need to update
these when we move e.g. GimpToolbox between different top level
containers such as GimpDockWindow and GimpImageWindow. Failure to do
this cased problems talked about in bug 646794 (case 2).
2011-08-07 20:00:28 +02:00
Michael Natterer 62b0e96609 app: add gimp_devices_add_widget()
which is supposed to set up a widget for tablet events and make sure
the context changes on device changes. "supposed" because everything
is currently horribly broken on GTK+ 2.x. Use the function for all
affected widgets except for the canvas.
2010-12-19 21:23:54 +01:00
Mikael Magnusson 60242667be app: don't use -1 for geometry hints where not allowed 2010-12-08 10:18:09 +01:00
Michael Natterer 0ba0b637f2 app: add gimp_devices_check_callback() with the signature of an event callback
and use it in the toolbox. Will soon be used in more places.
2010-12-06 10:23:15 +01:00
Michael Natterer ef87b83ff0 app: change toolbox geometry hints to something that's closer to the docs
Feels more correct now when resizing, but not really.
2010-11-20 20:44:16 +01:00
Michael Natterer 74a09704ba app: some toolbox cleanup
Add precondition checks and assertions for needed members and remove
unused API.
2010-11-20 15:19:48 +01:00
Michael Natterer e4a96c738e app: factor out duplicated code to gimp_tool_palette_get_button_size()
and use that function in GimpToolPalette and GimpToolbox.
2010-11-20 10:20:52 +01:00
Michael Natterer 281969b45d app: add GimpToolPalette which derives from GtkToolPalette
and move all of GimpToolbox' tool button code there.
2010-11-19 23:52:09 +01:00
Michael Natterer 628439bc31 app: simplify toolbox wilber drawing a lot 2010-10-15 16:03:36 +02:00
Michael Natterer 02abdff8aa app: move the wilber drawing functions to gimpcairo.c 2010-08-28 15:30:02 +02:00
Michael Natterer 3c565a1736 app: unref context, dialog_factory and ui_manager in GObject::dispose()
The were not unrefed at all before
2010-06-24 18:38:16 +02:00
Michael Natterer 6429c3de1b app: #undef GSEAL_ENABLE to build against the gtk-2-22 branch
GDK structs and objects have been sealed in gtk-2-22, but we can't
use the newly introduced accessors yet.
2010-05-30 17:19:47 +02:00
Michael Natterer 46ea197171 app: avoid the deprecated and sealed GTK_OBJECT_FLAGS() 2010-05-10 17:54:49 +02:00
Michael Natterer 7c042df739 app: use a GtkToolPalette for the grid of tools in the toolbox 2010-05-10 17:30:17 +02:00
Martin Nordholts 520da707c1 app: Only show active dockables in dock window titles
Refactor stuff a bit so that the dock window description can be both
short and long. The short version only have the active dockables, and
the long version have all the dockables in the description string. We
use the short version for the window title and the long version for
the Recently Closed Docks menu items.
2010-03-13 20:02:55 +01:00
Martin Nordholts a915132ee6 app: Don't call the dock title a title, but "description"
Don't call the dock title a title, but "description". Title is an old
name from when a GimpDock was a GtkWindow.
2010-03-13 17:18:47 +01:00
Martin Nordholts 3352b0485c app: Fix dockable separator translations
Continued fix of bug 554927. Also translate the " - " string in the
toolbox and add a "dock" translation context.
2010-03-13 12:17:46 +01:00
Martin Nordholts 0279daed28 app: Make Toolbox dock title complete
Make the Toolbox dock title complete, i.e. if the toolbox dock
contains Tool Options, the title will be "Toolbox - Tool Options".
2010-03-05 21:31:07 +01:00
Martin Nordholts c094736f83 app: Remove accidentally commited g_printerr() 2010-01-22 21:00:17 +01:00
Martin Nordholts ba37aaa532 app: Support multi-column DnD in toolbox window
Add a drag handler to the toolbox so it's possible to create
multi-column docks in the toolbox dock window.
2010-01-22 20:48:34 +01:00
Martin Nordholts 56a8cb68a8 app: Have dialog factory entries for the dock windows
Let dock windows have proper GimpDialogFactory entries. This allows us
to get rid of a lot of ugly mostly duplicated code. This also makes us
ready the merge the dock window and toolbox factories which will soon
be done. A few things should be noted:

 * We adjust the wrap box aspect ratio in the toolbox to avoid having
   the toolbox dock window explode

 * We make sure that we still can handle sessionrc files from GIMP 2.6
   and older
2010-01-19 22:24:17 +01:00
Michael Natterer 7175f3e883 Some more changes to build with GSEAL_ENABLE
- use more GTK+ accessors instead of struct members
- remove quite some #undef GSEAL_ENABLE from completely ported files
2010-01-15 15:35:03 +01:00
Martin Nordholts 1bf84999e4 Move the Image Selection Menu to GimpDockWindow
Move the Image Selection Menu from GimpMenuDock to
GimpDockWindow. That is, if a dock window contains many docks then
they will share the same Image Selection Menu.

To do this we need to move around quite a bit of code. Move the
"context", "dialog-factory" and "ui-manager" properties from GimpDock
to GimpToolbox, GimpMenuDock doesn't need it any longer. Turn the
GimpDock getters for these properties into wrappers that go to the
GimpDockWindow properties. In some places, most notably GimpToolbox
construction, we use the GimpToolbox values of these properties, but
most of the time it works fine to just use the GimpDockWindow
properties. GimpDock::setup() and set/get_aux_info() have also been
moved to GimpDockWindow since the only aux info for docks was for the
image selection menu.

Also, we don't bother porting gimp_menu_dock_destroy() to
GimpDockWindow, but we leave the code around. If this is a problem, it
will show.
2009-12-05 21:21:24 +01:00
Martin Nordholts 4ccb650435 Exterminate GimpDockSeparator
Remove all GimpDockSeparator-related code. Seems pointless to keep
even the stuff in gtkrc.
2009-12-02 20:40:39 +01:00
Martin Nordholts 7b85cf4de8 app: Use a GdkWindow instead of GimpDockSeparators for dockable DND
Make drag-and-drop rearrangement of dockables happen directly in the
existing widget hierarchy so we don't have to use special, ugly
widgets (read GimpDockSeparator:s) for that.

More specifically, make edges of dockables and dockbooks have the same
semantics as the GimpDockSeparators had. We put a highlight colored
GdkWindow on top of the widget in question to highlight these special
drop areas. This GdkWindow is not taken into consideration in the GTK+
drag-and-drop code, so it does not interupt the DND interaction.

To achive this, there is a problem we must solve: Drag events in GTK+
are propagated inwards and out, but we sometimes want ancenstor
widgets to take care of drop events. We solve this by introducing the
concept of "drag handlers". A drag handler is asked if it will handle
a given drag event, and if it will, a client will let the drag event
be propagated upwards in the widget hierarchy. Right now, the
GimpPanedBox is the only "drag handler". The code could be generalized
more but it doesn't feel worth it at this point.

The size of the special drop area is 5px, the same size as the default
GtkPaned handles. This is because the plan is to later use these
handles as drop areas too.

Other changes of interest are:
 * We need to take care of "drag-motion", "drag-drop" and widget
   highlightning ourselves. We can not use the GtkDestDefaults
   conveniences with gtk_drag_dest_set() any longer since we need more
   control.
 * Make the drop callback pass the insert index directly instead of a
   GimpDockSeparator
 * Add some GIMP_LOG() debug output for DND
 * Disable the GimpDockSeparator code in GimpToolbox
2009-11-29 18:22:12 +01:00
Michael Natterer 1a23b9ecf2 Build with GSEAL_ENABLE and #undef it where accessors are missing 2009-10-17 20:20:39 +02:00
Martin Nordholts eb6bef33e4 Use gtk_widget_set_visible()
In places where the pattern

  if (show)
    gtk_widget_show (widget);
  else
    gtk_widget_hide (widget);

is used, change to

  gtk_widget_set_visible (widget, show);

Also do some other minor cleanups.
2009-10-17 15:07:34 +02:00
Martin Nordholts 2914af893b app: Allow 1-tool wide toolbox in single-window mode 2009-10-09 23:22:51 +02:00
Martin Nordholts 94e8c90a5f app: Change toolbox aspect ratio to 2.0 / 15.0
Change toolbox subcomponent aspect ratios to 2.0 / 15.0 so we can have
a two tool wide toolbox dock in the image window.
2009-10-04 17:26:48 +02:00
Martin Nordholts 35b228144a app: Make GimpToolbox members private 2009-10-04 15:43:53 +02:00
Sven Neumann bc9602c410 remove pointless delete-event handler 2009-09-29 23:38:16 +02:00
Martin Nordholts f3f19ac35f app: Make tool selection work again
The toolbox toplevel is no longer the dock, do some minor adjustments
to compensate for this, namely sending the toolbox (which is a dock)
as data to callbacks.
2009-09-27 13:54:45 +02:00
Martin Nordholts 4f7693acf0 app: Make GimpDock a GtkVBox
Make GimpDock be a GtkVBox instead of a GimpDockWindow. This means we
can now put a GimpDock anywhere, including inside an image window.

In order to do this we need to:

 * Separate dock and dock window creation in the dialog factory and
   add a couple of new dock window constructors

 * Change gimp_dialog_factory_dock_new() to not only create a dock,
   but also create a dock window and then combine those two

 * Change the dock constructor to take a GimpUIManager since they
   depend on that during their construction. We get the ui manager
   from the dock window, but we can't create the dock *inside* the
   dock window, we have to add the dock later. So we create the dock
   window first and then pass its ui manager to the dock constructors

 * Make some other minor adaptions, mostly with
   gimp_dock_window_from_dock() and gimp_dock_window_get_dock()
2009-09-26 16:21:10 +02:00
Martin Nordholts e87ed66ba7 app: Don't cast GimpDock to GimpDockWindow
In preparation for making GimpDock inherit from a non-window, stop
casting GimpDocks to GimpDockWindows. Instead look up the toplevel
widget for a dock and get the dock window that way.
2009-09-15 07:58:14 +02:00
Martin Nordholts 67128d6034 app: Add GimpDock::set_host_geometry_hints()
In order to allow the toolbox dock to set geometry hints on the
GtkWindow it is in, introduce host geometry hint setting through a new
virtual function GimpDock::set_host_geometry_hints() and a new
"geometry-invalidated" signal.

Docks that needs to setup geometry hints on the window they are in
call gimp_dock_invalidate_geometry(). The GimpDockWindow will listen
to this and give the dock a chance to set geometry hints (or any setup
really) on the GimpDockWindow.
2009-09-13 14:14:08 +02:00
Martin Nordholts a23a220d60 app: Add and use GimpDockWindow window title infrastructure
Add a "title-invalidated" signal to GimpDock and a virtual function
GimpDock::get_title(). When GimpDocks have a state change that their
title depends on they call gimp_dock_invalidate_title(). The
GimpDockWindow listens to this signal and update its window title
using GimpDock::get_title() in an idle handler.
2009-09-13 13:14:18 +02:00
Martin Nordholts 88e6fe1e62 app: Add GimpDialogFactory property to GimpDockWindow
Add a GimpDialogFactory property to GimpDockWindow so that it can get
rid of its GimpDock dependency. We need to call the property
"gimp-dialog-factory" instead of "dialog-factory" though as long as
GimpDock subclasses GimpDockWindow.
2009-09-13 09:49:56 +02:00
Martin Nordholts 0fc1a32ad0 app: Kill GimpImageDock
Get rid of GimpImageDock and make its subclasses inherit directly from
GimpDock instead.
2009-09-13 09:31:21 +02:00
Martin Nordholts 3532acbec6 app: Move UI manager from GimpImageDock to GimpDockWindow
Move the GimpUIManager from GimpImageDock to GimpDockWindow. This
includes making the ui_manager_name class-member of GimpImageDock a
normal instance member of GimpDockWindow since the UI manager name no
longer can be configured at the class level.
2009-09-13 09:22:59 +02:00