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()
This commit is contained in:
@ -44,6 +44,7 @@
|
||||
#include "widgets/gimpdevicestatus.h"
|
||||
#include "widgets/gimpdialogfactory.h"
|
||||
#include "widgets/gimpdockable.h"
|
||||
#include "widgets/gimpdockwindow.h"
|
||||
#include "widgets/gimpdocumentview.h"
|
||||
#include "widgets/gimperrorconsole.h"
|
||||
#include "widgets/gimperrordialog.h"
|
||||
@ -215,25 +216,53 @@ dialogs_quit_get (GimpDialogFactory *factory,
|
||||
GtkWidget *
|
||||
dialogs_toolbox_get (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint view_size)
|
||||
GimpUIManager *ui_manager)
|
||||
{
|
||||
/* we pass "global_dock_factory", _not_ "global_toolbox_factory" to
|
||||
* the toolbox constructor, because the global_toolbox_factory has no
|
||||
* dockables registered
|
||||
*/
|
||||
return gimp_toolbox_new (global_dock_factory, context);
|
||||
return gimp_toolbox_new (global_dock_factory,
|
||||
context,
|
||||
ui_manager);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
dialogs_toolbox_dock_window_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint view_size)
|
||||
{
|
||||
return g_object_new (GIMP_TYPE_DOCK_WINDOW,
|
||||
"role", "gimp-toolbox",
|
||||
"ui-manager-name", "<Toolbox>",
|
||||
"gimp-dialog-factory", factory,
|
||||
"gimp-context", context,
|
||||
NULL);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
dialogs_dock_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint view_size)
|
||||
GimpUIManager *ui_manager)
|
||||
{
|
||||
return gimp_menu_dock_new (factory,
|
||||
context->gimp->images,
|
||||
context->gimp->displays);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
dialogs_dock_window_new (GimpDialogFactory *factory,
|
||||
GimpContext *context,
|
||||
gint view_size)
|
||||
{
|
||||
return g_object_new (GIMP_TYPE_DOCK_WINDOW,
|
||||
"role", "gimp-dock",
|
||||
"ui-manager-name", "<Dock>",
|
||||
"gimp-dialog-factory", factory,
|
||||
"gimp-context", context,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
/***************/
|
||||
/* dockables */
|
||||
|
Reference in New Issue
Block a user