Commit Graph

69 Commits

Author SHA1 Message Date
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
Michael Natterer dee0afed79 Move the statusbar back to GimpDisplayShell
Keeping it in GimpImageWindow was a bad idea because
- it wasted space
- it produced evil code because
- it conceptually didn't belong there
2009-10-04 15:33:03 +02:00
Martin Nordholts d8392b8c52 app: Don't resize the left dock area when the image window is resized 2009-10-04 13:51:47 +02:00
Martin Nordholts 8fd011e75e app: Make right dock column not resize when adjusting left pane 2009-10-04 11:27:46 +02:00
Martin Nordholts d3435b14e6 app: Put docks in the image window in single-window mode in panes 2009-10-04 11:13:05 +02:00
Martin Nordholts d1958a5103 app: Add GimpDockColumns to the left and right of a GimpImageWindow 2009-10-04 02:10:11 +02:00
Michael Natterer ff20a1367d Make GimpImageWindow handle the empty display correctly
Keep around a boolean state "is_empty" and update it when adding and
removing shells, and when the image of any shell changes. Do empty
display voodoo only when the "is_empty" state changes.
2009-10-01 19:44:13 +02:00
Michael Natterer a6bb7fb8ee Remove accidentially added #include 2009-09-30 19:31:13 +02:00
Michael Natterer b9b7cadbb0 Use large image previews as tab widgets 2009-09-30 19:25:38 +02:00
Michael Natterer ccdab9e4cd Make updagin the image window's ui manager more sane
(gimp_image_window_image_notify): update the ui manager unconditionally
(both when a display is emptied *and* filled)

(gui_display_create): remove updating code here. It was not belonging
here anyway and the image window does the right thing now.
2009-09-30 00:00:36 +02:00
Michael Natterer d1dc70fbdf Add some more shell management API to GimpImageWindow
- gimp_image_window_remove_shell()
- gimp_image_window_get_n_shells()
2009-09-29 22:59:48 +02:00
Michael Natterer 35588efaa1 Remove "gimp-" prefix from the shell's "icon" and "title" properties
The prefix was needed because GtkWindow also has "icon" and "title"
properties.
2009-09-29 22:20:12 +02:00
Michael Natterer d046da90e2 Merge the image window's active shell logic with the notebook's active page
Add a GtkNotebook::switch_page() handler and move all shell switching
code there. In gimp_image_window_set_active_shell(), simply set the
right notebook page.
2009-09-29 22:14:10 +02:00
Michael Natterer e8061e5a7e Add a notebook for the display shells 2009-09-29 21:57:57 +02:00
Michael Natterer b0f7a7daf4 Add a central hbox for docks and display shells 2009-09-29 21:47:58 +02:00
Michael Natterer 1c430a2b19 Move all GimpImageWindow members to a private struct
Add accessor functions for publically available members and visibility
functions for menubar and statusbar.
2009-09-29 21:44:43 +02:00
Michael Natterer 59274856ad Derive GimpDisplayShell from GtkVBox instead of GimpImageWindow
...and pack the widget into a separately created GimpImageWindow.
2009-09-29 20:56:14 +02:00
Michael Natterer 35739c743c Change GimpImageWindow API to speak in shells, not displays
A widget container should keep around child widgets, not whatever
objects that just have widgets.
2009-09-28 22:55:55 +02:00
Michael Natterer 1273a63eab Update the shell's appearance when it is set active in the image window 2009-09-28 22:55:53 +02:00
Michael Natterer a8876834e8 Move the remaining menubar signal connections from the shell to the window 2009-09-28 22:55:53 +02:00
Michael Natterer fa43c8797e Add gimp_statusbar_override/restore_window_title()
Which sets/unsets the title of an iconified toplevel image window to
the current progress message (if any). Use the new functions when the
window is (de)iconified. Not exactly the high art of programming, but
much better than the hacks in gimpdisplayshell-progress.c that are now
removed.
2009-09-28 22:55:52 +02:00
Michael Natterer 892f9f8876 Add gimp_image_window_is_iconified() and use it in GimpImageWindow 2009-09-28 22:55:51 +02:00
Michael Natterer 5b5e4e039a Add gimp_image_window_add_display() and use it
This API is most likely not final, but enables adding the vbox of
shell widgets to the image window's vbox *after* the shell constructor
returns. Seems to work nicely :-)
2009-09-28 22:55:51 +02:00
Michael Natterer 32783d7228 Move shrink_wrap() from the display to the window
Also fix all callers. This clearly needs more cleanup.
2009-09-28 22:55:50 +02:00
Michael Natterer 7f064f694e Get rid of the shell's window-state-event handler
Move the last remaining function to the window. It doesn't actually
belong there, but it's better than the handler in the wrong place.
Added FIXME as reminder.
2009-09-28 22:55:49 +02:00
Michael Natterer 4f60240a04 Move updating the "view-fullscreen" actions to the proper place
Update the actions in gimp_display_shell_appearance_update() and remove
all action code from the window-state-event handlers.
2009-09-28 22:55:49 +02:00
Michael Natterer 8b5b36751d Move updating the shell's appearance to the right window state event handler
The shell's handler is going to go away, so move this call to
the image window.
2009-09-28 22:55:48 +02:00
Michael Natterer 5c048e0108 Reindent static prototypes 2009-09-28 22:55:48 +02:00
Michael Natterer d015a704b3 Move GtkWidget::configure_event() impl from the shell to the window
Still has a FIXME for later, but is in the right place now.
2009-09-28 22:55:48 +02:00
Michael Natterer a5945740e0 Move GtkWidget::delete_event() impl from the shell to the window
Still has a FIXME but is in the right place now at least
2009-09-28 22:55:47 +02:00
Michael Natterer d2f43f1604 Finally fully enable the image window's active_display mechanism
Don't set the window's active_display manually in gimp_display_shell_new(),
setting it properly after construction in gimp_display_new() works fine
now. Enable all disabled code in gimp_image_window_set_active_display().
2009-09-28 22:55:47 +02:00
Michael Natterer fdd55d37cb Move the last window-related NIW code from the shell to the image window 2009-09-28 22:55:46 +02:00
Michael Natterer 9c5e44c566 Move the window part of gimp_display_shell_fill() to GimpImageWindow 2009-09-28 22:55:45 +02:00
Michael Natterer 4cc8f8e6f8 Move the window part of gimp_display_shell_empty() to GimpImageWindow 2009-09-28 22:55:44 +02:00
Michael Natterer e5d8067a87 Unref the menubar_manager in finalize() 2009-09-28 22:55:44 +02:00