Commit 1ed1d98a authored by Michael Natterer's avatar Michael Natterer 😴

libgimp: undeprecate all GimpFooSelectButton classes

parent 960b530d
......@@ -776,11 +776,10 @@ gimp_brush_select_button_open_popup (GimpBrushSelectButton *button,
GimpBrushSelectButtonPrivate *priv;
GtkWidget *frame;
GtkWidget *preview;
GdkScreen *screen;
GdkMonitor *monitor;
GdkRectangle workarea;
gint x_org;
gint y_org;
gint scr_w;
gint scr_h;
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (button);
......@@ -790,11 +789,10 @@ gimp_brush_select_button_open_popup (GimpBrushSelectButton *button,
if (priv->width <= CELL_SIZE && priv->height <= CELL_SIZE)
return;
screen = gtk_widget_get_screen (GTK_WIDGET (button));
priv->popup = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_type_hint (GTK_WINDOW (priv->popup), GDK_WINDOW_TYPE_HINT_DND);
gtk_window_set_screen (GTK_WINDOW (priv->popup), screen);
gtk_window_set_screen (GTK_WINDOW (priv->popup),
gtk_widget_get_screen (GTK_WIDGET (button)));
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
......@@ -810,15 +808,14 @@ gimp_brush_select_button_open_popup (GimpBrushSelectButton *button,
gdk_window_get_origin (gtk_widget_get_window (priv->preview),
&x_org, &y_org);
scr_w = gdk_screen_get_width (screen);
scr_h = gdk_screen_get_height (screen);
monitor = gimp_widget_get_monitor (GTK_WIDGET (button));
gdk_monitor_get_workarea (monitor, &workarea);
x = x_org + x - (priv->width / 2);
y = y_org + y - (priv->height / 2);
x = (x < 0) ? 0 : x;
y = (y < 0) ? 0 : y;
x = (x + priv->width > scr_w) ? scr_w - priv->width : x;
y = (y + priv->height > scr_h) ? scr_h - priv->height : y;
x = CLAMP (x, workarea.x, workarea.x + workarea.width - priv->width);
y = CLAMP (y, workarea.y, workarea.y + workarea.height - priv->height);
gtk_window_move (GTK_WINDOW (priv->popup), x, y);
......@@ -893,8 +890,6 @@ gimp_brush_select_button_create_inside (GimpBrushSelectButton *brush_button)
priv = GIMP_BRUSH_SELECT_BUTTON_GET_PRIVATE (brush_button);
gtk_widget_push_composite_child ();
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
frame = gtk_frame_new (NULL);
......@@ -934,7 +929,5 @@ gimp_brush_select_button_create_inside (GimpBrushSelectButton *brush_button)
gtk_widget_show_all (hbox);
gtk_widget_pop_composite_child ();
return hbox;
}
......@@ -440,8 +440,6 @@ gimp_font_select_button_create_inside (GimpFontSelectButton *font_button)
priv = GIMP_FONT_SELECT_BUTTON_GET_PRIVATE (font_button);
gtk_widget_push_composite_child ();
button = gtk_button_new ();
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
......@@ -471,7 +469,5 @@ gimp_font_select_button_create_inside (GimpFontSelectButton *font_button)
G_CALLBACK (gimp_font_select_drag_data_received),
font_button);
gtk_widget_pop_composite_child ();
return button;
}
......@@ -588,8 +588,6 @@ gimp_gradient_select_button_create_inside (GimpGradientSelectButton *gradient_bu
priv = GIMP_GRADIENT_SELECT_BUTTON_GET_PRIVATE (gradient_button);
gtk_widget_push_composite_child ();
button = gtk_button_new ();
priv->preview = gtk_drawing_area_new ();
......@@ -621,7 +619,5 @@ gimp_gradient_select_button_create_inside (GimpGradientSelectButton *gradient_bu
G_CALLBACK (gimp_gradient_select_drag_data_received),
gradient_button);
gtk_widget_pop_composite_child ();
return button;
}
......@@ -457,8 +457,6 @@ gimp_palette_select_button_create_inside (GimpPaletteSelectButton *palette_butto
priv = GIMP_PALETTE_SELECT_BUTTON_GET_PRIVATE (palette_button);
gtk_widget_push_composite_child ();
button = gtk_button_new ();
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
......@@ -488,7 +486,5 @@ gimp_palette_select_button_create_inside (GimpPaletteSelectButton *palette_butto
G_CALLBACK (gimp_palette_select_drag_data_received),
palette_button);
gtk_widget_pop_composite_child ();
return button;
}
......@@ -572,11 +572,10 @@ gimp_pattern_select_button_open_popup (GimpPatternSelectButton *button,
GimpPatternSelectButtonPrivate *priv;
GtkWidget *frame;
GtkWidget *preview;
GdkScreen *screen;
GdkMonitor *monitor;
GdkRectangle workarea;
gint x_org;
gint y_org;
gint scr_w;
gint scr_h;
priv = GIMP_PATTERN_SELECT_BUTTON_GET_PRIVATE (button);
......@@ -586,11 +585,10 @@ gimp_pattern_select_button_open_popup (GimpPatternSelectButton *button,
if (priv->width <= CELL_SIZE && priv->height <= CELL_SIZE)
return;
screen = gtk_widget_get_screen (GTK_WIDGET (button));
priv->popup = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_type_hint (GTK_WINDOW (priv->popup), GDK_WINDOW_TYPE_HINT_DND);
gtk_window_set_screen (GTK_WINDOW (priv->popup), screen);
gtk_window_set_screen (GTK_WINDOW (priv->popup),
gtk_widget_get_screen (GTK_WIDGET (button)));
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
......@@ -606,15 +604,14 @@ gimp_pattern_select_button_open_popup (GimpPatternSelectButton *button,
gdk_window_get_origin (gtk_widget_get_window (priv->preview),
&x_org, &y_org);
scr_w = gdk_screen_get_width (screen);
scr_h = gdk_screen_get_height (screen);
monitor = gimp_widget_get_monitor (GTK_WIDGET (button));
gdk_monitor_get_workarea (monitor, &workarea);
x = x_org + x - (priv->width / 2);
y = y_org + y - (priv->height / 2);
x = (x < 0) ? 0 : x;
y = (y < 0) ? 0 : y;
x = (x + priv->width > scr_w) ? scr_w - priv->width : x;
y = (y + priv->height > scr_h) ? scr_h - priv->height : y;
x = CLAMP (x, workarea.x, workarea.x + workarea.width - priv->width);
y = CLAMP (y, workarea.y, workarea.y + workarea.height - priv->height);
gtk_window_move (GTK_WINDOW (priv->popup), x, y);
......@@ -691,8 +688,6 @@ gimp_pattern_select_button_create_inside (GimpPatternSelectButton *pattern_butto
priv = GIMP_PATTERN_SELECT_BUTTON_GET_PRIVATE (pattern_button);
gtk_widget_push_composite_child ();
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
frame = gtk_frame_new (NULL);
......@@ -732,7 +727,5 @@ gimp_pattern_select_button_create_inside (GimpPatternSelectButton *pattern_butto
gtk_widget_show_all (hbox);
gtk_widget_pop_composite_child ();
return hbox;
}
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