app/widgets/gimpactionview.c app/widgets/gimpblobeditor.c
2008-06-28 Michael Natterer <mitch@gimp.org> * app/widgets/gimpactionview.c * app/widgets/gimpblobeditor.c * app/widgets/gimpbrushfactoryview.c * app/widgets/gimpbrushselect.c * app/widgets/gimpcellrendererdashes.c * app/widgets/gimpcellrendererviewable.c * app/widgets/gimpcolorbar.c * app/widgets/gimpcoloreditor.c * app/widgets/gimpcolorframe.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainerbox.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpcurveview.c * app/widgets/gimpdasheditor.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdock.c * app/widgets/gimpdockable.c * app/widgets/gimpdockseparator.c * app/widgets/gimpfgbgeditor.c * app/widgets/gimpfgbgview.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphandlebar.c * app/widgets/gimphistogrambox.c * app/widgets/gimphistogramview.c * app/widgets/gimpitemtreeview.c * app/widgets/gimpmenudock.c * app/widgets/gimpmessagebox.c * app/widgets/gimppaletteview.c * app/widgets/gimpscalebutton.c * app/widgets/gimpsessioninfo-book.c * app/widgets/gimpsessioninfo-dock.c * app/widgets/gimpsettingseditor.c * app/widgets/gimpstrokeeditor.c * app/widgets/gimptemplateeditor.c * app/widgets/gimptemplateview.c * app/widgets/gimpthumbbox.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimptoolview.c * app/widgets/gimpuimanager.c * app/widgets/gimpviewabledialog.c * app/widgets/gimpviewrenderervectors.c * app/widgets/gimpwidgets-utils.c: use accessors instead of accessing members of GTK+ widgets directly. svn path=/trunk/; revision=26008
This commit is contained in:

committed by
Michael Natterer

