Commit d7dc2dc1 authored by Martin Nordholts's avatar Martin Nordholts
Browse files

app: Make tooltips in the toolbox work again

We need to be able to pass a GimpUIManager to
gimp_dialog_factory_dialog_new(), so make that possible. Also make
sure to set ui_manager in gimp_dialog_factory_dialog_new_internal()
when we create both a dock window and a dock, so tooltips works in
toolboxes created from scratch.
parent afa9bd3b
......@@ -42,6 +42,7 @@ dialogs_create_toplevel_cmd_callback (GtkAction *action,
if (value)
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
NULL /*ui_manager*/,
value, -1, TRUE);
}
......
......@@ -143,6 +143,7 @@ file_open_location_cmd_callback (GtkAction *action,
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
NULL /*ui_manager*/,
"gimp-file-open-location-dialog", -1, TRUE);
}
......@@ -490,6 +491,7 @@ file_open_dialog_show (Gimp *gimp,
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (parent),
NULL /*ui_manager*/,
"gimp-file-open-dialog", -1, FALSE);
if (dialog)
......@@ -532,6 +534,7 @@ file_save_dialog_show (Gimp *gimp,
{
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (parent),
NULL /*ui_manager*/,
"gimp-file-save-dialog",
-1, FALSE);
......@@ -582,6 +585,7 @@ file_export_dialog_show (Gimp *gimp,
{
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (parent),
NULL /*ui_manager*/,
"gimp-file-export-dialog",
-1, FALSE);
......
......@@ -128,6 +128,7 @@ image_new_cmd_callback (GtkAction *action,
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
NULL /*ui_manager*/,
"gimp-image-new-dialog", -1, FALSE);
if (dialog)
......
......@@ -58,6 +58,7 @@ palettes_import_cmd_callback (GtkAction *action,
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
NULL /*ui_manager*/,
"gimp-palette-import-dialog", -1, TRUE);
}
......
......@@ -283,6 +283,7 @@ gimp_ui_configurer_move_docks_to_window (GimpUIConfigurer *ui_configurer,
dock_window =
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
screen,
NULL /*ui_manager*/,
(GIMP_IS_TOOLBOX (dock) ?
"gimp-toolbox-window" :
"gimp-dock-window"),
......
......@@ -175,6 +175,7 @@ global_error_dialog (void)
{
return gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gdk_screen_get_default (),
NULL /*ui_manager*/,
"gimp-error-dialog", -1,
FALSE);
}
......
......@@ -188,6 +188,7 @@ gimp_ui_tool_options_editor_updates (GimpTestFixture *fixture,
GimpUIManager *ui_manager = gimp_image_window_get_ui_manager (image_window);
GtkWidget *dockable = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (toplevel),
NULL /*ui_manager*/,
"gimp-tool-options",
-1 /*view_size*/,
FALSE /*present*/);
......
......@@ -458,9 +458,15 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
{
dock_window = gimp_dialog_factory_dialog_new (factory,
screen,
NULL /*ui_manager*/,
"gimp-toolbox-window",
-1 /*view_size*/,
FALSE /*present*/);
/* When we get a dock window, we also get a UI
* manager
*/
ui_manager = gimp_dock_window_get_ui_manager (GIMP_DOCK_WINDOW (dock_window));
}
}
......@@ -605,6 +611,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
* gimp_dialog_factory_dialog_new:
* @factory: a #GimpDialogFactory
* @screen: the #GdkScreen the dialog should appear on
* @ui_manager: A #GimpUIManager, if applicable.
* @identifier: the identifier of the dialog as registered with
* gimp_dialog_factory_register_entry()
* @view_size: the initial preview size
......@@ -619,6 +626,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
GtkWidget *
gimp_dialog_factory_dialog_new (GimpDialogFactory *factory,
GdkScreen *screen,
GimpUIManager *ui_manager,
const gchar *identifier,
gint view_size,
gboolean present)
......@@ -630,7 +638,7 @@ gimp_dialog_factory_dialog_new (GimpDialogFactory *factory,
return gimp_dialog_factory_dialog_new_internal (factory,
screen,
factory->p->context,
NULL,
ui_manager,
identifier,
view_size,
FALSE,
......
......@@ -131,6 +131,7 @@ GimpSessionInfo * gimp_dialog_factory_find_session_info (GimpDialogFactory
const gchar *identifier);
GtkWidget * gimp_dialog_factory_dialog_new (GimpDialogFactory *factory,
GdkScreen *screen,
GimpUIManager *ui_manager,
const gchar *identifier,
gint view_size,
gboolean present);
......
......@@ -231,6 +231,7 @@ gimp_session_info_dock_restore (GimpSessionInfoDock *dock_info,
ui_manager = gimp_dock_window_get_ui_manager (GIMP_DOCK_WINDOW (dock_window));
dock = gimp_dialog_factory_dialog_new (factory,
screen,
ui_manager,
dock_info->identifier,
-1 /*view_size*/,
FALSE /*present*/);
......
......@@ -461,6 +461,7 @@ gimp_session_info_restore (GimpSessionInfo *info,
dialog =
gimp_dialog_factory_dialog_new (factory, screen,
NULL /*ui_manager*/,
info->p->factory_entry->identifier,
info->p->factory_entry->view_size,
! GIMP_GUI_CONFIG (config)->hide_docks);
......
......@@ -1083,6 +1083,7 @@ gimp_dock_with_window_new (GimpDialogFactory *factory,
dock_window =
gimp_dialog_factory_dialog_new (factory,
screen,
NULL /*ui_manager*/,
(toolbox ?
"gimp-toolbox-window" :
"gimp-dock-window"),
......@@ -1093,6 +1094,7 @@ gimp_dock_with_window_new (GimpDialogFactory *factory,
ui_manager = gimp_dock_window_get_ui_manager (GIMP_DOCK_WINDOW (dock_window));
dock = gimp_dialog_factory_dialog_new (factory,
screen,
ui_manager,
(toolbox ?
"gimp-toolbox" :
"gimp-dock"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment