diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/caja-location-bar.c | 16 | ||||
-rw-r--r-- | src/caja-notebook.c | 27 | ||||
-rw-r--r-- | src/caja-places-sidebar.c | 9 | ||||
-rw-r--r-- | src/caja-sidebar-title.c | 105 | ||||
-rw-r--r-- | src/caja-spatial-window.c | 4 | ||||
-rw-r--r-- | src/caja-window.c | 28 | ||||
-rw-r--r-- | src/file-manager/fm-list-model.c | 8 | ||||
-rw-r--r-- | src/file-manager/fm-list-view.c | 15 | ||||
-rw-r--r-- | src/file-manager/fm-properties-window.c | 84 | ||||
-rw-r--r-- | src/file-manager/fm-tree-model.c | 8 |
10 files changed, 299 insertions, 5 deletions
diff --git a/src/caja-location-bar.c b/src/caja-location-bar.c index 965da186..e2a70104 100644 --- a/src/caja-location-bar.c +++ b/src/caja-location-bar.c @@ -614,6 +614,21 @@ caja_location_bar_update_label (CajaLocationBar *bar) void caja_location_bar_set_active(CajaLocationBar *location_bar, gboolean is_active) { +#if GTK_CHECK_VERSION (3, 0, 0) + if (is_active) + { + /* reset style to default */ + gtk_widget_override_background_color (GTK_WIDGET (location_bar->details->entry), GTK_STATE_FLAG_NORMAL, NULL); + } + else + { + GtkStyleContext *style; + GdkRGBA color; + + style = gtk_widget_get_style_context (GTK_WIDGET (location_bar->details->entry)); + gtk_style_context_get_background_color (style, GTK_STATE_FLAG_INSENSITIVE, &color); + gtk_widget_override_background_color (GTK_WIDGET (location_bar->details->entry), GTK_STATE_FLAG_ACTIVE, &color); +#else if(is_active) { /* reset style to default */ @@ -626,6 +641,7 @@ caja_location_bar_set_active(CajaLocationBar *location_bar, gboolean is_active) style = gtk_widget_get_style (GTK_WIDGET (location_bar->details->entry)); color = style->base[GTK_STATE_INSENSITIVE]; gtk_widget_modify_base(GTK_WIDGET (location_bar->details->entry), GTK_STATE_NORMAL, &color); +#endif } } diff --git a/src/caja-notebook.c b/src/caja-notebook.c index b5b6420e..035ef769 100644 --- a/src/caja-notebook.c +++ b/src/caja-notebook.c @@ -82,6 +82,7 @@ caja_notebook_class_init (CajaNotebookClass *klass) notebook_class->insert_page = caja_notebook_insert_page; +#if !GTK_CHECK_VERSION (3, 0, 0) gtk_rc_parse_string ("style \"caja-tab-close-button-style\"\n" "{\n" "GtkWidget::focus-padding = 0\n" @@ -90,6 +91,7 @@ caja_notebook_class_init (CajaNotebookClass *klass) "ythickness = 0\n" "}\n" "widget \"*.caja-tab-close-button\" style \"caja-tab-close-button-style\""); +#endif signals[TAB_CLOSE_REQUEST] = g_signal_new ("tab-close-request", @@ -239,6 +241,31 @@ button_press_cb (CajaNotebook *notebook, static void caja_notebook_init (CajaNotebook *notebook) { +#if GTK_CHECK_VERSION (3, 0, 0) + static const gchar css_custom[] = + "#caja-tab-close-button {" + " -GtkWidget-focus-padding : 0;" + " -GtkWidget-focus-line-width: 0;" + " xthickness: 0;" + " ythickness: 0;" + "}"; + + GError *error = NULL; + GtkCssProvider *provider = gtk_css_provider_new (); + gtk_css_provider_load_from_data (provider, css_custom, -1, &error); + + if (error != NULL) { + g_warning ("Can't parse CajaNotebook's CSS custom description: %s\n", error->message); + g_error_free (error); + } else { + gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (notebook)), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + } + + g_object_unref (provider); +#endif + gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE); gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); diff --git a/src/caja-places-sidebar.c b/src/caja-places-sidebar.c index ce7bccdf..0fdeb9e3 100644 --- a/src/caja-places-sidebar.c +++ b/src/caja-places-sidebar.c @@ -27,9 +27,14 @@ #include <eel/eel-debug.h> #include <eel/eel-gtk-extensions.h> #include <eel/eel-glib-extensions.h> +#if GTK_CHECK_VERSION(3,0,0) +#include <eel/eel-graphic-effects.h> +#endif #include <eel/eel-string.h> #include <eel/eel-stock-dialogs.h> +#if !GTK_CHECK_VERSION(3,0,0) #include <eel/eel-gdk-pixbuf-extensions.h> +#endif #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> #include <glib/gi18n.h> @@ -244,7 +249,11 @@ get_eject_icon (gboolean highlighted) if (highlighted) { GdkPixbuf *high; +#if GTK_CHECK_VERSION(3,0,0) + high = eel_create_spotlight_pixbuf (eject); +#else high = eel_gdk_pixbuf_render (eject, 1, 255, 255, 0, 0); +#endif g_object_unref (eject); eject = high; } diff --git a/src/caja-sidebar-title.c b/src/caja-sidebar-title.c index baa9c5e0..ec8ef777 100644 --- a/src/caja-sidebar-title.c +++ b/src/caja-sidebar-title.c @@ -54,8 +54,13 @@ #define MIN_TITLE_FONT_SIZE 12 #define TITLE_PADDING 4 +#if GTK_CHECK_VERSION (3, 0, 0) +#define DEFAULT_LIGHT_INFO_COLOR "#FFFFFF" +#define DEFAULT_DARK_INFO_COLOR "#2A2A2A" +#else #define DEFAULT_LIGHT_INFO_COLOR 0xFFFFFF #define DEFAULT_DARK_INFO_COLOR 0x2A2A2A +#endif #if GTK_CHECK_VERSION (3, 0, 0) #define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y) @@ -97,7 +102,11 @@ struct CajaSidebarTitleDetails GtkWidget *more_info_label; GtkWidget *emblem_box; +#if GTK_CHECK_VERSION (3, 0, 0) + GdkRGBA label_colors [LAST_LABEL_COLOR]; +#else GdkColor label_colors [LAST_LABEL_COLOR]; +#endif guint best_icon_size; gboolean determined_icon; }; @@ -113,6 +122,7 @@ style_set (GtkWidget *widget, PangoFontDescription *font_desc; GtkStyle *style; + g_return_if_fail (CAJA_IS_SIDEBAR_TITLE (widget)); sidebar_title = CAJA_SIDEBAR_TITLE (widget); @@ -223,16 +233,30 @@ caja_sidebar_title_class_init (CajaSidebarTitleClass *klass) widget_class->style_set = style_set; gtk_widget_class_install_style_property (widget_class, +#if GTK_CHECK_VERSION (3, 0, 0) + g_param_spec_boxed ("light_info_rgba", + "Light Info RGBA", + "Color used for information text against a dark background", + GDK_TYPE_RGBA, +#else g_param_spec_boxed ("light_info_color", "Light Info Color", "Color used for information text against a dark background", GDK_TYPE_COLOR, +#endif G_PARAM_READABLE)); gtk_widget_class_install_style_property (widget_class, +#if GTK_CHECK_VERSION (3, 0, 0) + g_param_spec_boxed ("dark_info_rgba", + "Dark Info RGBA", + "Color used for information text against a light background", + GDK_TYPE_RGBA, +#else g_param_spec_boxed ("dark_info_color", "Dark Info Color", "Color used for information text against a light background", GDK_TYPE_COLOR, +#endif G_PARAM_READABLE)); g_type_class_add_private (klass, sizeof (CajaSidebarTitleDetails)); @@ -246,23 +270,71 @@ caja_sidebar_title_new (void) } static void +#if GTK_CHECK_VERSION (3, 0, 0) +setup_gc_with_fg (CajaSidebarTitle *sidebar_title, int idx, GdkRGBA *color) +{ + sidebar_title->details->label_colors[idx] = *color; +#else setup_gc_with_fg (CajaSidebarTitle *sidebar_title, int idx, guint32 color) { sidebar_title->details->label_colors [idx] = eel_gdk_rgb_to_color (color); +#endif } void caja_sidebar_title_select_text_color (CajaSidebarTitle *sidebar_title, EelBackground *background) { +#if GTK_CHECK_VERSION (3, 0, 0) + GdkRGBA *light_info_color, *dark_info_color; + GtkStyleContext *style; + GdkRGBA color; +#else GdkColor *light_info_color, *dark_info_color; guint light_info_value, dark_info_value; GtkStyle *style; +#endif g_assert (CAJA_IS_SIDEBAR_TITLE (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 */ +#if GTK_CHECK_VERSION (3, 0, 0) + style = gtk_widget_get_style_context (GTK_WIDGET (sidebar_title)); + gtk_style_context_get_style (style, + "light_info_color", &light_info_color, + "dark_info_color", &dark_info_color, + NULL); + + if (!light_info_color) + { + light_info_color = g_malloc (sizeof (GdkRGBA)); + gdk_rgba_parse (light_info_color, DEFAULT_LIGHT_INFO_COLOR); + } + + if (!dark_info_color) + { + light_info_color = g_malloc (sizeof (GdkRGBA)); + gdk_rgba_parse (dark_info_color, DEFAULT_DARK_INFO_COLOR); + } + + gtk_style_context_get_color (style, GTK_STATE_FLAG_SELECTED, &color); + setup_gc_with_fg (sidebar_title, LABEL_COLOR_HIGHLIGHT, &color); + + gtk_style_context_get_color (style, GTK_STATE_FLAG_ACTIVE, &color); + setup_gc_with_fg (sidebar_title, LABEL_COLOR_ACTIVE, &color); + + gtk_style_context_get_color (style, GTK_STATE_FLAG_PRELIGHT, &color); + setup_gc_with_fg (sidebar_title, LABEL_COLOR_PRELIGHT, &color); + + gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED, &color); + setup_gc_with_fg (sidebar_title, LABEL_INFO_COLOR_HIGHLIGHT, + eel_gdk_rgba_is_dark (&color) ? light_info_color : dark_info_color); + + gtk_style_context_get_background_color (style, GTK_STATE_FLAG_ACTIVE, &color); + setup_gc_with_fg (sidebar_title, LABEL_INFO_COLOR_ACTIVE, + eel_gdk_rgba_is_dark (&color) ? light_info_color : dark_info_color); +#else gtk_widget_style_get (GTK_WIDGET (sidebar_title), "light_info_color", &light_info_color, "dark_info_color", &dark_info_color, @@ -289,7 +361,6 @@ caja_sidebar_title_select_text_color (CajaSidebarTitle *sidebar_title, dark_info_value = DEFAULT_DARK_INFO_COLOR; } - setup_gc_with_fg (sidebar_title, LABEL_COLOR_HIGHLIGHT, eel_gdk_color_to_rgb (&style->text[GTK_STATE_SELECTED])); setup_gc_with_fg (sidebar_title, LABEL_COLOR_ACTIVE, @@ -300,11 +371,42 @@ caja_sidebar_title_select_text_color (CajaSidebarTitle *sidebar_title, eel_gdk_color_is_dark (&style->base[GTK_STATE_SELECTED]) ? light_info_value : dark_info_value); setup_gc_with_fg (sidebar_title, LABEL_INFO_COLOR_ACTIVE, eel_gdk_color_is_dark (&style->base[GTK_STATE_ACTIVE]) ? light_info_value : dark_info_value); +#endif /* If EelBackground is not set in the widget, we can safely * use the foreground color from the theme, because it will * always be displayed against the gtk background */ if (!eel_background_is_set(background)) +#if GTK_CHECK_VERSION (3, 0, 0) + { + gtk_style_context_get_color (style, GTK_STATE_FLAG_NORMAL, &color); + setup_gc_with_fg (sidebar_title, LABEL_COLOR, &color); + + gtk_style_context_get_background_color (style, GTK_STATE_FLAG_NORMAL, &color); + setup_gc_with_fg (sidebar_title, LABEL_INFO_COLOR, + eel_gdk_rgba_is_dark (&color) ? + light_info_color : dark_info_color); + } + else if (eel_background_is_dark (background)) + { + GdkRGBA tmp; + + gdk_rgba_parse (&tmp, "EFEFEF"); + setup_gc_with_fg (sidebar_title, LABEL_COLOR, &tmp); + setup_gc_with_fg (sidebar_title, LABEL_INFO_COLOR, light_info_color); + } + else /* converse */ + { + GdkRGBA tmp; + + gdk_rgba_parse (&tmp, "000000"); + setup_gc_with_fg (sidebar_title, LABEL_COLOR, &tmp); + setup_gc_with_fg (sidebar_title, LABEL_INFO_COLOR, dark_info_color); + } + + gdk_rgba_free (dark_info_color); + gdk_rgba_free (light_info_color); +#else { setup_gc_with_fg (sidebar_title, LABEL_COLOR, eel_gdk_color_to_rgb (&style->text[GTK_STATE_NORMAL])); @@ -321,6 +423,7 @@ caja_sidebar_title_select_text_color (CajaSidebarTitle *sidebar_title, setup_gc_with_fg (sidebar_title, LABEL_COLOR, 0x000000); setup_gc_with_fg (sidebar_title, LABEL_INFO_COLOR, dark_info_value); } +#endif } static char* diff --git a/src/caja-spatial-window.c b/src/caja-spatial-window.c index 4dfe9bfb..05082358 100644 --- a/src/caja-spatial-window.c +++ b/src/caja-spatial-window.c @@ -989,7 +989,9 @@ static const char* icon_entries[] = static void caja_spatial_window_init (CajaSpatialWindow *window) { +#if !GTK_CHECK_VERSION (3, 0, 0) GtkRcStyle *rc_style; +#endif GtkWidget *arrow; GtkWidget *hbox, *vbox; GtkActionGroup *action_group; @@ -1035,11 +1037,13 @@ caja_spatial_window_init (CajaSpatialWindow *window) window); gtk_button_set_relief (GTK_BUTTON (window->details->location_button), GTK_RELIEF_NORMAL); +#if !GTK_CHECK_VERSION (3, 0, 0) rc_style = gtk_widget_get_modifier_style (window->details->location_button); rc_style->xthickness = 0; rc_style->ythickness = 0; gtk_widget_modify_style (window->details->location_button, rc_style); +#endif gtk_widget_show (window->details->location_button); hbox = gtk_hbox_new (FALSE, 3); diff --git a/src/caja-window.c b/src/caja-window.c index c460ae98..6a1cb402 100644 --- a/src/caja-window.c +++ b/src/caja-window.c @@ -141,6 +141,30 @@ caja_window_init (CajaWindow *window) GtkWidget *menu; GtkWidget *statusbar; +#if GTK_CHECK_VERSION (3, 0, 0) + static const gchar css_custom[] = + "#statusbar-no-border {" + " -GtkStatusbar-shadow-type: none;" + "}" + "#caja-extra-view-widget {" + " background-color: " EXTRA_VIEW_WIDGETS_BACKGROUND ";" + "}"; + + GError *error = NULL; + GtkCssProvider *provider = gtk_css_provider_new (); + gtk_css_provider_load_from_data (provider, css_custom, -1, &error); + + if (error != NULL) { + g_warning ("Can't parse CajaWindow's CSS custom description: %s\n", error->message); + g_error_free (error); + } else { + gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (window)), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + } + + g_object_unref (provider); +#endif window->details = G_TYPE_INSTANCE_GET_PRIVATE (window, CAJA_TYPE_WINDOW, CajaWindowDetails); window->details->panes = NULL; @@ -148,6 +172,7 @@ caja_window_init (CajaWindow *window) window->details->show_hidden_files_mode = CAJA_WINDOW_SHOW_HIDDEN_FILES_DEFAULT; +#if !GTK_CHECK_VERSION (3, 0, 0) /* Remove Top border on GtkStatusBar */ gtk_rc_parse_string ( "style \"statusbar-no-border\"\n" @@ -155,6 +180,7 @@ caja_window_init (CajaWindow *window) " GtkStatusbar::shadow_type = GTK_SHADOW_NONE\n" "}\n" "widget \"*.statusbar-noborder\" style \"statusbar-no-border\""); +#endif /* Set initial window title */ gtk_window_set_title (GTK_WINDOW (window), _("Caja")); @@ -2238,6 +2264,7 @@ caja_window_class_init (CajaWindowClass *class) class->reload = caja_window_reload; class->go_up = caja_window_go_up_signal; +#if !GTK_CHECK_VERSION (3,0,0) /* Allow to set the colors of the extra view widgets */ gtk_rc_parse_string ("\n" " style \"caja-extra-view-widgets-style-internal\"\n" @@ -2247,6 +2274,7 @@ caja_window_class_init (CajaWindowClass *class) "\n" " widget \"*.caja-extra-view-widget\" style:rc \"caja-extra-view-widgets-style-internal\" \n" "\n"); +#endif g_type_class_add_private (G_OBJECT_CLASS (class), sizeof (CajaWindowDetails)); } diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c index 6a1692f4..1bf2d599 100644 --- a/src/file-manager/fm-list-model.c +++ b/src/file-manager/fm-list-model.c @@ -29,7 +29,11 @@ #include <libegg/eggtreemultidnd.h> #include <string.h> +#if GTK_CHECK_VERSION(3,0,0) +#include <eel/eel-graphic-effects.h> +#else #include <eel/eel-gdk-pixbuf-extensions.h> +#endif #include <gtk/gtk.h> #include <glib/gi18n.h> #include <libcaja-private/caja-dnd.h> @@ -386,7 +390,11 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column g_list_find_custom (model->details->highlight_files, file, (GCompareFunc) caja_file_compare_location)) { +#if GTK_CHECK_VERSION(3,0,0) + rendered_icon = eel_create_spotlight_pixbuf (icon); +#else rendered_icon = eel_gdk_pixbuf_render (icon, 1, 255, 255, 0, 0); +#endif if (rendered_icon != NULL) { diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c index dc9bc20b..56ff9b17 100644 --- a/src/file-manager/fm-list-view.c +++ b/src/file-manager/fm-list-view.c @@ -3262,20 +3262,35 @@ real_set_is_active (FMDirectoryView *view, gboolean is_active) { GtkWidget *tree_view; +#if GTK_CHECK_VERSION (3, 0, 0) + GtkStyleContext *style; + GdkRGBA color; +#else GtkStyle *style; GdkColor color; +#endif tree_view = GTK_WIDGET (fm_list_view_get_tree_view (FM_LIST_VIEW (view))); if (is_active) { +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_override_background_color (tree_view, GTK_STATE_FLAG_NORMAL, NULL); +#else gtk_widget_modify_base (tree_view, GTK_STATE_NORMAL, NULL); +#endif } else { +#if GTK_CHECK_VERSION (3, 0, 0) + style = gtk_widget_get_style_context (tree_view); + gtk_style_context_get_background_color (style, GTK_STATE_FLAG_INSENSITIVE, &color); + gtk_widget_override_background_color (tree_view, GTK_STATE_FLAG_NORMAL, &color); +#else style = gtk_widget_get_style (tree_view); color = style->base[GTK_STATE_INSENSITIVE]; gtk_widget_modify_base (tree_view, GTK_STATE_NORMAL, &color); +#endif } EEL_CALL_PARENT (FM_DIRECTORY_VIEW_CLASS, diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index 42b30a9a..87b75a6d 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -68,6 +68,15 @@ #include <sys/mount.h> #endif +#if GTK_CHECK_VERSION (3, 0, 0) +#define USED_FILL_R 0.988235294 +#define USED_FILL_G 0.91372549 +#define USED_FILL_B 0.309803922 + +#define FREE_FILL_R 0.447058824 +#define FREE_FILL_G 0.623529412 +#define FREE_FILL_B 0.811764706 +#else #define USED_FILL_R (0.988235294 * 65535) #define USED_FILL_G (0.91372549 * 65535) #define USED_FILL_B (0.309803922 * 65535) @@ -75,6 +84,7 @@ #define FREE_FILL_R (0.447058824 * 65535) #define FREE_FILL_G (0.623529412 * 65535) #define FREE_FILL_B (0.811764706 * 65535) +#endif #define PREVIEW_IMAGE_WIDTH 96 @@ -148,10 +158,17 @@ struct FMPropertiesWindowDetails { guint64 volume_capacity; guint64 volume_free; +#if GTK_CHECK_VERSION (3, 0, 0) + GdkRGBA used_color; + GdkRGBA free_color; + GdkRGBA used_stroke_color; + GdkRGBA free_stroke_color; +#else GdkColor used_color; GdkColor free_color; GdkColor used_stroke_color; GdkColor free_stroke_color; +#endif }; #if GTK_CHECK_VERSION (3, 0, 0) @@ -3045,6 +3062,13 @@ paint_used_legend (GtkWidget *widget, width - 4, height - 4); +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_cairo_set_source_rgba (cr, &window->details->used_color); + cairo_fill_preserve (cr); + + gdk_cairo_set_source_rgba (cr, &window->details->used_stroke_color); + cairo_stroke (cr); +#else cairo_set_source_rgb (cr, (double) window->details->used_color.red / 65535, (double) window->details->used_color.green / 65535, @@ -3057,7 +3081,6 @@ paint_used_legend (GtkWidget *widget, (double) window->details->used_stroke_color.blue / 65535); cairo_stroke (cr); -#if !GTK_CHECK_VERSION(3,0,0) cairo_destroy (cr); #endif } @@ -3089,6 +3112,13 @@ paint_free_legend (GtkWidget *widget, width - 4, height - 4); +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_cairo_set_source_rgba (cr, &window->details->free_color); + cairo_fill_preserve(cr); + + gdk_cairo_set_source_rgba (cr, &window->details->free_stroke_color); + cairo_stroke (cr); +#else cairo_set_source_rgb (cr, (double) window->details->free_color.red / 65535, (double) window->details->free_color.green / 65535, @@ -3101,7 +3131,6 @@ paint_free_legend (GtkWidget *widget, (double) window->details->free_stroke_color.blue / 65535); cairo_stroke (cr); -#if !GTK_CHECK_VERSION(3,0,0) cairo_destroy (cr); #endif } @@ -3167,6 +3196,12 @@ paint_pie_chart (GtkWidget *widget, cairo_line_to (cr,xc,yc); } +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_cairo_set_source_rgba (cr, &window->details->used_color); + cairo_fill_preserve (cr); + + gdk_cairo_set_source_rgba (cr, &window->details->used_stroke_color); +#else cairo_set_source_rgb (cr, (double) window->details->used_color.red / 65535, (double) window->details->used_color.green / 65535, @@ -3177,6 +3212,7 @@ paint_pie_chart (GtkWidget *widget, (double) window->details->used_stroke_color.red / 65535, (double) window->details->used_stroke_color.green / 65535, (double) window->details->used_stroke_color.blue / 65535); +#endif cairo_stroke (cr); } @@ -3191,6 +3227,12 @@ paint_pie_chart (GtkWidget *widget, cairo_line_to (cr,xc,yc); } +#if GTK_CHECK_VERSION (3, 0, 0) + gdk_cairo_set_source_rgba (cr, &window->details->free_color); + cairo_fill_preserve(cr); + + gdk_cairo_set_source_rgba (cr, &window->details->free_stroke_color); +#else cairo_set_source_rgb (cr, (double) window->details->free_color.red / 65535, (double) window->details->free_color.green / 65535, @@ -3201,6 +3243,7 @@ paint_pie_chart (GtkWidget *widget, (double) window->details->free_stroke_color.red / 65535, (double) window->details->free_stroke_color.green / 65535, (double) window->details->free_stroke_color.blue / 65535); +#endif cairo_stroke (cr); } @@ -3362,17 +3405,28 @@ hls_to_rgb (gdouble *h, } } static void +#if GTK_CHECK_VERSION (3, 0, 0) +_pie_style_shade (GdkRGBA *a, + GdkRGBA *b, +#else _pie_style_shade (GdkColor *a, GdkColor *b, +#endif gdouble k) { gdouble red; gdouble green; gdouble blue; +#if GTK_CHECK_VERSION (3, 0, 0) + red = a->red; + green = a->green; + blue = a->blue; +#else red = (gdouble) a->red / 65535.0; green = (gdouble) a->green / 65535.0; blue = (gdouble) a->blue / 65535.0; +#endif rgb_to_hls (&red, &green, &blue); @@ -3390,9 +3444,16 @@ _pie_style_shade (GdkColor *a, hls_to_rgb (&red, &green, &blue); +#if GTK_CHECK_VERSION (3, 0, 0) + b->red = red; + b->green = green; + b->blue = blue; + b->alpha = a->alpha; +#else b->red = red * 65535.0; b->green = green * 65535.0; b->blue = blue * 65535.0; +#endif } @@ -3402,10 +3463,11 @@ create_pie_widget (FMPropertiesWindow *window) CajaFile *file; #if GTK_CHECK_VERSION (3, 0, 0) GtkGrid *grid; + GtkStyleContext *style; #else GtkTable *table; -#endif GtkStyle *style; +#endif GtkWidget *pie_canvas; GtkWidget *used_canvas; GtkWidget *used_label; @@ -3441,22 +3503,34 @@ create_pie_widget (FMPropertiesWindow *window) gtk_container_set_border_width (GTK_CONTAINER (grid), 5); gtk_grid_set_column_spacing (GTK_GRID (grid), 5); style = gtk_widget_get_style_context (GTK_WIDGET (grid)); + + if (!gtk_style_context_lookup_color (style, "chart_rgba_1", &window->details->used_color)) { #else table = GTK_TABLE (gtk_table_new (4, 3, FALSE)); style = gtk_rc_get_style (GTK_WIDGET(table)); -#endif if (!gtk_style_lookup_color (style, "chart_color_1", &window->details->used_color)) { +#endif window->details->used_color.red = USED_FILL_R; window->details->used_color.green = USED_FILL_G; window->details->used_color.blue = USED_FILL_B; +#if GTK_CHECK_VERSION (3, 0, 0) + window->details->used_color.alpha = 1; +#endif } +#if GTK_CHECK_VERSION (3, 0, 0) + if (!gtk_style_context_lookup_color (style, "chart_rgba_2", &window->details->free_color)) { +#else if (!gtk_style_lookup_color (style, "chart_color_2", &window->details->free_color)) { +#endif window->details->free_color.red = FREE_FILL_R; window->details->free_color.green = FREE_FILL_G; window->details->free_color.blue = FREE_FILL_B; +#if GTK_CHECK_VERSION (3, 0, 0) + window->details->free_color.alpha = 1; +#endif } _pie_style_shade (&window->details->used_color, &window->details->used_stroke_color, 0.7); @@ -6152,7 +6226,9 @@ create_properties_window (StartupData *startup_data) NULL); /* FIXME - HIGificiation, should be done inside GTK+ */ +#if !GTK_CHECK_VERSION (3, 0, 0) gtk_widget_ensure_style (GTK_WIDGET (window)); +#endif gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (window))), 12); gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (window))), 0); gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (window))), 12); diff --git a/src/file-manager/fm-tree-model.c b/src/file-manager/fm-tree-model.c index 504dd89a..039a1ef8 100644 --- a/src/file-manager/fm-tree-model.c +++ b/src/file-manager/fm-tree-model.c @@ -29,7 +29,11 @@ #include <config.h> #include "fm-tree-model.h" +#if GTK_CHECK_VERSION(3,0,0) +#include <eel/eel-graphic-effects.h> +#else #include <eel/eel-gdk-pixbuf-extensions.h> +#endif #include <glib/gi18n.h> #include <libcaja-private/caja-directory.h> #include <libcaja-private/caja-file-attributes.h> @@ -332,7 +336,11 @@ get_menu_icon_for_file (TreeNode *node, if (highlight) { +#if GTK_CHECK_VERSION(3,0,0) + pixbuf = eel_create_spotlight_pixbuf (retval); +#else pixbuf = eel_gdk_pixbuf_render (retval, 1, 255, 255, 0, 0); +#endif if (pixbuf != NULL) { |