icon-container: use the "rubberband" style class for the selection item

Instead of using a custom style property.
This commit is contained in:
Cosimo Cecchi 2011-09-07 14:55:16 -04:00
parent 8b676a68b6
commit ca7f81e2e9
2 changed files with 10 additions and 31 deletions

View file

@ -1,9 +1,5 @@
@define-color cluebar_color #729fcf; @define-color cluebar_color #729fcf;
* {
-NautilusIconContainer-selection-box-rgba: @selected_bg_color;
}
NautilusTrashBar.info, NautilusTrashBar.info,
NautilusXContentBar.info, NautilusXContentBar.info,
NautilusSearchBar.info, NautilusSearchBar.info,

View file

@ -2610,10 +2610,10 @@ start_rubberbanding (NautilusIconContainer *container,
AtkObject *accessible; AtkObject *accessible;
NautilusIconContainerDetails *details; NautilusIconContainerDetails *details;
NautilusIconRubberbandInfo *band_info; NautilusIconRubberbandInfo *band_info;
GdkRGBA *fill_color_gdk, outline, color; GdkRGBA bg_color, border_color;
GList *p; GList *p;
NautilusIcon *icon; NautilusIcon *icon;
GtkStyleContext *style; GtkStyleContext *context;
details = container->details; details = container->details;
band_info = &details->rubberband_info; band_info = &details->rubberband_info;
@ -2630,23 +2630,14 @@ start_rubberbanding (NautilusIconContainer *container,
(EEL_CANVAS (container), event->x, event->y, (EEL_CANVAS (container), event->x, event->y,
&band_info->start_x, &band_info->start_y); &band_info->start_x, &band_info->start_y);
style = gtk_widget_get_style_context (GTK_WIDGET (container)); context = gtk_widget_get_style_context (GTK_WIDGET (container));
gtk_style_context_get_style (style, gtk_style_context_save (context);
"selection_box_rgba", &fill_color_gdk, gtk_style_context_add_class (context, GTK_STYLE_CLASS_RUBBERBAND);
NULL);
if (!fill_color_gdk) { gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg_color);
gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED, gtk_style_context_get_border_color (context, GTK_STATE_FLAG_NORMAL, &border_color);
&color);
fill_color_gdk = gdk_rgba_copy (&color);
}
if (fill_color_gdk->alpha == 1) { gtk_style_context_restore (context);
fill_color_gdk->alpha = 0.25;
}
outline = *fill_color_gdk;
eel_make_color_inactive (&outline);
band_info->selection_rectangle = eel_canvas_item_new band_info->selection_rectangle = eel_canvas_item_new
(eel_canvas_root (eel_canvas_root
@ -2656,13 +2647,11 @@ start_rubberbanding (NautilusIconContainer *container,
"y1", band_info->start_y, "y1", band_info->start_y,
"x2", band_info->start_x, "x2", band_info->start_x,
"y2", band_info->start_y, "y2", band_info->start_y,
"fill_color_rgba", fill_color_gdk, "fill_color_rgba", &bg_color,
"outline_color_rgba", &outline, "outline_color_rgba", &border_color,
"width_pixels", 1, "width_pixels", 1,
NULL); NULL);
gdk_rgba_free (fill_color_gdk);
accessible = atk_gobject_accessible_for_object accessible = atk_gobject_accessible_for_object
(G_OBJECT (band_info->selection_rectangle)); (G_OBJECT (band_info->selection_rectangle));
atk_object_set_name (accessible, "selection"); atk_object_set_name (accessible, "selection");
@ -6061,12 +6050,6 @@ nautilus_icon_container_class_init (NautilusIconContainerClass *class)
class->start_interactive_search = nautilus_icon_container_start_interactive_search; class->start_interactive_search = nautilus_icon_container_start_interactive_search;
gtk_widget_class_install_style_property (widget_class,
g_param_spec_boxed ("selection_box_rgba",
"Selection Box RGBA",
"Color of the selection box",
GDK_TYPE_RGBA,
G_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class, gtk_widget_class_install_style_property (widget_class,
g_param_spec_boolean ("activate_prelight_icon_label", g_param_spec_boolean ("activate_prelight_icon_label",
"Activate Prelight Icon Label", "Activate Prelight Icon Label",