Commit d8317302 authored by Cosimo Cecchi's avatar Cosimo Cecchi

window: just use nautilus_view_set_is_active()

Don't roundtrip through NautilusWindowSlot, as that's what it would do
anyway.
parent a08625ba
......@@ -119,16 +119,22 @@ nautilus_window_pane_get_slot_for_content_box (NautilusWindowPane *pane,
}
void
nautilus_window_pane_set_active (NautilusWindowPane *pane, gboolean is_active)
nautilus_window_pane_set_active (NautilusWindowPane *pane,
gboolean is_active)
{
NautilusView *view;
if (is_active == pane->is_active) {
return;
}
pane->is_active = is_active;
/* notify the current slot about its activity state (so that it can e.g. modify the bg color) */
nautilus_window_slot_is_in_active_pane (pane->active_slot, is_active);
/* notify the current view about its activity state */
if (pane->active_slot != NULL) {
view = nautilus_window_slot_get_current_view (pane->active_slot);
nautilus_view_set_is_active (view, is_active);
}
EEL_CALL_METHOD (NAUTILUS_WINDOW_PANE_CLASS, pane,
set_active, (pane, is_active));
......
......@@ -383,25 +383,6 @@ nautilus_window_slot_update_icon (NautilusWindowSlot *slot)
}
}
void
nautilus_window_slot_is_in_active_pane (NautilusWindowSlot *slot,
gboolean is_active)
{
/* NULL is valid, and happens during init */
if (!slot) {
return;
}
/* it may also be that the content is not a valid directory view during init */
if (slot->content_view != NULL) {
nautilus_view_set_is_active (slot->content_view, is_active);
}
if (slot->new_content_view != NULL) {
nautilus_view_set_is_active (slot->new_content_view, is_active);
}
}
void
nautilus_window_slot_set_content_view_widget (NautilusWindowSlot *slot,
NautilusView *new_view)
......
......@@ -175,8 +175,6 @@ void nautilus_window_slot_add_extra_location_widget (NautilusWindowSlot *
GtkWidget *widget);
void nautilus_window_slot_remove_extra_location_widgets (NautilusWindowSlot *slot);
void nautilus_window_slot_is_in_active_pane (NautilusWindowSlot *slot, gboolean is_active);
NautilusView * nautilus_window_slot_get_current_view (NautilusWindowSlot *slot);
char * nautilus_window_slot_get_current_uri (NautilusWindowSlot *slot);
NautilusWindow * nautilus_window_slot_get_window (NautilusWindowSlot *slot);
......
......@@ -586,9 +586,7 @@ nautilus_window_view_visible (NautilusWindow *window,
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
slot = nautilus_window_get_slot_for_view (window, view);
/* Ensure we got the right active state for newly added panes */
nautilus_window_slot_is_in_active_pane (slot, slot->pane->is_active);
nautilus_view_set_is_active (view, slot->pane->is_active);
if (slot->visible) {
return;
......
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