Commit Graph

103 Commits

Author SHA1 Message Date
Martin Nordholts 3ce4c49314 app: Handle special case "Toolbox" in GimpSingleWindowStrategy
The special case isn't pretty, but the current design can't handle it
nicely. This is not the first special case for the toolbox.
2011-07-20 16:36:36 +02:00
Martin Nordholts 07556242b0 app: Make positioning of new dockables depend on window mode
Add GimpWindowingStrategy with create_dockable_dialog() and use it in
dialogs_create_dockable_cmd_callback(). There are two implementations:
GimpSingleWindowStrategy and GimpMultiWindowStrategy. Depending on the
window mode, we want new dockables to appear in different places when
created. In single-window mode, they should appear inside the single
image window. In multi-window mode, a new dock window is created.
2011-07-03 21:20:36 +02:00
Martin Nordholts bb39703c7a app: Update appearance after adding dock
Since gimp_display_shell_appearance_update() depends on docks being
present, call it in gimp_image_window_add_dock(). Otherwise the resize
handle will be present when starting in single-window mode.
2011-06-06 16:07:25 +02:00
Martin Nordholts 42c2c747d8 Bug 603848 - Single-window mode is not properly session managed yet
Make GimpImageWindow implement GimpDockContainer and
GimpSessionManaged so that GIMP can be started in single-window mode.
2011-06-04 12:22:20 +02:00
Martin Nordholts 75259bf4bb app: Call gimp_image_window_session_update() early
Call gimp_image_window_session_update() at the end of
gimp_image_window_constructed() so that if GIMP is closed right after
being started, the image window session info has the widget
initialized (and also so that the correct size is setup initially).
2011-06-04 12:22:20 +02:00
Michael Natterer 1ebd2b5113 Revert "app: Make alt+[number] switch tabs in single-window mode"
This reverts commit 110b3daa97.
2011-05-07 23:54:54 +02:00
Michael Natterer c35ff719a7 app/libgimp*: remove stuff found by -Wunused-but-set-variable 2011-05-01 23:23:19 +02:00
Mukund Sivaraman 5c55f8e897 app: Fix Alt+0 case when switching tabs 2011-04-06 11:58:58 +05:30
Mukund Sivaraman 110b3daa97 app: Make alt+[number] switch tabs in single-window mode 2011-04-06 11:52:10 +05:30
Massimo Valentini 166c76b62d Bug 630069 - In single-window mode, canvas badly positioned in all successive tabs
The problem is that gimp_image_window_keep_canvas_pos() connects a
signal handler too early, with data not yet valid, the handler is
executed after the canvas position is computed correctly and so
invalid data overrides the valid.

Checks the return value of gtk_widget_translate_coordinates() to avoid
connecting handlers when their execution is considered harmful.
2011-03-09 07:34:27 +01:00
Michael Natterer 145db8d57c Bug 639305 - Image tabs pushes toolbox to left
Set the notebook to scrollable. Not a final fix, but enough to fix the
immediate problem.
2011-03-01 00:56:23 +01:00
Michael Natterer c09ad998a4 app: split tool event handling out into an own file
it was simply getting too hairy in the callbacks.c file.
2011-02-24 02:15:53 +01:00
Michael Natterer bbe0e757b8 app: some GimpImageWindow cleanup
- implement GObject::constructed() instead of ::construct()
- remove the display pause/resume idle hack because any tool
  drawing flickering is gone now by using cairo