parent
6c9e6c7cf6
commit
f53ed53cdb
49
ChangeLog
49
ChangeLog
@ -1,3 +1,52 @@
|
||||
2008-06-28 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpactionview.c
|
||||
* app/widgets/gimpblobeditor.c
|
||||
* app/widgets/gimpbrushfactoryview.c
|
||||
* app/widgets/gimpbrushselect.c
|
||||
* app/widgets/gimpcellrendererdashes.c
|
||||
* app/widgets/gimpcellrendererviewable.c
|
||||
* app/widgets/gimpcolorbar.c
|
||||
* app/widgets/gimpcoloreditor.c
|
||||
* app/widgets/gimpcolorframe.c
|
||||
* app/widgets/gimpcomponenteditor.c
|
||||
* app/widgets/gimpcontainerbox.c
|
||||
* app/widgets/gimpcontainergridview.c
|
||||
* app/widgets/gimpcontainerpopup.c
|
||||
* app/widgets/gimpcontainertreeview.c
|
||||
* app/widgets/gimpcurveview.c
|
||||
* app/widgets/gimpdasheditor.c
|
||||
* app/widgets/gimpdatafactoryview.c
|
||||
* app/widgets/gimpdock.c
|
||||
* app/widgets/gimpdockable.c
|
||||
* app/widgets/gimpdockseparator.c
|
||||
* app/widgets/gimpfgbgeditor.c
|
||||
* app/widgets/gimpfgbgview.c
|
||||
* app/widgets/gimpgradienteditor.c
|
||||
* app/widgets/gimphandlebar.c
|
||||
* app/widgets/gimphistogrambox.c
|
||||
* app/widgets/gimphistogramview.c
|
||||
* app/widgets/gimpitemtreeview.c
|
||||
* app/widgets/gimpmenudock.c
|
||||
* app/widgets/gimpmessagebox.c
|
||||
* app/widgets/gimppaletteview.c
|
||||
* app/widgets/gimpscalebutton.c
|
||||
* app/widgets/gimpsessioninfo-book.c
|
||||
* app/widgets/gimpsessioninfo-dock.c
|
||||
* app/widgets/gimpsettingseditor.c
|
||||
* app/widgets/gimpstrokeeditor.c
|
||||
* app/widgets/gimptemplateeditor.c
|
||||
* app/widgets/gimptemplateview.c
|
||||
* app/widgets/gimpthumbbox.c
|
||||
* app/widgets/gimptoolbox.c
|
||||
* app/widgets/gimptooloptionseditor.c
|
||||
* app/widgets/gimptoolview.c
|
||||
* app/widgets/gimpuimanager.c
|
||||
* app/widgets/gimpviewabledialog.c
|
||||
* app/widgets/gimpviewrenderervectors.c
|
||||
* app/widgets/gimpwidgets-utils.c: use accessors instead of
|
||||
accessing members of GTK+ widgets directly.
|
||||
|
||||
2008-06-28 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* plug-ins/uri/uri-backend-gvfs.c (uri_progress_callback): fix
|
||||
|
@ -341,8 +341,10 @@ gimp_action_view_new (GimpUIManager *manager,
|
||||
gtk_tree_view_column_set_title (column, _("Shortcut"));
|
||||
|
||||
cell = gtk_cell_renderer_accel_new ();
|
||||
cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
|
||||
GTK_CELL_RENDERER_TEXT (cell)->editable = TRUE;
|
||||
g_object_set (cell,
|
||||
"mode", GTK_CELL_RENDERER_MODE_EDITABLE,
|
||||
"editable", TRUE,
|
||||
NULL);
|
||||
gtk_tree_view_column_pack_start (column, cell, TRUE);
|
||||
gtk_tree_view_column_set_attributes (column, cell,
|
||||
"accel-key",
|
||||
|
@ -188,6 +188,7 @@ gimp_blob_editor_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GimpBlobEditor *editor = GIMP_BLOB_EDITOR (widget);
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
cairo_t *cr;
|
||||
GdkRectangle rect;
|
||||
gint r0;
|
||||
@ -208,10 +209,10 @@ gimp_blob_editor_expose (GtkWidget *widget,
|
||||
|
||||
cairo_rectangle (cr,
|
||||
rect.x + 0.5, rect.y + 0.5, rect.width - 1, rect.width - 1);
|
||||
gdk_cairo_set_source_color (cr, &widget->style->light[widget->state]);
|
||||
gdk_cairo_set_source_color (cr, &style->light[widget->state]);
|
||||
cairo_fill_preserve (cr);
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->dark[widget->state]);
|
||||
gdk_cairo_set_source_color (cr, &style->dark[widget->state]);
|
||||
cairo_set_line_width (cr, 1);
|
||||
cairo_stroke (cr);
|
||||
|
||||
@ -319,6 +320,7 @@ gimp_blob_editor_draw_blob (GimpBlobEditor *editor,
|
||||
gdouble radius)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (editor);
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
Blob *blob;
|
||||
BlobFunc function = blob_ellipse;
|
||||
gint i;
|
||||
@ -373,6 +375,6 @@ gimp_blob_editor_draw_blob (GimpBlobEditor *editor,
|
||||
|
||||
g_free (blob);
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->fg[widget->state]);
|
||||
gdk_cairo_set_source_color (cr, &style->fg[widget->state]);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ gimp_brush_factory_view_new (GimpViewType view_type,
|
||||
|
||||
/* eek */
|
||||
gtk_box_pack_end (GTK_BOX (editor->view),
|
||||
factory_view->spacing_scale->parent,
|
||||
gtk_widget_get_parent (factory_view->spacing_scale),
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
factory_view->spacing_changed_handler_id =
|
||||
|
@ -168,7 +168,7 @@ gimp_brush_select_constructor (GType type,
|
||||
gtk_widget_show (dialog->view);
|
||||
|
||||
/* Create the frame and the table for the options */
|
||||
table = GIMP_BRUSH_FACTORY_VIEW (dialog->view)->spacing_scale->parent;
|
||||
table = gtk_widget_get_parent (GIMP_BRUSH_FACTORY_VIEW (dialog->view)->spacing_scale);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
|
||||
|
||||
|
@ -191,6 +191,7 @@ gimp_cell_renderer_dashes_render (GtkCellRenderer *cell,
|
||||
GtkCellRendererState flags)
|
||||
{
|
||||
GimpCellRendererDashes *dashes = GIMP_CELL_RENDERER_DASHES (cell);
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
GtkStateType state;
|
||||
cairo_t *cr;
|
||||
gint width;
|
||||
@ -240,7 +241,7 @@ gimp_cell_renderer_dashes_render (GtkCellRenderer *cell,
|
||||
}
|
||||
}
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->text[state]);
|
||||
gdk_cairo_set_source_color (cr, &style->text[state]);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
@ -123,7 +123,9 @@ gimp_cell_renderer_viewable_class_init (GimpCellRendererViewableClass *klass)
|
||||
static void
|
||||
gimp_cell_renderer_viewable_init (GimpCellRendererViewable *cellviewable)
|
||||
{
|
||||
GTK_CELL_RENDERER (cellviewable)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
|
||||
g_object_set (cellviewable,
|
||||
"mode", GTK_CELL_RENDERER_MODE_ACTIVATABLE,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -154,15 +154,15 @@ static gboolean
|
||||
gimp_color_bar_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GimpColorBar *bar = GIMP_COLOR_BAR (widget);
|
||||
GimpColorBar *bar = GIMP_COLOR_BAR (widget);
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
guchar *buf;
|
||||
guchar *b;
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
gint i, j;
|
||||
|
||||
x = GTK_CONTAINER (bar)->border_width;
|
||||
y = GTK_CONTAINER (bar)->border_width;
|
||||
x = y = gtk_container_get_border_width (GTK_CONTAINER (bar));
|
||||
|
||||
width = widget->allocation.width - 2 * x;
|
||||
height = widget->allocation.height - 2 * y;
|
||||
@ -205,7 +205,7 @@ gimp_color_bar_expose (GtkWidget *widget,
|
||||
break;
|
||||
}
|
||||
|
||||
gdk_draw_rgb_image (widget->window, widget->style->black_gc,
|
||||
gdk_draw_rgb_image (widget->window, style->black_gc,
|
||||
widget->allocation.x + x, widget->allocation.y + y,
|
||||
width, height,
|
||||
GDK_RGB_DITHER_NORMAL,
|
||||
|
@ -582,7 +582,7 @@ static void
|
||||
gimp_color_editor_tab_toggled (GtkWidget *widget,
|
||||
GimpColorEditor *editor)
|
||||
{
|
||||
if (GTK_TOGGLE_BUTTON (widget)->active)
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
|
||||
{
|
||||
GtkWidget *selector;
|
||||
|
||||
|
@ -271,13 +271,14 @@ gimp_color_frame_expose (GtkWidget *widget,
|
||||
|
||||
if (frame->has_number)
|
||||
{
|
||||
cairo_t *cr;
|
||||
gchar buf[8];
|
||||
gint w, h;
|
||||
gdouble scale;
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
cairo_t *cr;
|
||||
gchar buf[8];
|
||||
gint w, h;
|
||||
gdouble scale;
|
||||
|
||||
cr = gdk_cairo_create (widget->window);
|
||||
gdk_cairo_set_source_color (cr, &widget->style->light[GTK_STATE_NORMAL]);
|
||||
gdk_cairo_set_source_color (cr, &style->light[GTK_STATE_NORMAL]);
|
||||
|
||||
g_snprintf (buf, sizeof (buf), "%d", frame->number);
|
||||
|
||||
|
@ -286,6 +286,7 @@ gimp_component_editor_set_view_size (GimpComponentEditor *editor,
|
||||
gint view_size)
|
||||
{
|
||||
GtkWidget *tree_widget;
|
||||
GtkStyle *tree_style;
|
||||
GtkIconSize icon_size;
|
||||
GtkTreeIter iter;
|
||||
gboolean iter_valid;
|
||||
@ -295,14 +296,15 @@ gimp_component_editor_set_view_size (GimpComponentEditor *editor,
|
||||
view_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE);
|
||||
|
||||
tree_widget = GTK_WIDGET (editor->view);
|
||||
tree_style = gtk_widget_get_style (tree_widget);
|
||||
|
||||
icon_size = gimp_get_icon_size (tree_widget,
|
||||
GIMP_STOCK_VISIBLE,
|
||||
GTK_ICON_SIZE_BUTTON,
|
||||
view_size -
|
||||
2 * tree_widget->style->xthickness,
|
||||
2 * tree_style->xthickness,
|
||||
view_size -
|
||||
2 * tree_widget->style->ythickness);
|
||||
2 * tree_style->ythickness);
|
||||
|
||||
g_object_set (editor->eye_cell,
|
||||
"stock-size", icon_size,
|
||||
|
@ -106,6 +106,7 @@ gimp_container_box_set_size_request (GimpContainerBox *box,
|
||||
{
|
||||
GimpContainerView *view;
|
||||
GtkScrolledWindowClass *sw_class;
|
||||
GtkStyle *sw_style;
|
||||
GtkRequisition req;
|
||||
gint view_size;
|
||||
gint scrollbar_width;
|
||||
@ -134,11 +135,12 @@ gimp_container_box_set_size_request (GimpContainerBox *box,
|
||||
&req);
|
||||
scrollbar_width += req.width;
|
||||
|
||||
border_x = GTK_CONTAINER (box)->border_width;
|
||||
border_y = GTK_CONTAINER (box)->border_width;
|
||||
border_x = border_y = gtk_container_get_border_width (GTK_CONTAINER (box));
|
||||
|
||||
border_x += box->scrolled_win->style->xthickness * 2 + scrollbar_width;
|
||||
border_y += box->scrolled_win->style->ythickness * 2;
|
||||
sw_style = gtk_widget_get_style (box->scrolled_win);
|
||||
|
||||
border_x += sw_style->xthickness * 2 + scrollbar_width;
|
||||
border_y += sw_style->ythickness * 2;
|
||||
|
||||
gtk_widget_set_size_request (box->scrolled_win,
|
||||
width > 0 ? width + border_x : -1,
|
||||
|
@ -179,6 +179,7 @@ static void
|
||||
gimp_container_grid_view_init (GimpContainerGridView *grid_view)
|
||||
{
|
||||
GimpContainerBox *box = GIMP_CONTAINER_BOX (grid_view);
|
||||
GtkWidget *viewport;
|
||||
|
||||
grid_view->rows = 1;
|
||||
grid_view->columns = 1;
|
||||
@ -195,14 +196,14 @@ gimp_container_grid_view_init (GimpContainerGridView *grid_view)
|
||||
grid_view->wrap_box = gtk_hwrap_box_new (FALSE);
|
||||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (box->scrolled_win),
|
||||
grid_view->wrap_box);
|
||||
gtk_viewport_set_shadow_type (GTK_VIEWPORT (grid_view->wrap_box->parent),
|
||||
GTK_SHADOW_NONE);
|
||||
viewport = gtk_widget_get_parent (grid_view->wrap_box);
|
||||
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
|
||||
gtk_widget_show (grid_view->wrap_box);
|
||||
|
||||
g_signal_connect (grid_view->wrap_box->parent, "size-allocate",
|
||||
g_signal_connect (viewport, "size-allocate",
|
||||
G_CALLBACK (gimp_container_grid_view_viewport_resized),
|
||||
grid_view);
|
||||
g_signal_connect (grid_view->wrap_box->parent, "button-press-event",
|
||||
g_signal_connect (viewport, "button-press-event",
|
||||
G_CALLBACK (gimp_container_grid_view_button_press),
|
||||
grid_view);
|
||||
|
||||
@ -374,8 +375,10 @@ gimp_container_grid_view_menu_position (GtkMenu *menu,
|
||||
}
|
||||
else
|
||||
{
|
||||
*x += widget->style->xthickness;
|
||||
*y += widget->style->ythickness;
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
|
||||
*x += style->xthickness;
|
||||
*y += style->ythickness;
|
||||
}
|
||||
|
||||
gimp_menu_position (menu, x, y);
|
||||
|
@ -588,7 +588,7 @@ static void
|
||||
gimp_container_popup_view_type_toggled (GtkWidget *button,
|
||||
GimpContainerPopup *popup)
|
||||
{
|
||||
if (GTK_TOGGLE_BUTTON (button)->active)
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
|
||||
{
|
||||
GimpViewType view_type;
|
||||
|
||||
|
@ -350,8 +350,10 @@ gimp_container_tree_view_menu_position (GtkMenu *menu,
|
||||
}
|
||||
else
|
||||
{
|
||||
*x += widget->style->xthickness;
|
||||
*y += widget->style->ythickness;
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
|
||||
*x += style->xthickness;
|
||||
*y += style->ythickness;
|
||||
}
|
||||
|
||||
gimp_menu_position (menu, x, y);
|
||||
@ -761,13 +763,15 @@ gimp_container_tree_view_set_view_size (GimpContainerView *view)
|
||||
|
||||
if (stock_id)
|
||||
{
|
||||
GtkStyle *style = gtk_widget_get_style (tree_widget);
|
||||
|
||||
icon_size = gimp_get_icon_size (tree_widget,
|
||||
stock_id,
|
||||
GTK_ICON_SIZE_BUTTON,
|
||||
view_size -
|
||||
2 * tree_widget->style->xthickness,
|
||||
2 * style->xthickness,
|
||||
view_size -
|
||||
2 * tree_widget->style->ythickness);
|
||||
2 * style->ythickness);
|
||||
|
||||
g_object_set (list->data, "stock-size", icon_size, NULL);
|
||||
|
||||
|
@ -339,7 +339,7 @@ gimp_curve_view_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GimpCurveView *view = GIMP_CURVE_VIEW (widget);
|
||||
GtkStyle *style = widget->style;
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
cairo_t *cr;
|
||||
gint border;
|
||||
gint width;
|
||||
|
@ -238,6 +238,7 @@ gimp_dash_editor_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GimpDashEditor *editor = GIMP_DASH_EDITOR (widget);
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
cairo_t *cr = gdk_cairo_create (widget->window);
|
||||
gint x;
|
||||
gint w, h;
|
||||
@ -249,7 +250,7 @@ gimp_dash_editor_expose (GtkWidget *widget,
|
||||
|
||||
/* draw the background */
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->base[GTK_STATE_NORMAL]);
|
||||
gdk_cairo_set_source_color (cr, &style->base[GTK_STATE_NORMAL]);
|
||||
cairo_paint (cr);
|
||||
|
||||
w = editor->block_width;
|
||||
@ -273,7 +274,7 @@ gimp_dash_editor_expose (GtkWidget *widget,
|
||||
cairo_rectangle (cr, x, editor->y0, w, h);
|
||||
}
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->text_aa[GTK_STATE_NORMAL]);
|
||||
gdk_cairo_set_source_color (cr, &style->text_aa[GTK_STATE_NORMAL]);
|
||||
cairo_fill (cr);
|
||||
|
||||
for (; x < editor->x0 + editor->n_segments * w; x += w)
|
||||
@ -284,7 +285,7 @@ gimp_dash_editor_expose (GtkWidget *widget,
|
||||
cairo_rectangle (cr, x, editor->y0, w, h);
|
||||
}
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->text[GTK_STATE_NORMAL]);
|
||||
gdk_cairo_set_source_color (cr, &style->text[GTK_STATE_NORMAL]);
|
||||
cairo_fill (cr);
|
||||
|
||||
for (; x < widget->allocation.width + w; x += w)
|
||||
@ -295,7 +296,7 @@ gimp_dash_editor_expose (GtkWidget *widget,
|
||||
cairo_rectangle (cr, x, editor->y0, w, h);
|
||||
}
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->text_aa[GTK_STATE_NORMAL]);
|
||||
gdk_cairo_set_source_color (cr, &style->text_aa[GTK_STATE_NORMAL]);
|
||||
cairo_fill (cr);
|
||||
|
||||
/* draw rulers */
|
||||
@ -330,7 +331,7 @@ gimp_dash_editor_expose (GtkWidget *widget,
|
||||
cairo_move_to (cr, editor->x0 - 0.5, editor->y0 - 1);
|
||||
cairo_move_to (cr, editor->x0 - 0.5, editor->y0 + h);
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->text_aa[GTK_STATE_NORMAL]);
|
||||
gdk_cairo_set_source_color (cr, &style->text_aa[GTK_STATE_NORMAL]);
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
cairo_stroke (cr);
|
||||
|
||||
|
@ -158,8 +158,10 @@ gimp_data_factory_view_construct (GimpDataFactoryView *factory_view,
|
||||
|
||||
tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
|
||||
|
||||
tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
|
||||
GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
|
||||
g_object_set (tree_view->name_cell,
|
||||
"mode", GTK_CELL_RENDERER_MODE_EDITABLE,
|
||||
"editable", TRUE,
|
||||
NULL);
|
||||
|
||||
tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
|
||||
tree_view->name_cell);
|
||||
|
@ -465,13 +465,13 @@ gimp_dock_add_book (GimpDock *dock,
|
||||
else
|
||||
old_book = g_list_nth_data (dock->dockbooks, index - 1);
|
||||
|
||||
parent = old_book->parent;
|
||||
parent = gtk_widget_get_parent (old_book);
|
||||
|
||||
if ((old_length > 1) && (index > 0))
|
||||
{
|
||||
GtkWidget *grandparent;
|
||||
|
||||
grandparent = parent->parent;
|
||||
grandparent = gtk_widget_get_parent (parent);
|
||||
|
||||
old_book = parent;
|
||||
parent = grandparent;
|
||||
@ -553,8 +553,8 @@ gimp_dock_remove_book (GimpDock *dock,
|
||||
GtkWidget *parent;
|
||||
GtkWidget *grandparent;
|
||||
|
||||
parent = GTK_WIDGET (dockbook)->parent;
|
||||
grandparent = parent->parent;
|
||||
parent = gtk_widget_get_parent (GTK_WIDGET (dockbook));
|
||||
grandparent = gtk_widget_get_parent (parent);
|
||||
|
||||
if (index == 0)
|
||||
other_book = gtk_paned_get_child2 (GTK_PANED (parent));
|
||||
|
@ -312,9 +312,12 @@ gimp_dockable_size_request (GtkWidget *widget,
|
||||
GimpDockable *dockable = GIMP_DOCKABLE (widget);
|
||||
GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
|
||||
GtkRequisition child_requisition;
|
||||
gint border_width;
|
||||
|
||||
requisition->width = container->border_width * 2;
|
||||
requisition->height = container->border_width * 2;
|
||||
border_width = gtk_container_get_border_width (container);
|
||||
|
||||
requisition->width = border_width * 2;
|
||||
requisition->height = border_width * 2;
|
||||
|
||||
if (dockable->menu_button && GTK_WIDGET_VISIBLE (dockable->menu_button))
|
||||
{
|
||||
@ -345,9 +348,12 @@ gimp_dockable_size_allocate (GtkWidget *widget,
|
||||
|
||||
GtkRequisition button_requisition = { 0, };
|
||||
GtkAllocation child_allocation;
|
||||
gint border_width;
|
||||
|
||||
widget->allocation = *allocation;
|
||||
|
||||
border_width = gtk_container_get_border_width (container);
|
||||
|
||||
if (dockable->menu_button && GTK_WIDGET_VISIBLE (dockable->menu_button))
|
||||
{
|
||||
gtk_widget_size_request (dockable->menu_button, &button_requisition);
|
||||
@ -355,12 +361,12 @@ gimp_dockable_size_allocate (GtkWidget *widget,
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
|
||||
child_allocation.x = (allocation->x +
|
||||
allocation->width -
|
||||
container->border_width -
|
||||
border_width -
|
||||
button_requisition.width);
|
||||
else
|
||||
child_allocation.x = allocation->x + container->border_width;
|
||||
child_allocation.x = allocation->x + border_width;
|
||||
|
||||
child_allocation.y = allocation->y + container->border_width;
|
||||
child_allocation.y = allocation->y + border_width;
|
||||
child_allocation.width = button_requisition.width;
|
||||
child_allocation.height = button_requisition.height;
|
||||
|
||||
@ -369,13 +375,13 @@ gimp_dockable_size_allocate (GtkWidget *widget,
|
||||
|
||||
if (child && GTK_WIDGET_VISIBLE (child))
|
||||
{
|
||||
child_allocation.x = allocation->x + container->border_width;
|
||||
child_allocation.y = allocation->y + container->border_width;
|
||||
child_allocation.x = allocation->x + border_width;
|
||||
child_allocation.y = allocation->y + border_width;
|
||||
child_allocation.width = MAX (allocation->width -
|
||||
container->border_width * 2,
|
||||
border_width * 2,
|
||||
0);
|
||||
child_allocation.height = MAX (allocation->height -
|
||||
container->border_width * 2 -
|
||||
border_width * 2 -
|
||||
button_requisition.height,
|
||||
0);
|
||||
|
||||
@ -541,6 +547,7 @@ gimp_dockable_expose_event (GtkWidget *widget,
|
||||
if (GTK_WIDGET_DRAWABLE (widget))
|
||||
{
|
||||
GimpDockable *dockable = GIMP_DOCKABLE (widget);
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
GdkRectangle title_area;
|
||||
GdkRectangle expose_area;
|
||||
|
||||
@ -555,7 +562,7 @@ gimp_dockable_expose_event (GtkWidget *widget,
|
||||
|
||||
if (dockable->blink_counter & 1)
|
||||
{
|
||||
gtk_paint_box (widget->style, widget->window,
|
||||
gtk_paint_box (style, widget->window,
|
||||
GTK_STATE_SELECTED, GTK_SHADOW_NONE,
|
||||
&expose_area, widget, "",
|
||||
title_area.x, title_area.y,
|
||||
@ -583,7 +590,7 @@ gimp_dockable_expose_event (GtkWidget *widget,
|
||||
|
||||
text_y = title_area.y + (title_area.height - layout_height) / 2;
|
||||
|
||||
gtk_paint_layout (widget->style, widget->window,
|
||||
gtk_paint_layout (style, widget->window,
|
||||
(dockable->blink_counter & 1) ?
|
||||
GTK_STATE_SELECTED : widget->state, TRUE,
|
||||
&expose_area, widget, NULL,
|
||||
@ -1062,7 +1069,7 @@ gimp_dockable_get_title_area (GimpDockable *dockable,
|
||||
GdkRectangle *area)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (dockable);
|
||||
gint border = GTK_CONTAINER (dockable)->border_width;
|
||||
gint border = gtk_container_get_border_width (GTK_CONTAINER (dockable));
|
||||
|
||||
area->x = widget->allocation.x + border;
|
||||
area->y = widget->allocation.y + border;
|
||||
|
@ -196,13 +196,16 @@ gimp_dock_separator_drag_drop (GtkWidget *widget,
|
||||
if (dockable)
|
||||
{
|
||||
GtkWidget *dockbook;
|
||||
GtkWidget *parent;
|
||||
GList *children;
|
||||
gint index;
|
||||
|
||||
g_object_set_data (G_OBJECT (dockable),
|
||||
"gimp-dock-drag-widget", NULL);
|
||||
|
||||
children = gtk_container_get_children (GTK_CONTAINER (widget->parent));
|
||||
parent = gtk_widget_get_parent (widget);
|
||||
|
||||
children = gtk_container_get_children (GTK_CONTAINER (parent));
|
||||
index = g_list_index (children, widget);
|
||||
g_list_free (children);
|
||||
|
||||
|
@ -286,6 +286,7 @@ gimp_fg_bg_editor_expose (GtkWidget *widget,
|
||||
GdkEventExpose *eevent)
|
||||
{
|
||||
GimpFgBgEditor *editor = GIMP_FG_BG_EDITOR (widget);
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
gint width, height;
|
||||
gint default_w, default_h;
|
||||
gint swap_w, swap_h;
|
||||
@ -348,14 +349,14 @@ gimp_fg_bg_editor_expose (GtkWidget *widget,
|
||||
gimp_context_get_background (editor->context, &color);
|
||||
gimp_fg_bg_editor_draw_rect (editor,
|
||||
widget->window,
|
||||
widget->style->fg_gc[0],
|
||||
style->fg_gc[0],
|
||||
(width - rect_w),
|
||||
(height - rect_h),
|
||||
rect_w, rect_h,
|
||||
&color);
|
||||
}
|
||||
|
||||
gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
|
||||
gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
|
||||
editor->active_color == GIMP_ACTIVE_COLOR_FOREGROUND ?
|
||||
GTK_SHADOW_OUT : GTK_SHADOW_IN,
|
||||
NULL, widget, NULL,
|
||||
@ -371,13 +372,13 @@ gimp_fg_bg_editor_expose (GtkWidget *widget,
|
||||
gimp_context_get_foreground (editor->context, &color);
|
||||
gimp_fg_bg_editor_draw_rect (editor,
|
||||
widget->window,
|
||||
widget->style->fg_gc[0],
|
||||
style->fg_gc[0],
|
||||
0, 0,
|
||||
rect_w, rect_h,
|
||||
&color);
|
||||
}
|
||||
|
||||
gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
|
||||
gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
|
||||
editor->active_color == GIMP_ACTIVE_COLOR_BACKGROUND ?
|
||||
GTK_SHADOW_OUT : GTK_SHADOW_IN,
|
||||
NULL, widget, NULL,
|
||||
|
@ -206,7 +206,8 @@ static gboolean
|
||||
gimp_fg_bg_view_expose (GtkWidget *widget,
|
||||
GdkEventExpose *eevent)
|
||||
{
|
||||
GimpFgBgView *view = GIMP_FG_BG_VIEW (widget);
|
||||
GimpFgBgView *view = GIMP_FG_BG_VIEW (widget);
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
gint rect_w, rect_h;
|
||||
@ -230,14 +231,14 @@ gimp_fg_bg_view_expose (GtkWidget *widget,
|
||||
gimp_context_get_background (view->context, &color);
|
||||
gimp_fg_bg_view_draw_rect (view,
|
||||
widget->window,
|
||||
widget->style->fg_gc[0],
|
||||
style->fg_gc[0],
|
||||
x + width - rect_w + 1,
|
||||
y + height - rect_h + 1,
|
||||
rect_w - 2, rect_h - 2,
|
||||
&color);
|
||||
}
|
||||
|
||||
gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
|
||||
gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_IN,
|
||||
NULL, widget, NULL,
|
||||
x + width - rect_w, y + height - rect_h, rect_w, rect_h);
|
||||
@ -249,13 +250,13 @@ gimp_fg_bg_view_expose (GtkWidget *widget,
|
||||
gimp_context_get_foreground (view->context, &color);
|
||||
gimp_fg_bg_view_draw_rect (view,
|
||||
widget->window,
|
||||
widget->style->fg_gc[0],
|
||||
style->fg_gc[0],
|
||||
x + 1, y + 1,
|
||||
rect_w - 2, rect_h - 2,
|
||||
&color);
|
||||
}
|
||||
|
||||
gtk_paint_shadow (widget->style, widget->window, GTK_STATE_NORMAL,
|
||||
gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
|
||||
GTK_SHADOW_OUT,
|
||||
NULL, widget, NULL,
|
||||
x, y, rect_w, rect_h);
|
||||
|
@ -798,7 +798,7 @@ static void
|
||||
gradient_editor_instant_update_update (GtkWidget *widget,
|
||||
GimpGradientEditor *editor)
|
||||
{
|
||||
if (GTK_TOGGLE_BUTTON (widget)->active)
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
|
||||
{
|
||||
editor->instant_update = TRUE;
|
||||
gtk_range_set_update_policy (GTK_RANGE (editor->scrollbar),
|
||||
@ -1746,6 +1746,7 @@ control_draw (GimpGradientEditor *editor,
|
||||
gdouble left,
|
||||
gdouble right)
|
||||
{
|
||||
GtkStyle *control_style;
|
||||
GimpGradientSegment *seg;
|
||||
GradientEditorDragMode handle;
|
||||
gint sel_l;
|
||||
@ -1758,16 +1759,18 @@ control_draw (GimpGradientEditor *editor,
|
||||
|
||||
/* Draw selection */
|
||||
|
||||
control_style = gtk_widget_get_style (editor->control);
|
||||
|
||||
sel_l = control_calc_p_pos (editor, editor->control_sel_l->left);
|
||||
sel_r = control_calc_p_pos (editor, editor->control_sel_r->right);
|
||||
|
||||
gdk_cairo_set_source_color (cr,
|
||||
&editor->control->style->base[GTK_STATE_NORMAL]);
|
||||
&control_style->base[GTK_STATE_NORMAL]);
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_fill (cr);
|
||||
|
||||
gdk_cairo_set_source_color (cr,
|
||||
&editor->control->style->base[GTK_STATE_SELECTED]);
|
||||
&control_style->base[GTK_STATE_SELECTED]);
|
||||
cairo_rectangle (cr, sel_l, 0, sel_r - sel_l + 1, height);
|
||||
cairo_fill (cr);
|
||||
|
||||
@ -1835,11 +1838,12 @@ control_draw_normal_handle (GimpGradientEditor *editor,
|
||||
gint height,
|
||||
gboolean selected)
|
||||
{
|
||||
GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
|
||||
GtkStyle *style = gtk_widget_get_style (editor->control);
|
||||
GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
|
||||
|
||||
control_draw_handle (cr,
|
||||
&editor->control->style->text_aa[state],
|
||||
&editor->control->style->black,
|
||||
&style->text_aa[state],
|
||||
&style->black,
|
||||
control_calc_p_pos (editor, pos), height);
|
||||
}
|
||||
|
||||
@ -1850,11 +1854,12 @@ control_draw_middle_handle (GimpGradientEditor *editor,
|
||||
gint height,
|
||||
gboolean selected)
|
||||
{
|
||||
GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
|
||||
GtkStyle *style = gtk_widget_get_style (editor->control);
|
||||
GtkStateType state = selected ? GTK_STATE_SELECTED : GTK_STATE_NORMAL;
|
||||
|
||||
control_draw_handle (cr,
|
||||
&editor->control->style->text_aa[state],
|
||||
&editor->control->style->white,
|
||||
&style->text_aa[state],
|
||||
&style->white,
|
||||
control_calc_p_pos (editor, pos), height);
|
||||
}
|
||||
|
||||
|
@ -151,8 +151,7 @@ gimp_handle_bar_expose (GtkWidget *widget,
|
||||
gint width, height;
|
||||
gint i;
|
||||
|
||||
x = GTK_CONTAINER (widget)->border_width;
|
||||
y = GTK_CONTAINER (widget)->border_width;
|
||||
x = y = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||
|
||||
width = widget->allocation.width - 2 * x;
|
||||
height = widget->allocation.height - 2 * y;
|
||||
@ -214,7 +213,7 @@ gimp_handle_bar_button_press (GtkWidget *widget,
|
||||
GdkEventButton *bevent)
|
||||
{
|
||||
GimpHandleBar *bar = GIMP_HANDLE_BAR (widget);
|
||||
gint border = GTK_CONTAINER (widget)->border_width;
|
||||
gint border = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||
gint width = widget->allocation.width - 2 * border;
|
||||
gdouble value;
|
||||
gint min_dist;
|
||||
@ -258,7 +257,7 @@ gimp_handle_bar_motion_notify (GtkWidget *widget,
|
||||
GdkEventMotion *mevent)
|
||||
{
|
||||
GimpHandleBar *bar = GIMP_HANDLE_BAR (widget);
|
||||
gint border = GTK_CONTAINER (widget)->border_width;
|
||||
gint border = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||
gint width = widget->allocation.width - 2 * border;
|
||||
gdouble value;
|
||||
|
||||
|
@ -245,8 +245,9 @@ gimp_histogram_box_border_notify (GimpHistogramView *view,
|
||||
GParamSpec *pspec,
|
||||
GimpHistogramBox *box)
|
||||
{
|
||||
gtk_container_set_border_width (GTK_CONTAINER (box->color_bar->parent),
|
||||
view->border_width);
|
||||
GtkWidget *vbox = gtk_widget_get_parent (box->color_bar);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox), view->border_width);
|
||||
}
|
||||
|
||||
|
||||
|
@ -279,7 +279,8 @@ static gboolean
|
||||
gimp_histogram_view_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event)
|
||||
{
|
||||
GimpHistogramView *view = GIMP_HISTOGRAM_VIEW (widget);
|
||||
GimpHistogramView *view = GIMP_HISTOGRAM_VIEW (widget);
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
gint x;
|
||||
gint x1, x2;
|
||||
gint border;
|
||||
@ -304,14 +305,14 @@ gimp_histogram_view_expose (GtkWidget *widget,
|
||||
x2 = CLAMP (MAX (view->start, view->end), 0, 255);
|
||||
|
||||
gdk_draw_rectangle (widget->window,
|
||||
widget->style->base_gc[GTK_STATE_NORMAL], TRUE,
|
||||
style->base_gc[GTK_STATE_NORMAL], TRUE,
|
||||
0, 0,
|
||||
widget->allocation.width,
|
||||
widget->allocation.height);
|
||||
|
||||
/* Draw the outer border */
|
||||
gdk_draw_rectangle (widget->window,
|
||||
widget->style->dark_gc[GTK_STATE_NORMAL], FALSE,
|
||||
style->dark_gc[GTK_STATE_NORMAL], FALSE,
|
||||
border, border,
|
||||
width - 1, height - 1);
|
||||
|
||||
@ -323,11 +324,11 @@ gimp_histogram_view_expose (GtkWidget *widget,
|
||||
bg_max = gimp_histogram_view_get_maximum (view, view->bg_histogram,
|
||||
view->channel);
|
||||
|
||||
gc_in = widget->style->text_gc[GTK_STATE_SELECTED];
|
||||
gc_out = widget->style->text_gc[GTK_STATE_NORMAL];
|
||||
gc_in = style->text_gc[GTK_STATE_SELECTED];
|
||||
gc_out = style->text_gc[GTK_STATE_NORMAL];
|
||||
|
||||
bg_gc_in = widget->style->mid_gc[GTK_STATE_SELECTED];
|
||||
bg_gc_out = widget->style->mid_gc[GTK_STATE_NORMAL];
|
||||
bg_gc_in = style->mid_gc[GTK_STATE_SELECTED];
|
||||
bg_gc_out = style->mid_gc[GTK_STATE_NORMAL];
|
||||
|
||||
if (view->channel == GIMP_HISTOGRAM_RGB)
|
||||
{
|
||||
@ -369,7 +370,7 @@ gimp_histogram_view_expose (GtkWidget *widget,
|
||||
if (view->subdivisions > 1 && x >= (xstop * width / view->subdivisions))
|
||||
{
|
||||
gdk_draw_line (widget->window,
|
||||
widget->style->dark_gc[GTK_STATE_NORMAL],
|
||||
style->dark_gc[GTK_STATE_NORMAL],
|
||||
x + border, border,
|
||||
x + border, border + height - 1);
|
||||
xstop++;
|
||||
@ -377,7 +378,7 @@ gimp_histogram_view_expose (GtkWidget *widget,
|
||||
else if (in_selection)
|
||||
{
|
||||
gdk_draw_line (widget->window,
|
||||
widget->style->base_gc[GTK_STATE_SELECTED],
|
||||
style->base_gc[GTK_STATE_SELECTED],
|
||||
x + border, border,
|
||||
x + border, border + height - 1);
|
||||
}
|
||||
@ -388,7 +389,7 @@ gimp_histogram_view_expose (GtkWidget *widget,
|
||||
|
||||
for (c = 0; c < 3; c++)
|
||||
gimp_histogram_view_draw_spike (view, GIMP_HISTOGRAM_RED + c,
|
||||
widget->style->black_gc,
|
||||
style->black_gc,
|
||||
NULL,
|
||||
x, i, j, max, bg_max, height, border);
|
||||
|
||||
|
@ -283,8 +283,10 @@ gimp_item_tree_view_constructor (GType type,
|
||||
item_view = GIMP_ITEM_TREE_VIEW (object);
|
||||
item_view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (object);
|
||||
|
||||
tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
|
||||
GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
|
||||
g_object_set (tree_view->name_cell,
|
||||
"mode", GTK_CELL_RENDERER_MODE_EDITABLE,
|
||||
"editable", TRUE,
|
||||
NULL);
|
||||
|
||||
tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
|
||||
tree_view->name_cell);
|
||||
|
@ -201,12 +201,13 @@ gimp_menu_dock_destroy (GtkObject *object)
|
||||
/* remove the image menu and the auto button manually here because
|
||||
* of weird cross-connections with GimpDock's context
|
||||
*/
|
||||
if (GIMP_DOCK (dock)->main_vbox &&
|
||||
dock->image_combo &&
|
||||
dock->image_combo->parent)
|
||||
if (GIMP_DOCK (dock)->main_vbox && dock->image_combo)
|
||||
{
|
||||
gtk_container_remove (GTK_CONTAINER (GIMP_DOCK (dock)->main_vbox),
|
||||
dock->image_combo->parent);
|
||||
GtkWidget *parent = gtk_widget_get_parent (dock->image_combo);
|
||||
|
||||
if (parent)
|
||||
gtk_container_remove (GTK_CONTAINER (GIMP_DOCK (dock)->main_vbox),
|
||||
parent);
|
||||
}
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
@ -217,6 +218,7 @@ gimp_menu_dock_style_set (GtkWidget *widget,
|
||||
GtkStyle *prev_style)
|
||||
{
|
||||
GimpMenuDock *menu_dock = GIMP_MENU_DOCK (widget);
|
||||
GtkStyle *button_style;
|
||||
gint minimal_width;
|
||||
GtkIconSize menu_view_size;
|
||||
GtkSettings *settings;
|
||||
@ -244,7 +246,8 @@ gimp_menu_dock_style_set (GtkWidget *widget,
|
||||
"focus-padding", &focus_padding,
|
||||
NULL);
|
||||
|
||||
ythickness = menu_dock->auto_button->style->ythickness;
|
||||
button_style = gtk_widget_get_style (widget);
|
||||
ythickness = button_style->ythickness;
|
||||
|
||||
gtk_widget_set_size_request (widget, minimal_width, -1);
|
||||
|
||||
@ -452,12 +455,16 @@ void
|
||||
gimp_menu_dock_set_show_image_menu (GimpMenuDock *menu_dock,
|
||||
gboolean show)
|
||||
{
|
||||
GtkWidget *parent;
|
||||
|
||||
g_return_if_fail (GIMP_IS_MENU_DOCK (menu_dock));
|
||||
|
||||
parent = gtk_widget_get_parent (menu_dock->image_combo);
|
||||
|
||||
if (show)
|
||||
gtk_widget_show (menu_dock->image_combo->parent);
|
||||
gtk_widget_show (parent);
|
||||
else
|
||||
gtk_widget_hide (menu_dock->image_combo->parent);
|
||||
gtk_widget_hide (parent);
|
||||
|
||||
menu_dock->show_image_menu = show ? TRUE : FALSE;
|
||||
}
|
||||
|
@ -243,13 +243,16 @@ gimp_message_box_size_request (GtkWidget *widget,
|
||||
if (box->image && GTK_WIDGET_VISIBLE (box->image))
|
||||
{
|
||||
GtkRequisition child_requisition;
|
||||
gint border_width;
|
||||
|
||||
gtk_widget_size_request (box->image, &child_requisition);
|
||||
|
||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||
|
||||
requisition->width += child_requisition.width + GIMP_MESSAGE_BOX_SPACING;
|
||||
requisition->height = MAX (requisition->height,
|
||||
child_requisition.height +
|
||||
2 * GTK_CONTAINER (widget)->border_width);
|
||||
2 * border_width);
|
||||
}
|
||||
}
|
||||
|
||||
@ -268,25 +271,28 @@ gimp_message_box_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
GtkRequisition child_requisition;
|
||||
GtkAllocation child_allocation;
|
||||
gint border_width;
|
||||
gint height;
|
||||
|
||||
gtk_widget_size_request (box->image, &child_requisition);
|
||||
|
||||
width = MIN (allocation->width - 2 * container->border_width,
|
||||
border_width = gtk_container_get_border_width (container);
|
||||
|
||||
width = MIN (allocation->width - 2 * border_width,
|
||||
child_requisition.width + GIMP_MESSAGE_BOX_SPACING);
|
||||
width = MAX (1, width);
|
||||
|
||||
height = allocation->height - 2 * container->border_width;
|
||||
height = allocation->height - 2 * border_width;
|
||||
height = MAX (1, height);
|
||||
|
||||
if (rtl)
|
||||
child_allocation.x = (allocation->width -
|
||||
container->border_width -
|
||||
child_allocation.x = (allocation->width -
|
||||
border_width -
|
||||
child_requisition.width);
|
||||
else
|
||||
child_allocation.x = allocation->x + container->border_width;
|
||||
child_allocation.x = allocation->x + border_width;
|
||||
|
||||
child_allocation.y = allocation->y + container->border_width;
|
||||
child_allocation.y = allocation->y + border_width;
|
||||
child_allocation.width = width;
|
||||
child_allocation.height = height;
|
||||
|
||||
|
@ -174,6 +174,7 @@ gimp_palette_view_expose (GtkWidget *widget,
|
||||
if (view->renderer->viewable && pal_view->selected)
|
||||
{
|
||||
GimpViewRendererPalette *renderer;
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
cairo_t *cr;
|
||||
gint row, col;
|
||||
|
||||
@ -193,12 +194,12 @@ gimp_palette_view_expose (GtkWidget *widget,
|
||||
renderer->cell_height);
|
||||
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_SELECTED]);
|
||||
gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_SELECTED]);
|
||||
cairo_stroke_preserve (cr);
|
||||
|
||||
if (gimp_cairo_set_focus_line_pattern (cr, widget))
|
||||
{
|
||||
gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_NORMAL]);
|
||||
gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_NORMAL]);
|
||||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
|
@ -105,6 +105,7 @@ gimp_scale_button_image_expose (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
GimpScaleButton *button)
|
||||
{
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
GtkAdjustment *adj;
|
||||
cairo_t *cr;
|
||||
gint value;
|
||||
@ -149,7 +150,7 @@ gimp_scale_button_image_expose (GtkWidget *widget,
|
||||
cairo_line_to (cr, i, i + 0.5);
|
||||
}
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->fg[widget->state]);
|
||||
gdk_cairo_set_source_color (cr, &style->fg[widget->state]);
|
||||
cairo_stroke (cr);
|
||||
|
||||
for ( ; i < steps; i++)
|
||||
@ -158,7 +159,7 @@ gimp_scale_button_image_expose (GtkWidget *widget,
|
||||
cairo_line_to (cr, i, i + 0.5);
|
||||
}
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->fg[GTK_STATE_INSENSITIVE]);
|
||||
gdk_cairo_set_source_color (cr, &style->fg[GTK_STATE_INSENSITIVE]);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
|
@ -194,6 +194,7 @@ GimpSessionInfoBook *
|
||||
gimp_session_info_book_from_widget (GimpDockbook *dockbook)
|
||||
{
|
||||
GimpSessionInfoBook *info;
|
||||
GtkWidget *parent;
|
||||
GList *children;
|
||||
GList *list;
|
||||
|
||||
@ -201,9 +202,11 @@ gimp_session_info_book_from_widget (GimpDockbook *dockbook)
|
||||
|
||||
info = gimp_session_info_book_new ();
|
||||
|
||||
if (GTK_IS_VPANED (GTK_WIDGET (dockbook)->parent))
|
||||
parent = gtk_widget_get_parent (GTK_WIDGET (dockbook));
|
||||
|
||||
if (GTK_IS_VPANED (parent))
|
||||
{
|
||||
GtkPaned *paned = GTK_PANED (GTK_WIDGET (dockbook)->parent);
|
||||
GtkPaned *paned = GTK_PANED (parent);
|
||||
|
||||
if (GTK_WIDGET (dockbook) == gtk_paned_get_child2 (paned))
|
||||
info->position = gtk_paned_get_position (paned);
|
||||
|
@ -191,12 +191,15 @@ gimp_session_info_dock_restore (GimpSessionInfo *info,
|
||||
{
|
||||
GimpSessionInfoBook *book_info = books->data;
|
||||
GtkWidget *dockbook;
|
||||
GtkWidget *parent;
|
||||
|
||||
dockbook = GTK_WIDGET (gimp_session_info_book_restore (book_info, dock));
|
||||
|
||||
if (GTK_IS_VPANED (dockbook->parent))
|
||||
parent = gtk_widget_get_parent (dockbook);
|
||||
|
||||
if (GTK_IS_VPANED (parent))
|
||||
{
|
||||
GtkPaned *paned = GTK_PANED (dockbook->parent);
|
||||
GtkPaned *paned = GTK_PANED (parent);
|
||||
|
||||
if (dockbook == gtk_paned_get_child2 (paned))
|
||||
g_signal_connect_after (paned, "map",
|
||||
|
@ -164,8 +164,10 @@ gimp_settings_editor_constructor (GType type,
|
||||
G_CALLBACK (gimp_settings_editor_select_item),
|
||||
editor);
|
||||
|
||||
tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
|
||||
GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
|
||||
g_object_set (tree_view->name_cell,
|
||||
"mode", GTK_CELL_RENDERER_MODE_EDITABLE,
|
||||
"editable", TRUE,
|
||||
NULL);
|
||||
|
||||
tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
|
||||
tree_view->name_cell);
|
||||
|
@ -360,10 +360,11 @@ gimp_stroke_editor_paint_button (GtkWidget *widget,
|
||||
GdkEventExpose *event,
|
||||
gpointer data)
|
||||
{
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
GtkAllocation *alloc = &widget->allocation;
|
||||
gint w = MIN (alloc->width, alloc->height) * 2 / 3;
|
||||
|
||||
gtk_paint_arrow (widget->style, widget->window,
|
||||
gtk_paint_arrow (style, widget->window,
|
||||
widget->state, GTK_SHADOW_IN,
|
||||
&event->area, widget, NULL,
|
||||
data ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, TRUE,
|
||||
|
@ -572,7 +572,8 @@ static void
|
||||
gimp_template_editor_aspect_callback (GtkWidget *widget,
|
||||
GimpTemplateEditor *editor)
|
||||
{
|
||||
if (! editor->block_aspect && GTK_TOGGLE_BUTTON (widget)->active)
|
||||
if (! editor->block_aspect &&
|
||||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
|
||||
{
|
||||
GimpTemplate *template = editor->template;
|
||||
gint width = template->width;
|
||||
|
@ -111,8 +111,10 @@ gimp_template_view_new (GimpViewType view_type,
|
||||
|
||||
tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
|
||||
|
||||
tree_view->name_cell->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
|
||||
GTK_CELL_RENDERER_TEXT (tree_view->name_cell)->editable = TRUE;
|
||||
g_object_set (tree_view->name_cell,
|
||||
"mode", GTK_CELL_RENDERER_MODE_EDITABLE,
|
||||
"editable", TRUE,
|
||||
NULL);
|
||||
|
||||
tree_view->editable_cells = g_list_prepend (tree_view->editable_cells,
|
||||
tree_view->name_cell);
|
||||
|
@ -171,22 +171,23 @@ static void
|
||||
gimp_thumb_box_style_set (GtkWidget *widget,
|
||||
GtkStyle *prev_style)
|
||||
{
|
||||
GimpThumbBox *box = GIMP_THUMB_BOX (widget);
|
||||
GimpThumbBox *box = GIMP_THUMB_BOX (widget);
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
GtkWidget *ebox;
|
||||
|
||||
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
|
||||
|
||||
gtk_widget_modify_bg (box->preview, GTK_STATE_NORMAL,
|
||||
&widget->style->base[GTK_STATE_NORMAL]);
|
||||
&style->base[GTK_STATE_NORMAL]);
|
||||
gtk_widget_modify_bg (box->preview, GTK_STATE_INSENSITIVE,
|
||||
&widget->style->base[GTK_STATE_NORMAL]);
|
||||
&style->base[GTK_STATE_NORMAL]);
|
||||
|
||||
ebox = gtk_bin_get_child (GTK_BIN (widget));
|
||||
|
||||
gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL,
|
||||
&widget->style->base[GTK_STATE_NORMAL]);
|
||||
&style->base[GTK_STATE_NORMAL]);
|
||||
gtk_widget_modify_bg (ebox, GTK_STATE_INSENSITIVE,
|
||||
&widget->style->base[GTK_STATE_NORMAL]);
|
||||
&style->base[GTK_STATE_NORMAL]);
|
||||
}
|
||||
|
||||
static GimpProgress *
|
||||
|
@ -307,7 +307,8 @@ gimp_toolbox_constructor (GType type,
|
||||
|
||||
gimp_toolbox_dnd_init (GIMP_TOOLBOX (toolbox));
|
||||
|
||||
gimp_toolbox_style_set (GTK_WIDGET (toolbox), GTK_WIDGET (toolbox)->style);
|
||||
gimp_toolbox_style_set (GTK_WIDGET (toolbox),
|
||||
gtk_widget_get_style (GTK_WIDGET (toolbox)));
|
||||
|
||||
toolbox_separator_expand (toolbox);
|
||||
|
||||
@ -510,12 +511,13 @@ gimp_toolbox_expose_event (GtkWidget *widget,
|
||||
&toolbox->header->allocation,
|
||||
&clip_rect))
|
||||
{
|
||||
cairo_t *cr;
|
||||
gint header_height;
|
||||
gint header_width;
|
||||
gdouble wilber_width;
|
||||
gdouble wilber_height;
|
||||
gdouble factor;
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
cairo_t *cr;
|
||||
gint header_height;
|
||||
gint header_width;
|
||||
gdouble wilber_width;
|
||||
gdouble wilber_height;
|
||||
gdouble factor;
|
||||
|
||||
cr = gdk_cairo_create (widget->window);
|
||||
gdk_cairo_rectangle (cr, &clip_rect);
|
||||
@ -535,9 +537,9 @@ gimp_toolbox_expose_event (GtkWidget *widget,
|
||||
(header_height / factor - wilber_height) / 2.0);
|
||||
|
||||
cairo_set_source_rgba (cr,
|
||||
widget->style->fg[widget->state].red / 65535.0,
|
||||
widget->style->fg[widget->state].green / 65535.0,
|
||||
widget->style->fg[widget->state].blue / 65535.0,
|
||||
style->fg[widget->state].red / 65535.0,
|
||||
style->fg[widget->state].green / 65535.0,
|
||||
style->fg[widget->state].blue / 65535.0,
|
||||
0.10);
|
||||
cairo_fill (cr);
|
||||
|
||||
@ -811,7 +813,8 @@ toolbox_area_notify (GimpGuiConfig *config,
|
||||
GParamSpec *pspec,
|
||||
GtkWidget *area)
|
||||
{
|
||||
gboolean visible;
|
||||
GtkWidget *parent = gtk_widget_get_parent (area);
|
||||
gboolean visible;
|
||||
|
||||
if (config->toolbox_color_area ||
|
||||
config->toolbox_foo_area ||
|
||||
@ -819,18 +822,18 @@ toolbox_area_notify (GimpGuiConfig *config,
|
||||
{
|
||||
GtkRequisition req;
|
||||
|
||||
gtk_widget_show (area->parent);
|
||||
gtk_widget_show (parent);
|
||||
|
||||
#ifdef __GNUC__
|
||||
#warning FIXME: fix GtkWrapBox child requisition/allocation instead of hacking badly (bug #162500).
|
||||
#endif
|
||||
gtk_widget_size_request (area, &req);
|
||||
gtk_widget_set_size_request (area->parent, req.width, req.height);
|
||||
gtk_widget_set_size_request (parent, req.width, req.height);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_hide (area->parent);
|
||||
gtk_widget_set_size_request (area->parent, -1, -1);
|
||||
gtk_widget_hide (parent);
|
||||
gtk_widget_set_size_request (parent, -1, -1);
|
||||
}
|
||||
|
||||
g_object_get (config, pspec->name, &visible, NULL);
|
||||
@ -847,7 +850,8 @@ toolbox_tool_changed (GimpContext *context,
|
||||
GtkWidget *toolbox_button = g_object_get_data (G_OBJECT (tool_info),
|
||||
TOOL_BUTTON_DATA_KEY);
|
||||
|
||||
if (toolbox_button && ! GTK_TOGGLE_BUTTON (toolbox_button)->active)
|
||||
if (toolbox_button &&
|
||||
! gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toolbox_button)))
|
||||
{
|
||||
g_signal_handlers_block_by_func (toolbox_button,
|
||||
toolbox_tool_button_toggled,
|
||||
@ -895,7 +899,7 @@ toolbox_tool_button_toggled (GtkWidget *widget,
|
||||
{
|
||||
GtkWidget *toolbox = gtk_widget_get_toplevel (widget);
|
||||
|
||||
if (GTK_TOGGLE_BUTTON (widget)->active)
|
||||
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
|
||||
gimp_context_set_tool (GIMP_DOCK (toolbox)->context, tool_info);
|
||||
}
|
||||
|
||||
|
@ -410,7 +410,7 @@ gimp_tool_options_editor_tool_changed (GimpContext *context,
|
||||
options_gui = g_object_get_data (G_OBJECT (tool_info->tool_options),
|
||||
"gimp-tool-options-gui");
|
||||
|
||||
if (! options_gui->parent)
|
||||
if (! gtk_widget_get_parent (options_gui))
|
||||
gtk_box_pack_start (GTK_BOX (editor->options_vbox), options_gui,
|
||||
FALSE, FALSE, 0);
|
||||
|
||||
|
@ -152,8 +152,9 @@ gimp_tool_view_new (GimpViewType view_type,
|
||||
|
||||
if (view_type == GIMP_VIEW_TYPE_LIST)
|
||||
{
|
||||
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
|
||||
GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (editor->view);
|
||||
GtkWidget *tree_widget = GTK_WIDGET (tree_view);
|
||||
GtkStyle *tree_style = gtk_widget_get_style (tree_widget);
|
||||
GtkTreeViewColumn *column;
|
||||
GtkCellRenderer *eye_cell;
|
||||
GtkIconSize icon_size;
|
||||
@ -167,9 +168,9 @@ gimp_tool_view_new (GimpViewType view_type,
|
||||
GIMP_STOCK_VISIBLE,
|
||||
GTK_ICON_SIZE_BUTTON,
|
||||
view_size -
|
||||
2 * tree_widget->style->xthickness,
|
||||
2 * tree_style->xthickness,
|
||||
view_size -
|
||||
2 * tree_widget->style->ythickness);
|
||||
2 * tree_style->ythickness);
|
||||
g_object_set (eye_cell, "stock-size", icon_size, NULL);
|
||||
|
||||
gtk_tree_view_column_pack_start (column, eye_cell, FALSE);
|
||||
|
@ -865,13 +865,16 @@ static void
|
||||
gimp_ui_manager_item_realize (GtkWidget *widget,
|
||||
GimpUIManager *manager)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
GtkWidget *submenu;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (widget,
|
||||
gimp_ui_manager_item_realize,
|
||||
manager);
|
||||
|
||||
if (GTK_IS_MENU_SHELL (widget->parent))
|
||||
menu = gtk_widget_get_parent (widget);
|
||||
|
||||
if (GTK_IS_MENU_SHELL (menu))
|
||||
{
|
||||
static GQuark quark_key_press_connected = 0;
|
||||
|
||||
@ -879,14 +882,14 @@ gimp_ui_manager_item_realize (GtkWidget *widget,
|
||||
quark_key_press_connected =
|
||||
g_quark_from_static_string ("gimp-menu-item-key-press-connected");
|
||||
|
||||
if (! GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (widget->parent),
|
||||
if (! GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (menu),
|
||||
quark_key_press_connected)))
|
||||
{
|
||||
g_signal_connect (widget->parent, "key-press-event",
|
||||
g_signal_connect (menu, "key-press-event",
|
||||
G_CALLBACK (gimp_ui_manager_item_key_press),
|
||||
manager);
|
||||
|
||||
g_object_set_qdata (G_OBJECT (widget->parent),
|
||||
g_object_set_qdata (G_OBJECT (menu),
|
||||
quark_key_press_connected,
|
||||
GINT_TO_POINTER (TRUE));
|
||||
}
|
||||
@ -971,7 +974,7 @@ gimp_ui_manager_item_key_press (GtkWidget *widget,
|
||||
if (! menu_item)
|
||||
break;
|
||||
|
||||
widget = menu_item->parent;
|
||||
widget = gtk_widget_get_parent (menu_item);
|
||||
|
||||
if (! widget)
|
||||
break;
|
||||
|
@ -322,15 +322,18 @@ gimp_viewable_dialog_set_viewable (GimpViewableDialog *dialog,
|
||||
|
||||
if (viewable)
|
||||
{
|
||||
GtkWidget *box;
|
||||
|
||||
g_signal_connect_object (viewable,
|
||||
GIMP_VIEWABLE_GET_CLASS (viewable)->name_changed_signal,
|
||||
G_CALLBACK (gimp_viewable_dialog_name_changed),
|
||||
dialog,
|
||||
0);
|
||||
|
||||
box = gtk_widget_get_parent (dialog->icon);
|
||||
|
||||
dialog->view = gimp_view_new (context, viewable, 32, 1, TRUE);
|
||||
gtk_box_pack_end (GTK_BOX (dialog->icon->parent), dialog->view,
|
||||
FALSE, FALSE, 2);
|
||||
gtk_box_pack_end (GTK_BOX (box), dialog->view, FALSE, FALSE, 2);
|
||||
gtk_widget_show (dialog->view);
|
||||
|
||||
g_object_add_weak_pointer (G_OBJECT (dialog->view),
|
||||
|
@ -69,13 +69,14 @@ gimp_view_renderer_vectors_draw (GimpViewRenderer *renderer,
|
||||
cairo_t *cr,
|
||||
const GdkRectangle *area)
|
||||
{
|
||||
GtkStyle *style = gtk_widget_get_style (widget);
|
||||
GimpVectors *vectors = GIMP_VECTORS (renderer->viewable);
|
||||
GimpBezierDesc *bezdesc;
|
||||
gdouble xscale;
|
||||
gdouble yscale;
|
||||
gint x, y;
|
||||
|
||||
gdk_cairo_set_source_color (cr, &widget->style->white);
|
||||
gdk_cairo_set_source_color (cr, &style->white);
|
||||
|
||||
x = area->x + (area->width - renderer->width) / 2;
|
||||
y = area->y + (area->height - renderer->height) / 2;
|
||||
@ -94,7 +95,7 @@ gimp_view_renderer_vectors_draw (GimpViewRenderer *renderer,
|
||||
cairo_device_to_user_distance (cr, &xscale, &yscale);
|
||||
|
||||
cairo_set_line_width (cr, MAX (xscale, yscale));
|
||||
gdk_cairo_set_source_color (cr, &widget->style->black);
|
||||
gdk_cairo_set_source_color (cr, &style->black);
|
||||
|
||||
bezdesc = gimp_vectors_make_bezier (vectors);
|
||||
|
||||
|
@ -277,6 +277,7 @@ gimp_enum_radio_frame_add (GtkFrame *frame,
|
||||
gint indicator_spacing;
|
||||
gint focus_width;
|
||||
gint focus_padding;
|
||||
gint border_width;
|
||||
|
||||
gtk_widget_style_get (radio,
|
||||
"indicator-size", &indicator_size,
|
||||
@ -285,6 +286,8 @@ gimp_enum_radio_frame_add (GtkFrame *frame,
|
||||
"focus-padding", &focus_padding,
|
||||
NULL);
|
||||
|
||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (radio));
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
|
||||
spacer = gtk_vbox_new (FALSE, 0);
|
||||
@ -293,7 +296,7 @@ gimp_enum_radio_frame_add (GtkFrame *frame,
|
||||
3 * indicator_spacing +
|
||||
focus_width +
|
||||
focus_padding +
|
||||
GTK_CONTAINER (radio)->border_width,
|
||||
border_width,
|
||||
-1);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), spacer, FALSE, FALSE, 0);
|
||||
gtk_widget_show (spacer);
|
||||
@ -307,7 +310,7 @@ gimp_enum_radio_frame_add (GtkFrame *frame,
|
||||
NULL);
|
||||
|
||||
gtk_widget_set_sensitive (hbox,
|
||||
GTK_TOGGLE_BUTTON (list->data)->active);
|
||||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (list->data)));
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_box_reorder_child (GTK_BOX (vbox), hbox, pos);
|
||||
@ -343,7 +346,8 @@ gimp_get_icon_size (GtkWidget *widget,
|
||||
g_return_val_if_fail (width > 0, icon_size);
|
||||
g_return_val_if_fail (height > 0, icon_size);
|
||||
|
||||
icon_set = gtk_style_lookup_icon_set (widget->style, stock_id);
|
||||
icon_set = gtk_style_lookup_icon_set (gtk_widget_get_style (widget),
|
||||
stock_id);
|
||||
|
||||
if (! icon_set)
|
||||
return GTK_ICON_SIZE_INVALID;
|
||||
|
Reference in New Issue
Block a user