using the proper API, so all stuff is properly disconnected and the
list items managing them are freed to. Also make removing robust
against dockbook->dock being NULL.
We don't need to call gimp_dockbook_refresh_tab_layout_lut() in
added() and removed() because we call
gimp_dockbook_update_auto_tab_style() in add() and remove().
Remove the dockable drag handle and move the menu button it hosts up
to the GimpDockbook, with the gtk_notebook_set_action_widget() API.
This frees up quite a lot of screen estate which can be used for the
content of dockables instead.
Add support for a new type of Tab Style called 'Automatic'. This tab
style makes the GimpDockbook use the biggest actual tab style it can
for its auto tab style dockables, based on its widget allocation.
The tab style candidates for auto tab style are "Status + Blurb",
"Status + Text" and "Status". A docked widget can also say that it
wants to use "Icon" instead of "Status" for its auto tab style. The
'Tool Options' dockable does this. This is to be as backwards
compatible with the old tab style setup, we make 'automatic' the
default everywhere.
We have quite a bit of dependency to internal layout code in
GtkNotebook, but the current code should be pixel perfect and rather
complete.
Also add a basic regression test.
The function gimp_dockable_get_tab_widget() and
gimp_dockable_get_drag_widget are not getters, they create new
widgets. Furthermore, gimp_dockable_get_tab_widget() doesn't use the
instance tab style but takes a tab style paramter. Rename the
functions to gimp_dockable_new_tab_widget_for_style() and
gimp_dockable_new_drag_widget() to reflect this.
When moving dockables from a dock window to an image window, they need
to start listening to the user context. So update the dockables with
the new context when we switch window mode.
When quitting GIMP while in single-window mode and the widget
hierarchies are cleaned up, prevent a tab widget from being
constructed so we don't get any annoying warnings due to failing to
look up a context.
Use g_signal_connect_object() instead of g_signal_connect() so that
the dockable is referenced and not destroyed before
_drag_end(). Prevents a crash, but DnD in single-window mode does not
work properly yet.
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
Add a new class GimpPanedBox that wraps the arrangement of widgets
into GtkPaned hierarchies. It takes over the separator management from
GimpDock and the GtkPaned management from
gimpwidgets-utils.[ch]. GimpPanedBox can be both vertically and
horizontally oriented.
Change GimpDock to use this widget and make some other minor
adaptations.
For now, only show dock separators when they are needed, not all the
time. We need a better solution eventually, but at least docks in the
image window doesn't look terrible any longer.
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.
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-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2008-05-19 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdockable.[ch]
* app/widgets/gimpdockbook.[ch]: added a "locked" propery to
GimpDockable. A locked dockable cannot be moved by drag-n-drop.
Allows users to protect their dockables from accidental changes,
mainly when working with a tablet.
* app/widgets/gimpsessioninfo-dockable.[ch]: store the "locked"
property in the session info.
* app/actions/dockable-actions.c
* app/actions/dockable-commands.[ch]: added an action for
toggling
the "locked" state.
* app/widgets/gimphelp-ids.h: new help-id "gimp-dock-tab-lock".
* menus/dockable-menu.xml.in: show the new menu item.
* app/actions/plug-in-actions.c: formatting.
svn path=/trunk/; revision=25715
2008-03-10 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdockable.[ch]
* app/widgets/gimpdockbook.c: moved code for the drag widget to
GimpDockable. Use semi-bold text for the drag widget also.
svn path=/trunk/; revision=25082
2007-12-12 Sven Neumann <sven@gimp.org>
* INSTALL
* configure.in
* app/gui/gui.c (GTK_REQUIRED_MICRO): bumped minimum required
version of gtk+ to 2.12.1.
* app/widgets/gimpdockbook.c (gimp_dockbook_tab_drag_motion):
removed unused parameter that was needed for gtk+ < 2.12.1.
svn path=/trunk/; revision=24334
2007-10-16 Sven Neumann <sven@gimp.org>
* libgimp/gimppatternselectbutton.c
* libgimp/gimpbrushselectbutton.c
* libgimpwidgets/gimpcolorarea.c
* app/widgets/gimpdnd.c
* app/widgets/gimpdockbook.c: set GDK_WINDOW_TYPE_HINT_DND on
popup windows used to implement a DND cursor.
svn path=/trunk/; revision=23841
2007-09-17 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdockbook.[ch]: when DND-hovering > 500ms over a
notebook tab, switch to that tab's page. Suggested by Saul Goode.
svn path=/trunk/; revision=23573
2006-12-12 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdockbook.c (gimp_dockbook_get_tab_widget): check
ui_manager before accessing it. Fixes warnings on destruction.
2006-06-17 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdockbook.c (gimp_dockbook_get_tab_widget): put
the event box' event window above its children because now that it
is input-only, it won't receive events that are not in its
childrens' event mask if the event window is below.
Fixes bug #345137.
2006-06-15 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdockbook.c (gimp_dockbook_get_tab_widget): set
the event box' window invisible so we get the right background
with all themes.
2006-03-28 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdockbook.c (gimp_dockbook_drop_dockable):
allow
dropping of dockables from the same dockbook to the empty space
next to the notebook tabs. This moves the dockable to the end.
2006-01-18 Michael Natterer <mitch@gimp.org>
* app/config/config-types.c: define GIMP_PARAM_STATIC_STRINGS
which is G_PARAM_STATIC_NAME|NICK|BLURB. Also define
GIMP_PARAM_READABLE, _WRITABLE and _READWRITE which include
GIMP_PARAM_STATIC_STRINGS.
* app/*/*.c: use them for all object properties so their
strings are not copied.
2005-12-30 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdockable.[ch]: #define GIMP_DOCKABLE_DRAG_OFFSET
publically.
* app/widgets/gimpdockbook.c (gimp_dockbook_tab_drag_end): use the
define to reset the dockable's drag offsets.
2005-12-29 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdockbook.c (gimp_dockbook_dockable_added): set
the current notebook page to the dockable that was just added.