Commit cac442c2 authored by Michael Natterer's avatar Michael Natterer 😴

app: port dockable showing in widgets/ to GimpWindowStrategy

parent 0a68527e
......@@ -27,6 +27,7 @@
#include "widgets-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpcontainer.h"
#include "core/gimpmarshal.h"
......@@ -39,6 +40,7 @@
#include "gimpcontainerview.h"
#include "gimpdialogfactory.h"
#include "gimpviewrenderer.h"
#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
......@@ -653,8 +655,10 @@ static void
gimp_container_popup_dialog_clicked (GtkWidget *button,
GimpContainerPopup *popup)
{
gimp_dialog_factory_dialog_raise (popup->dialog_factory,
gtk_widget_get_screen (button),
popup->dialog_identifier, -1);
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (popup->context->gimp)),
popup->context->gimp,
popup->dialog_factory,
gtk_widget_get_screen (button),
popup->dialog_identifier);
g_signal_emit (popup, popup_signals[CONFIRM], 0);
}
......@@ -45,6 +45,7 @@
#include "gimpdialogfactory.h"
#include "gimppropwidgets.h"
#include "gimpview.h"
#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
......@@ -453,11 +454,16 @@ gimp_device_status_view_clicked (GtkWidget *widget,
GdkModifierType state,
const gchar *identifier)
{
GimpDeviceStatus *status;
GimpDialogFactory *dialog_factory;
status = GIMP_DEVICE_STATUS (gtk_widget_get_ancestor (widget,
GIMP_TYPE_DEVICE_STATUS));
dialog_factory = gimp_dialog_factory_get_singleton ();
gimp_dialog_factory_dialog_raise (dialog_factory,
gtk_widget_get_screen (widget),
identifier, -1);
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (status->gimp)),
status->gimp,
dialog_factory,
gtk_widget_get_screen (widget),
identifier);
}
......@@ -27,6 +27,7 @@
#include "widgets-types.h"
#include "core/gimp.h"
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
......@@ -35,6 +36,7 @@
#include "gimpview.h"
#include "gimptoolbox.h"
#include "gimptoolbox-image-area.h"
#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
......@@ -44,9 +46,13 @@ image_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gtk_widget_get_screen (widget),
"gimp-image-list|gimp-image-grid", -1);
GimpContext *context = gimp_toolbox_get_context (toolbox);
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
context->gimp,
gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gtk_widget_get_screen (widget),
"gimp-image-list|gimp-image-grid");
}
static void
......
......@@ -26,6 +26,7 @@
#include "widgets-types.h"
#include "core/gimp.h"
#include "core/gimpbrush.h"
#include "core/gimpcontext.h"
#include "core/gimpgradient.h"
......@@ -36,6 +37,7 @@
#include "gimpview.h"
#include "gimptoolbox.h"
#include "gimptoolbox-indicator-area.h"
#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
......@@ -51,9 +53,13 @@ brush_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gtk_widget_get_screen (widget),
"gimp-brush-grid|gimp-brush-list", -1);
GimpContext *context = gimp_toolbox_get_context (toolbox);
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
context->gimp,
gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gtk_widget_get_screen (widget),
"gimp-brush-grid|gimp-brush-list");
}
static void
......@@ -73,9 +79,13 @@ pattern_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gtk_widget_get_screen (widget),
"gimp-pattern-grid|gimp-pattern-list", -1);
GimpContext *context = gimp_toolbox_get_context (toolbox);
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
context->gimp,
gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gtk_widget_get_screen (widget),
"gimp-pattern-grid|gimp-pattern-list");
}
static void
......@@ -95,9 +105,13 @@ gradient_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gtk_widget_get_screen (widget),
"gimp-gradient-list|gimp-gradient-grid", -1);
GimpContext *context = gimp_toolbox_get_context (toolbox);
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
context->gimp,
gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gtk_widget_get_screen (widget),
"gimp-gradient-list|gimp-gradient-grid");
}
static void
......
......@@ -35,6 +35,7 @@
#include "gimptoolpalette.h"
#include "gimpuimanager.h"
#include "gimpwidgets-utils.h"
#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
......@@ -361,12 +362,14 @@ gimp_tool_palette_tool_button_press (GtkWidget *widget,
if (event->type == GDK_2BUTTON_PRESS && event->button == 1)
{
GimpDock *dock = GIMP_DOCK (private->toolbox);
gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (dock),
gtk_widget_get_screen (widget),
"gimp-tool-options",
-1);
GimpContext *context = gimp_toolbox_get_context (private->toolbox);
GimpDock *dock = GIMP_DOCK (private->toolbox);
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
context->gimp,
gimp_dock_get_dialog_factory (dock),
gtk_widget_get_screen (widget),
"gimp-tool-options");
}
return FALSE;
......
......@@ -37,6 +37,7 @@
#include "gimpviewablebutton.h"
#include "gimpviewablebox.h"
#include "gimpviewrenderergradient.h"
#include "gimpwindowstrategy.h"
#include "gimp-intl.h"
......@@ -620,9 +621,11 @@ gimp_viewable_box_edit_clicked (GtkWidget *widget,
const gchar *editor_id = g_object_get_data (G_OBJECT (button),
"gimp-viewable-box-editor");
gimp_dialog_factory_dialog_raise (button->dialog_factory,
gtk_widget_get_screen (widget),
editor_id, -1);
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (button->context->gimp)),
button->context->gimp,
gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
editor_id);
}
static void
......
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