- some formatting cleanup
- remove some unused local variables
2010-11-26 09:19:36 +01:00
Michael Natterer 0e17e44ba4 app: move code from GtkObject::destroy() to GObject::dispose() 2010-09-26 22:35:49 +02:00
Michael Natterer ddc63de6d6 app: remove "gboolean use_offsets" from gimpdisplayshell-transform.[ch] 2010-09-23 19:24:04 +02:00
Michael Natterer 8b31211639 Fix the bulid after GtkNotebookPage got deprecated in gtk-2-22
In all GtkNotebook::switch_page() callbacks, simply replace
GtkNotebookPage* by gpointer.
2010-07-16 15:24:25 +02:00
Michael Natterer 39c7405954 app: disconnect from the dialog factory in dispose() instead of finalize() 2010-06-24 18:38:18 +02:00
Michael Natterer cf1cc6dc6f app: private->shells might be a list with one element upon destroy; free it 2010-06-22 23:06:35 +02:00
Martin Nordholts ab6d5553d9 app: Don't unmaximize image window when switching tabs in swm
It is when we apply session info to the image window we unmaximize, so
don't apply session info to the image window when all we do is
switching tabs in single-window mode.
2010-06-19 11:08:17 +02:00
Gilles Rochefort 1ca7c6df50 Bug 613841 - Reducing toolbox width in single window mode
Allow to resize left and right dock areas arbitrarilly small.
2010-05-15 20:55:29 +02:00
Michael Natterer a2c70822d4 Use accessors from GTK+ 2.20 instead of using sealed members directly 2010-04-19 19:21:07 +02:00
Martin Nordholts 0c4409c897 app: Session manage empty- and single-image window separately
Session manage empty- and single-image window separately. So when
starting up, the default 2.6 UI is the same. But when enabling
single-window mode, the image window will become much larger then the
empty-image window. These conceptually different windows will then
from that point be session managed separately: switching mode switches
size of the image window.
2010-03-13 16:35:57 +01:00
Martin Nordholts 77dab5257e app: Introduce image window session utility functions
Introduce image window session utility functions
gimp_image_window_session_clear() and
gimp_image_window_session_apply().
2010-03-13 12:56:27 +01:00
Martin Nordholts e6fa0c65c2 app: Simplify GimpImageWindow session management
Refactor session management with the "gimp-empty-image-window" in
GimpImageWindow. In particular, only have one entry point to
gimp_dialog_factory_add_foreign() and remove the is_empty instance
struct member.
2010-03-13 12:41:06 +01:00
Martin Nordholts d44ee9e2c4 app: Update Windows->Toolbox menu entry depending on if toolbox exists
Update Windows->Toolbox menu entry depending on if toolbox exists. If
an existing toolbox will be raised, set "Toolbox". If it will create a
new toolbox, set "New Toolbox". We need this special treatment since
there can be only one toolbox, so "New Toolbox" will remove any
toolbox docks from Recently Closed Docks. If we would just have
"Toolbox" it could be misinterpreted as "get me the toolbox I just
closed".
2010-03-07 12:24:26 +01:00
Michael Natterer 1aeb315ecf undef GTK_DISABLE_DEPRECATED in many places which undef GSEAL_ENABLE
because the widget flag access macros (e.g. GTK_WIDGET_REALIZED) are
now deprecated in GTK+ master.
2010-03-06 23:14:29 +01:00
Martin Nordholts 6647c495f3 app: Store GimpDialogsState per dialog factory
Get rid of the file-static variable 'dialogs_state' from
gimpdialogfactory.c and move it into the GimpDialogFactory struct.
2010-02-28 18:48:39 +01:00
Martin Nordholts 78ddb19347 app: Keep canvas position on all display shell widgets
Don't use gimp_image_window_keep_canvas_pos() only for docks, use it
for all widgets in the display shell: the rulers, the menu bar, the
statusbar and the scrollbars. It is not really necessary for the two
latter ones because they are below and/or to the right of the canvas,
but we include them for completeness. Plus, they might get moved
around some day...
2010-02-28 15:22:56 +01:00
Martin Nordholts 2c0573d6cd app: gimp_image_window_keep_canvas_pos() should work in canvas coords
gimp_image_window_keep_canvas_pos() should to work in GimpCanvas
coordinates, not GimpDisplayShell coordinates.
2010-02-28 15:22:56 +01:00
Martin Nordholts ed5830fb7b app: Pause tool drawing while hiding docks in single-window mode
Freeze the active tool until the UI has stabilized. If it draws while
we hide widgets there will be flicker. See bug 602223.
2010-02-25 22:08:57 +01:00
Martin Nordholts 18f3be6bd3 Bug 602223 - Can't hide docks with Tab in single-window mode
Add a "hide-docks" config and connect the Windows->Hide docks menu
item to it. Also connect the image window to the config property so it
can hide/show its docks when it needs to.

Also add and use a utility function
gimp_image_window_keep_canvas_pos() to ensure that the image in the
window remains fixed when toggling visiblity of docks. One problem:
When GimpDrawTool is active on the canvas, there is flicker. The end
position is correct though.

Also add regression testing for this fix to test-ui.c
2010-02-24 19:53:48 +01:00
Martin Nordholts 82a0b95147 app: Update image window side docks visiblity from the image window
Update image window side docks visiblity from the image window itself
instead of from the ui configurer. The image window has a dependency
to the config object anyway, so no need to complicate things.
2010-02-24 19:53:48 +01:00
Martin Nordholts bf830398a5 app: Cleanup GimpImageWindow and dependencies, only one dialog factory
Cleanup GimpImageWindow and dependencies like GimpDisplay, there is
only one dialog factory now.
2010-02-20 11:09:51 +01:00
Martin Nordholts 5d79f664d3 app: Add "dialog-factory", "ui-manager" properties to GimpDockColumns
Add "dialog-factory", "ui-manager" properties to GimpDockColumns and
let GimpDock look for these before trying to look for a dock window
which does not exist in single-window mode.
2010-01-07 19:18:03 +01:00
Martin Nordholts bc5da21ba2 app: Add gimp_dock_columns_new() and GimpContext property
Add and use gimp_dock_columns_new() and add a GimpContext property to
GimpDockColumns. Also move the widget construction from _init() to
_constructor() in GimpDockWindow so we have a context object to pass
to gimp_dock_columns_new().
2010-01-07 19:13:13 +01:00
Martin Nordholts f1bbb2c70a app: Fix menubar suddently stopping to work when toggling window modes
The image window must not disconnect from the active shell when any
page is removed, only when the active page is removed. This fixes the
bug with this step-by-step:

1. Start GIMP with a clean gimpdir
2. Create two windows
3. Enable single-window mode
4. Disable single-window mode
5. Try to execute a menu action, e.g. Select -> Invert, on both images

Expected result:
It works

Actual result:
It won't work in the image window that was reused and thus once had
two notebook pages, since it disconnected from page 1 when page 2 was
removed.

Also add some debug output.
2010-01-06 14:50:36 +01:00
Martin Nordholts fecc04914e app: gimp_image_window_page_removed() gets the widget, not page
The first GtkNotebook::"page-removed" signal parameter is the
GtkWidget that was removed, not a GtkNotebookPage. Correct function
signature.
2010-01-06 14:50:36 +01:00
Martin Nordholts 4fcd3024f1 app: Set a GimpContext on GimpDockColumns
In order to make a GimpDock get hold of a GimpContext both in
single-window mode and in multi-window mode, don't make it look for a
GimpContext in a GimpDockWindow, put the context in GimpDockColumns
instead. GimpDockColumns exists both in s-w-m and m-w-m, contrary to
GimpDockWindow. Still use the GimpDockWindow as a backup though.
2010-01-05 11:31:15 +01:00
Martin Nordholts 90d7ffde1a app: Make all GimpDialogFactory members private
Add necessary trivial API that allows us to make remaining
GimpDialogFactory instance members private, and make them private.
2009-12-20 20:21:26 +01:00
Martin Nordholts f3235e6f45 app: Add "dock-factory" property to GimpImageWindow
With the introduction of a single-window mode, not only dock windows
needs to be able to create docks, the image window also needs to. So
give it a "dock-factory" property.
2009-12-08 19:49:13 +01:00
Martin Nordholts fdf2454666 app: Add gimp_image_window_new/destroy()
Add gimp_image_window_new/destroy() so we have a central place where
the Gimp::image_windows list is managed.
2009-10-25 22:02:38 +01:00
Martin Nordholts 19baff1a50 app: Add gimp_image_window_get_shell() 2009-10-25 21:57:14 +01:00
Martin Nordholts b9214fd3cf app: Add "gimp" property to GimpImageWindow 2009-10-25 21:44:23 +01:00
Martin Nordholts 870d7f9376 app: Connect to GtkNotebook::page-removed in GimpImageWindow
We must disconnect from the last display shell when it is removed
when rearranging the UI, so connect to GtkNotebook::page-removed
in GimpImageWindow and do that.
2009-10-25 20:03:51 +01:00
Martin Nordholts 75ee76ecb6 app: Handle gimp_image_window_get_active_shell() returning NULL
When rearranging the UI it is pretty common that
gimp_image_window_get_active_shell() returns NULL so check for that.
2009-10-25 20:03:51 +01:00
Michael Natterer 6608d66cde Build with GSEAL_ENABLE and #undef it where accessors are missing 2009-10-17 19:51:33 +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
Michael Natterer c5b856f16f Use gimp_display_get_image() instead of display->image 2009-10-06 19:20:44 +02:00
Michael Natterer bf41a773cb Update the window title and icon when switching between shells 2009-10-06 10:56:46 +02:00
Michael Natterer d1ded0617f More gimp_display_get_shell() instead of display->shell 2009-10-05 19:58:03 +02:00