33
33
#include "nautilus-icon-private.h"
34
34
#include "nautilus-lib-self-check-functions.h"
35
35
#include "nautilus-selection-canvas-item.h"
36
#include "nautilus-marshal.h"
37
36
#include <atk/atkaction.h>
38
37
#include <eel/eel-accessibility.h>
39
38
#include <eel/eel-vfs-extensions.h>
145
144
static GType nautilus_icon_container_accessible_get_type (void);
146
static void preview_selected_items (NautilusIconContainer *container);
147
147
static void activate_selected_items (NautilusIconContainer *container);
148
148
static void activate_selected_items_alternate (NautilusIconContainer *container,
149
149
NautilusIcon *icon);
150
static void nautilus_icon_container_theme_changed (gpointer user_data);
151
150
static void compute_stretch (StretchState *start,
152
151
StretchState *current);
153
152
static NautilusIcon *get_first_selected_icon (NautilusIconContainer *container);
2612
2610
AtkObject *accessible;
2613
2611
NautilusIconContainerDetails *details;
2614
2612
NautilusIconRubberbandInfo *band_info;
2615
GdkRGBA *fill_color_gdk, outline, color;
2613
GdkRGBA bg_color, border_color;
2617
2615
NautilusIcon *icon;
2618
GtkStyleContext *style;
2616
GtkStyleContext *context;
2620
2618
details = container->details;
2621
2619
band_info = &details->rubberband_info;
2632
2630
(EEL_CANVAS (container), event->x, event->y,
2633
2631
&band_info->start_x, &band_info->start_y);
2635
style = gtk_widget_get_style_context (GTK_WIDGET (container));
2636
gtk_style_context_get_style (style,
2637
"selection_box_rgba", &fill_color_gdk,
2640
if (!fill_color_gdk) {
2641
gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED,
2643
fill_color_gdk = gdk_rgba_copy (&color);
2646
if (fill_color_gdk->alpha == 1) {
2647
fill_color_gdk->alpha = 0.25;
2650
outline = *fill_color_gdk;
2651
eel_make_color_inactive (&outline);
2633
context = gtk_widget_get_style_context (GTK_WIDGET (container));
2634
gtk_style_context_save (context);
2635
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RUBBERBAND);
2637
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &bg_color);
2638
gtk_style_context_get_border_color (context, GTK_STATE_FLAG_NORMAL, &border_color);
2640
gtk_style_context_restore (context);
2653
2642
band_info->selection_rectangle = eel_canvas_item_new
2654
2643
(eel_canvas_root
2658
2647
"y1", band_info->start_y,
2659
2648
"x2", band_info->start_x,
2660
2649
"y2", band_info->start_y,
2661
"fill_color_rgba", fill_color_gdk,
2662
"outline_color_rgba", &outline,
2650
"fill_color_rgba", &bg_color,
2651
"outline_color_rgba", &border_color,
2663
2652
"width_pixels", 1,
2666
gdk_rgba_free (fill_color_gdk);
2668
2655
accessible = atk_gobject_accessible_for_object
2669
2656
(G_OBJECT (band_info->selection_rectangle));
2670
2657
atk_object_set_name (accessible, "selection");
3990
3977
gtk_widget_destroy (container->details->search_window);
3991
3978
container->details->search_window = NULL;
3992
3979
container->details->search_entry = NULL;
3993
if (container->details->typeselect_flush_timeout) {
3994
g_source_remove (container->details->typeselect_flush_timeout);
3995
container->details->typeselect_flush_timeout = 0;
3982
remove_search_entry_timeout (container);
4000
3984
GTK_WIDGET_CLASS (nautilus_icon_container_parent_class)->destroy (object);
4088
static GtkSizeRequestMode
4089
get_request_mode (GtkWidget *widget)
4091
/* Don't trade size at all, since we get whatever we get anyway. */
4092
return GTK_SIZE_REQUEST_CONSTANT_SIZE;
4095
/* We need to implement these since the GtkScrolledWindow uses them
4096
to guess whether to show scrollbars or not, and if we don't report
4097
anything it'll tend to get it wrong causing double calls
4098
to size_allocate (at different sizes) during its size allocation. */
4100
get_prefered_width (GtkWidget *widget,
4104
EelCanvasGroup *root;
4109
root = eel_canvas_root (EEL_CANVAS (widget));
4110
eel_canvas_item_get_bounds (EEL_CANVAS_ITEM (root),
4111
&x1, NULL, &x2, NULL);
4112
eel_canvas_w2c (EEL_CANVAS (widget), x1, 0, &cx1, NULL);
4113
eel_canvas_w2c (EEL_CANVAS (widget), x2, 0, &cx2, NULL);
4117
*natural_size = width;
4120
*minimum_size = width;
4125
get_prefered_height (GtkWidget *widget,
4129
EelCanvasGroup *root;
4134
root = eel_canvas_root (EEL_CANVAS (widget));
4135
eel_canvas_item_get_bounds (EEL_CANVAS_ITEM (root),
4136
NULL, &y1, NULL, &y2);
4137
eel_canvas_w2c (EEL_CANVAS (widget), 0, y1, NULL, &cy1);
4138
eel_canvas_w2c (EEL_CANVAS (widget), 0, y2, NULL, &cy2);
4142
*natural_size = height;
4145
*minimum_size = height;
4105
4150
setup_background (NautilusIconContainer *container)
4176
4220
container = NAUTILUS_ICON_CONTAINER (widget);
4178
4222
nautilus_icon_dnd_fini (container);
4180
if (container->details->typeselect_flush_timeout) {
4181
g_source_remove (container->details->typeselect_flush_timeout);
4182
container->details->typeselect_flush_timeout = 0;
4223
remove_search_entry_timeout (container);
4185
4225
GTK_WIDGET_CLASS (nautilus_icon_container_parent_class)->unrealize (widget);
4792
4830
y = cont_y + cont_height;
4795
gtk_window_move (GTK_WINDOW (search_dialog), x, y);
4799
nautilus_icon_container_real_search_enable_popdown (gpointer data)
4801
NautilusIconContainer *container = (NautilusIconContainer *)data;
4803
container->details->disable_popdown = FALSE;
4805
g_object_unref (container);
4811
nautilus_icon_container_search_enable_popdown (GtkWidget *widget,
4814
NautilusIconContainer *container = (NautilusIconContainer *) data;
4816
g_object_ref (container);
4817
g_timeout_add (200, nautilus_icon_container_real_search_enable_popdown, data);
4821
nautilus_icon_container_search_disable_popdown (GtkEntry *entry,
4825
NautilusIconContainer *container = (NautilusIconContainer *) data;
4827
container->details->disable_popdown = TRUE;
4828
g_signal_connect (menu, "hide",
4829
G_CALLBACK (nautilus_icon_container_search_enable_popdown),
4833
gdk_window_move (gtk_widget_get_window (search_dialog), x, y);
4833
4836
/* Cut and paste from gtkwindow.c */
4859
4862
nautilus_icon_container_search_dialog_hide (GtkWidget *search_dialog,
4860
4863
NautilusIconContainer *container)
4862
if (container->details->disable_popdown) {
4866
4865
if (container->details->search_entry_changed_id) {
4867
4866
g_signal_handler_disconnect (container->details->search_entry,
4868
4867
container->details->search_entry_changed_id);
4869
4868
container->details->search_entry_changed_id = 0;
4871
if (container->details->typeselect_flush_timeout) {
4872
g_source_remove (container->details->typeselect_flush_timeout);
4873
container->details->typeselect_flush_timeout = 0;
4871
remove_search_entry_timeout (container);
4876
4873
/* send focus-in event */
4877
4874
send_focus_change (GTK_WIDGET (container->details->search_entry), FALSE);
4882
4879
static gboolean
4883
nautilus_icon_container_search_entry_flush_timeout (NautilusIconContainer *container)
4880
nautilus_icon_container_search_entry_flush_timeout (gpointer data)
4882
NautilusIconContainer *container = data;
4884
container->details->typeselect_flush_timeout = 0;
4885
4885
nautilus_icon_container_search_dialog_hide (container->details->search_window, container);
4891
add_search_entry_timeout (NautilusIconContainer *container)
4893
container->details->typeselect_flush_timeout =
4894
g_timeout_add_seconds (NAUTILUS_ICON_CONTAINER_SEARCH_DIALOG_TIMEOUT,
4895
nautilus_icon_container_search_entry_flush_timeout,
4900
remove_search_entry_timeout (NautilusIconContainer *container)
4902
if (container->details->typeselect_flush_timeout) {
4903
g_source_remove (container->details->typeselect_flush_timeout);
4904
container->details->typeselect_flush_timeout = 0;
4909
reset_search_entry_timeout (NautilusIconContainer *container)
4911
remove_search_entry_timeout (container);
4912
add_search_entry_timeout (container);
4890
4915
/* Because we're visible but offscreen, we just set a flag in the preedit
4896
4921
NautilusIconContainer *container)
4898
4923
container->details->imcontext_changed = 1;
4899
if (container->details->typeselect_flush_timeout) {
4900
g_source_remove (container->details->typeselect_flush_timeout);
4901
container->details->typeselect_flush_timeout =
4902
g_timeout_add_seconds (NAUTILUS_ICON_CONTAINER_SEARCH_DIALOG_TIMEOUT,
4903
(GSourceFunc) nautilus_icon_container_search_entry_flush_timeout,
4924
reset_search_entry_timeout (container);
4962
nautilus_icon_container_search_entry_button_press_event (GtkWidget *widget,
4963
GdkEventButton *event,
4964
NautilusIconContainer *container)
4966
reset_search_entry_timeout (container);
4972
nautilus_icon_container_search_populate_popup (GtkEntry *entry,
4974
NautilusIconContainer *container)
4976
remove_search_entry_timeout (container);
4977
g_signal_connect_swapped (menu, "hide",
4978
G_CALLBACK (add_search_entry_timeout), container);
4947
4982
nautilus_icon_container_get_icon_text (NautilusIconContainer *container,
4948
4983
NautilusIconData *data,
5093
/* renew the flush timeout */
5094
if (retval && container->details->typeselect_flush_timeout) {
5095
g_source_remove (container->details->typeselect_flush_timeout);
5096
container->details->typeselect_flush_timeout =
5097
g_timeout_add_seconds (NAUTILUS_ICON_CONTAINER_SEARCH_DIALOG_TIMEOUT,
5098
(GSourceFunc) nautilus_icon_container_search_entry_flush_timeout,
5128
reset_search_entry_timeout (container);
5154
/* renew the flush timeout */
5155
if (retval && container->details->typeselect_flush_timeout) {
5156
g_source_remove (container->details->typeselect_flush_timeout);
5157
container->details->typeselect_flush_timeout =
5158
g_timeout_add_seconds (NAUTILUS_ICON_CONTAINER_SEARCH_DIALOG_TIMEOUT,
5159
(GSourceFunc) nautilus_icon_container_search_entry_flush_timeout,
5182
reset_search_entry_timeout (container);
5181
5202
unselect_all (container);
5182
if (container->details->typeselect_flush_timeout)
5184
g_source_remove (container->details->typeselect_flush_timeout);
5185
container->details->typeselect_flush_timeout =
5186
g_timeout_add_seconds (NAUTILUS_ICON_CONTAINER_SEARCH_DIALOG_TIMEOUT,
5187
(GSourceFunc) nautilus_icon_container_search_entry_flush_timeout,
5203
reset_search_entry_timeout (container);
5232
5246
gtk_widget_show (frame);
5233
5247
gtk_container_add (GTK_CONTAINER (container->details->search_window), frame);
5235
vbox = gtk_vbox_new (FALSE, 0);
5249
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
5236
5250
gtk_widget_show (vbox);
5237
5251
gtk_container_add (GTK_CONTAINER (frame), vbox);
5238
5252
gtk_container_set_border_width (GTK_CONTAINER (vbox), 3);
5240
5254
/* add entry */
5241
5255
container->details->search_entry = gtk_entry_new ();
5242
5256
gtk_widget_show (container->details->search_entry);
5243
g_signal_connect (container->details->search_entry, "populate_popup",
5244
G_CALLBACK (nautilus_icon_container_search_disable_popdown),
5257
g_signal_connect (container->details->search_entry, "populate-popup",
5258
G_CALLBACK (nautilus_icon_container_search_populate_popup),
5246
5260
g_signal_connect (container->details->search_entry, "activate",
5247
5261
G_CALLBACK (nautilus_icon_container_search_activate),
5249
g_signal_connect (container->details->search_entry,
5263
g_signal_connect (container->details->search_entry, "preedit-changed",
5251
5264
G_CALLBACK (nautilus_icon_container_search_preedit_changed),
5266
g_signal_connect (container->details->search_entry, "button-press-event",
5267
G_CALLBACK (nautilus_icon_container_search_entry_button_press_event),
5253
5269
gtk_container_add (GTK_CONTAINER (vbox), container->details->search_entry);
5255
5271
gtk_widget_realize (container->details->search_entry);
5259
5275
* started this by typing the start_interactive_search keybinding. Otherwise, it came from
5261
5277
static gboolean
5262
nautilus_icon_container_real_start_interactive_search (NautilusIconContainer *container,
5263
gboolean keybinding)
5278
nautilus_icon_container_start_interactive_search (NautilusIconContainer *container)
5265
5280
/* We only start interactive search if we have focus. If one of our
5266
5281
* children have focus, we don't want to start the search.
5295
container->details->typeselect_flush_timeout =
5296
g_timeout_add_seconds (NAUTILUS_ICON_CONTAINER_SEARCH_DIALOG_TIMEOUT,
5297
(GSourceFunc) nautilus_icon_container_search_entry_flush_timeout,
5300
5306
/* Grab focus will select all the text. We don't want that to happen, so we
5301
5307
* call the parent instance and bypass the selection change. This is probably
5302
5308
* really non-kosher. */
5677
5681
g_cclosure_marshal_VOID__POINTER,
5678
5682
G_TYPE_NONE, 1,
5679
5683
G_TYPE_POINTER);
5684
signals[ACTIVATE_PREVIEWER]
5685
= g_signal_new ("activate_previewer",
5686
G_TYPE_FROM_CLASS (class),
5688
G_STRUCT_OFFSET (NautilusIconContainerClass,
5689
activate_previewer),
5691
g_cclosure_marshal_generic,
5693
G_TYPE_POINTER, G_TYPE_POINTER);
5680
5694
signals[CONTEXT_CLICK_SELECTION]
5681
5695
= g_signal_new ("context_click_selection",
5682
5696
G_TYPE_FROM_CLASS (class),
5714
5728
G_STRUCT_OFFSET (NautilusIconContainerClass,
5715
5729
icon_position_changed),
5717
nautilus_marshal_VOID__POINTER_POINTER,
5731
g_cclosure_marshal_generic,
5718
5732
G_TYPE_NONE, 2,
5719
5733
G_TYPE_POINTER,
5720
5734
G_TYPE_POINTER);
5721
signals[ICON_TEXT_CHANGED]
5722
= g_signal_new ("icon_text_changed",
5723
G_TYPE_FROM_CLASS (class),
5725
G_STRUCT_OFFSET (NautilusIconContainerClass,
5728
nautilus_marshal_VOID__POINTER_STRING,
5732
5735
signals[ICON_STRETCH_STARTED]
5733
5736
= g_signal_new ("icon_stretch_started",
5734
5737
G_TYPE_FROM_CLASS (class),
5749
5752
g_cclosure_marshal_VOID__POINTER,
5750
5753
G_TYPE_NONE, 1,
5751
5754
G_TYPE_POINTER);
5752
signals[RENAMING_ICON]
5753
= g_signal_new ("renaming_icon",
5755
signals[ICON_RENAME_STARTED]
5756
= g_signal_new ("icon_rename_started",
5754
5757
G_TYPE_FROM_CLASS (class),
5755
5758
G_SIGNAL_RUN_LAST,
5756
5759
G_STRUCT_OFFSET (NautilusIconContainerClass,
5760
icon_rename_started),
5759
5762
g_cclosure_marshal_VOID__POINTER,
5760
5763
G_TYPE_NONE, 1,
5761
5764
G_TYPE_POINTER);
5765
signals[ICON_RENAME_ENDED]
5766
= g_signal_new ("icon_rename_ended",
5767
G_TYPE_FROM_CLASS (class),
5769
G_STRUCT_OFFSET (NautilusIconContainerClass,
5772
g_cclosure_marshal_generic,
5762
5776
signals[GET_ICON_URI]
5763
5777
= g_signal_new ("get_icon_uri",
5764
5778
G_TYPE_FROM_CLASS (class),
5915
5929
g_cclosure_marshal_VOID__VOID,
5916
5930
G_TYPE_NONE, 0);
5918
= g_signal_new ("preview",
5919
G_TYPE_FROM_CLASS (class),
5921
G_STRUCT_OFFSET (NautilusIconContainerClass,
5924
nautilus_marshal_INT__POINTER_BOOLEAN,
5928
5931
signals[BAND_SELECT_STARTED]
5929
5932
= g_signal_new ("band_select_started",
5930
5933
G_TYPE_FROM_CLASS (class),
5972
5975
g_cclosure_marshal_VOID__VOID,
5973
5976
G_TYPE_NONE, 0);
5975
signals[START_INTERACTIVE_SEARCH]
5976
= g_signal_new ("start_interactive_search",
5977
G_TYPE_FROM_CLASS (class),
5978
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
5979
G_STRUCT_OFFSET (NautilusIconContainerClass,
5980
start_interactive_search),
5982
nautilus_marshal_BOOLEAN__VOID,
5985
5978
/* GtkWidget class. */
5987
5980
widget_class = GTK_WIDGET_CLASS (class);
5988
5981
widget_class->destroy = destroy;
5989
5982
widget_class->size_allocate = size_allocate;
5983
widget_class->get_request_mode = get_request_mode;
5984
widget_class->get_preferred_width = get_prefered_width;
5985
widget_class->get_preferred_height = get_prefered_height;
5990
5986
widget_class->realize = realize;
5991
5987
widget_class->unrealize = unrealize;
5992
5988
widget_class->button_press_event = button_press_event;
6001
5997
canvas_class = EEL_CANVAS_CLASS (class);
6002
5998
canvas_class->draw_background = draw_canvas_background;
6004
class->start_interactive_search = nautilus_icon_container_start_interactive_search;
6006
gtk_widget_class_install_style_property (widget_class,
6007
g_param_spec_boxed ("selection_box_rgba",
6008
"Selection Box RGBA",
6009
"Color of the selection box",
6012
6000
gtk_widget_class_install_style_property (widget_class,
6013
6001
g_param_spec_boolean ("activate_prelight_icon_label",
6014
6002
"Activate Prelight Icon Label",
6015
6003
"Whether icon labels should make use of its prelight color in prelight state",
6017
6005
G_PARAM_READABLE));
6020
binding_set = gtk_binding_set_by_class (class);
6022
gtk_binding_entry_add_signal (binding_set, GDK_KEY_f, GDK_CONTROL_MASK, "start_interactive_search", 0);
6023
gtk_binding_entry_add_signal (binding_set, GDK_KEY_F, GDK_CONTROL_MASK, "start_interactive_search", 0);
6167
6149
g_signal_connect (container, "focus-out-event",
6168
6150
G_CALLBACK (handle_focus_out_event), NULL);
6170
/* read in theme-dependent data */
6171
nautilus_icon_container_theme_changed (container);
6173
6152
if (!setup_prefs) {
6174
6153
g_signal_connect_swapped (nautilus_icon_view_preferences,
6175
6154
"changed::" NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT,
6654
preview_selected_items (NautilusIconContainer *container)
6660
g_return_if_fail (NAUTILUS_IS_ICON_CONTAINER (container));
6662
selection = nautilus_icon_container_get_selection (container);
6663
locations = nautilus_icon_container_get_selected_icon_locations (container);
6665
for (idx = 0; idx < locations->len; idx++) {
6666
GdkPoint *point = &(g_array_index (locations, GdkPoint, idx));
6667
gint scroll_x, scroll_y;
6669
eel_canvas_get_scroll_offsets (EEL_CANVAS (container),
6670
&scroll_x, &scroll_y);
6672
point->x -= scroll_x;
6673
point->y -= scroll_y;
6676
if (selection != NULL) {
6677
g_signal_emit (container,
6678
signals[ACTIVATE_PREVIEWER], 0,
6679
selection, locations);
6681
g_list_free (selection);
6675
6685
activate_selected_items_alternate (NautilusIconContainer *container,
6676
6686
NautilusIcon *icon)
8253
8263
g_signal_emit (container,
8254
signals[RENAMING_ICON], 0,
8264
signals[ICON_RENAME_STARTED], 0,
8255
8265
GTK_EDITABLE (details->rename_widget));
8257
8267
nautilus_icon_container_update_icon (container, icon);
8290
8300
/* Verify that text has been modified before signalling change. */
8291
8301
changed_text = eel_editable_label_get_text (EEL_EDITABLE_LABEL (container->details->rename_widget));
8292
if (strcmp (container->details->original_text, changed_text) != 0) {
8293
g_signal_emit (container,
8294
signals[ICON_TEXT_CHANGED], 0,
8302
if (strcmp (container->details->original_text, changed_text) == 0) {
8303
changed_text = NULL;
8307
g_signal_emit (container,
8308
signals[ICON_RENAME_ENDED], 0,
8300
8312
gtk_widget_hide (container->details->rename_widget);
8302
8313
g_free (container->details->original_text);
8306
/* emit preview signal, called by the canvas item */
8308
nautilus_icon_container_emit_preview_signal (NautilusIconContainer *icon_container,
8310
gboolean start_flag)
8314
g_return_val_if_fail (NAUTILUS_IS_ICON_CONTAINER (icon_container), FALSE);
8315
g_return_val_if_fail (icon != NULL, FALSE);
8316
g_return_val_if_fail (start_flag == FALSE || start_flag == TRUE, FALSE);
8319
g_signal_emit (icon_container,
8320
signals[PREVIEW], 0,
8358
8346
container->details->single_click_mode = single_click_mode;
8362
/* update the label color when the background changes */
8365
nautilus_icon_container_get_label_color (NautilusIconContainer *container,
8368
gboolean is_highlight,
8375
if (gtk_widget_has_focus (GTK_WIDGET (container))) {
8376
idx = LABEL_COLOR_HIGHLIGHT;
8378
idx = LABEL_COLOR_ACTIVE;
8382
idx = LABEL_COLOR_PRELIGHT;
8389
if (gtk_widget_has_focus (GTK_WIDGET (container))) {
8390
idx = LABEL_INFO_COLOR_HIGHLIGHT;
8392
idx = LABEL_INFO_COLOR_ACTIVE;
8395
idx = LABEL_INFO_COLOR;
8400
*color = container->details->label_colors[idx];
8405
setup_gc_with_fg (NautilusIconContainer *container, int idx, GdkRGBA *color)
8407
container->details->label_colors[idx] = *color;
8411
setup_label_gcs (NautilusIconContainer *container)
8414
GtkStyleContext *style;
8417
if (!gtk_widget_get_realized (GTK_WIDGET (container)))
8420
widget = GTK_WIDGET (container);
8422
g_assert (NAUTILUS_IS_ICON_CONTAINER (container));
8424
/* read the info colors from the current theme; use a reasonable default if undefined */
8425
style = gtk_widget_get_style_context (widget);
8427
gtk_style_context_get_color (style,
8428
GTK_STATE_FLAG_SELECTED,
8430
setup_gc_with_fg (container, LABEL_COLOR_HIGHLIGHT, &color);
8431
setup_gc_with_fg (container, LABEL_INFO_COLOR_HIGHLIGHT, &color);
8434
gtk_style_context_get_color (style, GTK_STATE_FLAG_ACTIVE, &color);
8435
setup_gc_with_fg (container, LABEL_COLOR_ACTIVE, &color);
8436
setup_gc_with_fg (container, LABEL_INFO_COLOR_ACTIVE, &color);
8438
gtk_style_context_get_color (style, GTK_STATE_FLAG_PRELIGHT, &color);
8439
setup_gc_with_fg (container, LABEL_COLOR_PRELIGHT, &color);
8441
gtk_style_context_get_color (style, GTK_STATE_FLAG_INSENSITIVE, &color);
8442
setup_gc_with_fg (container, LABEL_INFO_COLOR,
8445
if (!nautilus_icon_container_get_is_desktop (container)) {
8446
gtk_style_context_get_color (style, GTK_STATE_FLAG_NORMAL, &color);
8447
setup_gc_with_fg (container, LABEL_COLOR, &color);
8451
gdk_rgba_parse (&tmp, "#EFEFEF");
8452
setup_gc_with_fg (container, LABEL_COLOR, &tmp);
8456
8349
/* Return if the icon container is a fixed size */
8458
8351
nautilus_icon_container_get_is_fixed_size (NautilusIconContainer *container)
8523
8423
/* handle theme changes */
8526
nautilus_icon_container_theme_changed (gpointer user_data)
8528
NautilusIconContainer *container;
8529
GtkStyleContext *style;
8532
container = NAUTILUS_ICON_CONTAINER (user_data);
8533
style = gtk_widget_get_style_context (GTK_WIDGET (container));
8535
gtk_style_context_get_background_color (style, GTK_STATE_FLAG_SELECTED, &color);
8536
container->details->highlight_color_rgba = color;
8538
gtk_style_context_get_background_color (style, GTK_STATE_FLAG_ACTIVE, &color);
8539
container->details->active_color_rgba = color;
8541
gtk_style_context_get_background_color (style, GTK_STATE_FLAG_PRELIGHT, &color);
8542
container->details->prelight_color_rgba = color;
8544
gtk_style_context_get_background_color (style, GTK_STATE_FLAG_NORMAL, &color);
8545
container->details->normal_color_rgba = color;
8547
setup_label_gcs (container);
8551
8426
nautilus_icon_container_set_font (NautilusIconContainer *container,
8552
8427
const char *font)