diff options
-rw-r--r-- | eel/eel-background-box.c | 34 | ||||
-rw-r--r-- | eel/eel-background.c | 2 | ||||
-rw-r--r-- | libcaja-private/caja-icon-canvas-item.c | 16 | ||||
-rw-r--r-- | libcaja-private/caja-icon-container.c | 4 | ||||
-rw-r--r-- | libcaja-private/caja-icon-dnd.c | 27 | ||||
-rw-r--r-- | src/caja-sidebar-title.c | 24 |
6 files changed, 60 insertions, 47 deletions
diff --git a/eel/eel-background-box.c b/eel/eel-background-box.c index 6e25cc62..5aeac5a6 100644 --- a/eel/eel-background-box.c +++ b/eel/eel-background-box.c @@ -27,35 +27,45 @@ #include "eel-background.h" -static void eel_background_box_class_init (EelBackgroundBoxClass *background_box_class); -static void eel_background_box_init (EelBackgroundBox *background); - G_DEFINE_TYPE (EelBackgroundBox, eel_background_box, GTK_TYPE_EVENT_BOX) static gboolean -eel_background_box_expose_event (GtkWidget *widget, - GdkEventExpose *event) +eel_background_box_draw (GtkWidget *widget, +#if GTK_CHECK_VERSION (3, 0, 0) + cairo_t *cr) +#else + GdkEventExpose *event) +#endif { +#if GTK_CHECK_VERSION (3, 0, 0) + eel_background_draw (widget, cr); + gtk_container_propagate_draw (GTK_CONTAINER (widget), + gtk_bin_get_child (GTK_BIN (widget)), + cr); +#else eel_background_expose (widget, event); - gtk_container_propagate_expose (GTK_CONTAINER (widget), gtk_bin_get_child (GTK_BIN (widget)), event); - +#endif return TRUE; } static void -eel_background_box_class_init (EelBackgroundBoxClass *klass) +eel_background_box_init (EelBackgroundBox *box) { - GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); - - widget_class->expose_event = eel_background_box_expose_event; } static void -eel_background_box_init (EelBackgroundBox *box) +eel_background_box_class_init (EelBackgroundBoxClass *klass) { + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + +#if GTK_CHECK_VERSION (3, 0, 0) + widget_class->draw = eel_background_box_draw; +#else + widget_class->expose_event = eel_background_box_draw; +#endif } GtkWidget* diff --git a/eel/eel-background.c b/eel/eel-background.c index 867ab2ee..80f0e90c 100644 --- a/eel/eel-background.c +++ b/eel/eel-background.c @@ -461,7 +461,7 @@ eel_background_expose (GtkWidget *widget, widget_window = gtk_widget_get_window (widget); #if !GTK_CHECK_VERSION (3, 0, 0) - g_return_if_fail (event->window != widget_window); + g_return_if_fail (event->window == widget_window); #endif EelBackground *background = eel_get_widget_background (widget); diff --git a/libcaja-private/caja-icon-canvas-item.c b/libcaja-private/caja-icon-canvas-item.c index f36f2ccf..45e6f98b 100644 --- a/libcaja-private/caja-icon-canvas-item.c +++ b/libcaja-private/caja-icon-canvas-item.c @@ -622,7 +622,7 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, pixmap = gdk_pixmap_new (gdk_screen_get_root_window (screen), width, height, gdk_visual_get_depth (gdk_colormap_get_visual (colormap))); - gdk_drawable_set_colormap (GDK_DRAWABLE (pixmap), colormap); + gdk_drawable_set_colormap (pixmap, colormap); pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, @@ -690,11 +690,11 @@ caja_icon_canvas_item_get_image (CajaIconCanvasItem *item, cairo_paint (cr); cairo_destroy (cr); - draw_embedded_text (item, GDK_DRAWABLE (pixmap), + draw_embedded_text (item, pixmap, item_offset_x, item_offset_y); - draw_label_text (item, GDK_DRAWABLE (pixmap), FALSE, icon_rect); - draw_label_text (item, GDK_DRAWABLE (*mask), TRUE, icon_rect); + draw_label_text (item, pixmap, FALSE, icon_rect); + draw_label_text (item, *mask, TRUE, icon_rect); g_object_unref (pixbuf); @@ -1624,7 +1624,9 @@ draw_label_text (CajaIconCanvasItem *item, drawable, #endif needs_highlight ? GTK_STATE_SELECTED : GTK_STATE_NORMAL, +#if !GTK_CHECK_VERSION(3,0,0) NULL, +#endif GTK_WIDGET (EEL_CANVAS_ITEM (item)->canvas), "icon-container", text_rect.x0, @@ -1704,11 +1706,11 @@ get_knob_pixbuf (void) } static void -#if GTK_CHECK_VERSION(3,0,0) draw_stretch_handles (CajaIconCanvasItem *item, +#if GTK_CHECK_VERSION(3,0,0) cairo_t *cr, #else -draw_stretch_handles (CajaIconCanvasItem *item, GdkDrawable *drawable, + GdkDrawable *drawable, #endif const EelIRect *rect) { @@ -2228,7 +2230,7 @@ caja_icon_canvas_item_draw (EelCanvasItem *item, GdkDrawable *drawable, #if GTK_CHECK_VERSION(3,0,0) draw_embedded_text (icon_item, cr, icon_rect.x0, icon_rect.y0); #else - draw_embedded_text (icon_item, drawable, icon_rect.x0, icon_rect.y0); + draw_embedded_text (icon_item, drawable, icon_rect.x0, icon_rect.y0); #endif is_rtl = caja_icon_container_is_layout_rtl (CAJA_ICON_CONTAINER (item->canvas)); diff --git a/libcaja-private/caja-icon-container.c b/libcaja-private/caja-icon-container.c index 6b2f18e8..2b38220c 100644 --- a/libcaja-private/caja-icon-container.c +++ b/libcaja-private/caja-icon-container.c @@ -5252,14 +5252,12 @@ caja_icon_container_search_position_func (CajaIconContainer *container, gdk_window_get_origin (cont_window, &cont_x, &cont_y); -#if GTK_CHECK_VERSION(3, 0, 0) cont_width = gdk_window_get_width (cont_window); cont_height = gdk_window_get_height (cont_window); +#if GTK_CHECK_VERSION(3, 0, 0) gtk_widget_get_preferred_size (search_dialog, &requisition, NULL); #else - gdk_drawable_get_size (cont_window, &cont_width, &cont_height); - gtk_widget_size_request (search_dialog, &requisition); #endif diff --git a/libcaja-private/caja-icon-dnd.c b/libcaja-private/caja-icon-dnd.c index cae6e4ee..bd642684 100644 --- a/libcaja-private/caja-icon-dnd.c +++ b/libcaja-private/caja-icon-dnd.c @@ -1505,15 +1505,15 @@ drag_begin_callback (GtkWidget *widget, GdkDragContext *context, gpointer data) { + CajaIconContainer *container; #if GTK_CHECK_VERSION(3,0,0) cairo_surface_t *surface; #else - CajaIconContainer *container; - GdkScreen *screen; - GdkColormap *colormap; + GdkScreen *screen = gtk_widget_get_screen (widget); + GdkColormap *colormap = NULL; GdkPixmap *pixmap; GdkBitmap *mask; - gboolean use_mask; + gboolean use_mask = FALSE; #endif double x1, y1, x2, y2, winx, winy; int x_offset, y_offset; @@ -1522,16 +1522,8 @@ drag_begin_callback (GtkWidget *widget, container = CAJA_ICON_CONTAINER (widget); #if !GTK_CHECK_VERSION(3,0,0) - screen = gtk_widget_get_screen (widget); - colormap = NULL; if (gdk_screen_is_composited (screen)) - { colormap = gdk_screen_get_rgba_colormap (screen); - if (colormap != NULL) - { - use_mask = FALSE; - } - } /* Fall back on using the same colormap as the widget */ if (colormap == NULL) @@ -1568,18 +1560,15 @@ drag_begin_callback (GtkWidget *widget, #else if (!use_mask && pixmap != NULL) { - cairo_t *cr; - /* If composite works, make the icons partially transparent */ - cr = gdk_cairo_create (pixmap); + cairo_t *cr = gdk_cairo_create (pixmap); cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OUT); cairo_set_source_rgba(cr, 1,0,0,0.35); cairo_paint (cr); cairo_destroy (cr); } - gtk_drag_set_icon_pixmap (context, - colormap, + gtk_drag_set_icon_pixmap (context, colormap, pixmap, (use_mask ? mask : NULL), x_offset, y_offset); #endif @@ -1636,18 +1625,16 @@ drag_highlight_expose (GtkWidget *widget, y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (widget))); window = gtk_widget_get_window (widget); -#if GTK_CHECK_VERSION(3, 0, 0) width = gdk_window_get_width (window); height = gdk_window_get_height (window); +#if GTK_CHECK_VERSION (3, 0, 0) gtk_paint_shadow (gtk_widget_get_style (widget), cr, GTK_STATE_NORMAL, GTK_SHADOW_OUT, widget, "dnd", x, y, width, height); #else - gdk_drawable_get_size(window, &width, &height); - gtk_paint_shadow (gtk_widget_get_style (widget), window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, widget, "dnd", diff --git a/src/caja-sidebar-title.c b/src/caja-sidebar-title.c index c7bda988..d9c780ce 100644 --- a/src/caja-sidebar-title.c +++ b/src/caja-sidebar-title.c @@ -210,12 +210,28 @@ caja_sidebar_title_finalize (GObject *object) static void caja_sidebar_title_class_init (CajaSidebarTitleClass *klass) { - g_type_class_add_private (klass, sizeof (CajaSidebarTitleDetails)); + GtkWidgetClass *widget_class; G_OBJECT_CLASS (klass)->finalize = caja_sidebar_title_finalize; - GTK_WIDGET_CLASS (klass)->size_allocate = caja_sidebar_title_size_allocate; - GTK_WIDGET_CLASS (klass)->style_set = style_set; + widget_class = GTK_WIDGET_CLASS (klass); + widget_class->size_allocate = caja_sidebar_title_size_allocate; + widget_class->style_set = style_set; + + gtk_widget_class_install_style_property (widget_class, + g_param_spec_boxed ("light_info_color", + "Light Info Color", + "Color used for information text against a dark background", + GDK_TYPE_COLOR, + G_PARAM_READABLE)); + gtk_widget_class_install_style_property (widget_class, + g_param_spec_boxed ("dark_info_color", + "Dark Info Color", + "Color used for information text against a light background", + GDK_TYPE_COLOR, + G_PARAM_READABLE)); + + g_type_class_add_private (klass, sizeof (CajaSidebarTitleDetails)); } /* return a new index title object */ @@ -240,7 +256,7 @@ caja_sidebar_title_select_text_color (CajaSidebarTitle *sidebar_title, GtkStyle *style; g_assert (CAJA_IS_SIDEBAR_TITLE (sidebar_title)); - g_return_if_fail (!gtk_widget_get_realized (GTK_WIDGET (sidebar_title))); + g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (sidebar_title))); /* read the info colors from the current theme; use a reasonable default if undefined */ gtk_widget_style_get (GTK_WIDGET (sidebar_title), |