Commit ac781042 authored by Cosimo Cecchi's avatar Cosimo Cecchi

view: add a shadow to the view when not showing tabs

When we are showing tabs, the notebook will take care of drawing a
border around the view.
When there is only one view, since we disable tabs from the notebook,
the view needs to draw a shadow instead, or we won't draw any shadow at
all. In the past this wasn't a problem because the toolbar used to draw
a stroke for us.
parent 888d712d
......@@ -2624,7 +2624,6 @@ nautilus_view_init (NautilusView *view)
gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW (view), NULL);
gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW (view), NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view), GTK_SHADOW_NONE);
gtk_style_context_set_junction_sides (gtk_widget_get_style_context (GTK_WIDGET (view)),
......@@ -9607,6 +9606,26 @@ real_get_selected_icon_locations (NautilusView *view)
return g_array_new (FALSE, TRUE, sizeof (GdkPoint));
static void
window_slots_changed (NautilusWindow *window,
NautilusWindowSlot *slot,
NautilusView *view)
GList *slots;
slots = nautilus_window_get_slots (window);
/* Only add a shadow to the scrolled window when we're in a tabless
* notebook, since when the notebook has tabs, it will draw its own
* border.
if (g_list_length (slots) > 1) {
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view), GTK_SHADOW_NONE);
} else {
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view), GTK_SHADOW_IN);
static void
nautilus_view_set_property (GObject *object,
guint prop_id,
......@@ -9636,6 +9655,14 @@ nautilus_view_set_property (GObject *object,
"inactive", G_CALLBACK (slot_inactive),
directory_view, 0);
g_signal_connect_object (directory_view->details->window,
"slot-added", G_CALLBACK (window_slots_changed),
directory_view, 0);
g_signal_connect_object (directory_view->details->window,
"slot-removed", G_CALLBACK (window_slots_changed),
directory_view, 0);
window_slots_changed (window, slot, directory_view);
g_signal_connect_object (directory_view->details->window,
"hidden-files-mode-changed", G_CALLBACK (hidden_files_mode_changed),
directory_view, 0);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment