Commit 689fd8e7 authored by Holger Berndt's avatar Holger Berndt Committed by Alexander Larsson

Make location bar more reactive: path bar, toggle button and zoom control

The buttons in the directory button bar are made inactive when the
corresponding pane is inactive. This means that the buttons have an
insensitive appearance, but are in fact clickable. Clicking on them
will make the corresponding pane active while changing into the
respective directory.

This required the pathbar to export the button widget, done with the
new function nautilus_path_bar_get_button_from_button_list_entry().
parent 531ff030
......@@ -50,6 +50,8 @@ G_DEFINE_TYPE (NautilusNavigationWindowPane,
void
nautilus_navigation_window_pane_set_active (NautilusNavigationWindowPane *pane, gboolean is_active)
{
GList *walk;
if (NAUTILUS_WINDOW_PANE (pane)->is_active == is_active) {
return;
}
......@@ -58,7 +60,10 @@ nautilus_navigation_window_pane_set_active (NautilusNavigationWindowPane *pane,
/* location button */
gtk_widget_set_sensitive (gtk_bin_get_child (GTK_BIN (pane->location_button)), is_active);
/* hhb: TODO: deal with path bar */
/* path bar */
for (walk = NAUTILUS_PATH_BAR (pane->path_bar)->button_list; walk; walk = walk->next) {
gtk_widget_set_sensitive (gtk_bin_get_child (GTK_BIN (nautilus_path_bar_get_button_from_button_list_entry (walk->data))), is_active);
}
/* hhb: TODO: deal with navigation bar (manual entry) */
}
......@@ -247,6 +252,8 @@ path_bar_button_pressed_callback (GtkWidget *widget,
GFile *location;
char *uri;
nautilus_window_set_active_pane (NAUTILUS_WINDOW_PANE (pane)->window, NAUTILUS_WINDOW_PANE (pane));
g_object_set_data (G_OBJECT (widget), "handle-button-release",
GINT_TO_POINTER (TRUE));
......
......@@ -1893,3 +1893,9 @@ nautilus_path_bar_down (NautilusPathBar *path_bar)
}
}
}
GtkWidget *
nautilus_path_bar_get_button_from_button_list_entry (gpointer entry)
{
return BUTTON_DATA(entry)->button;
}
......@@ -85,4 +85,6 @@ void nautilus_path_bar_clear_buttons (NautilusPathBar *path_bar);
void nautilus_path_bar_up (NautilusPathBar *path_bar);
void nautilus_path_bar_down (NautilusPathBar *path_bar);
GtkWidget * nautilus_path_bar_get_button_from_button_list_entry (gpointer entry);
#endif /* NAUTILUS_PATHBAR_H */
......@@ -945,3 +945,11 @@ nautilus_zoom_control_accessible_get_type (void)
return type;
}
void
nautilus_zoom_control_set_active_appearance (NautilusZoomControl *zoom_control, gboolean is_active)
{
gtk_widget_set_sensitive (gtk_bin_get_child (GTK_BIN (zoom_control->details->zoom_in)), is_active);
gtk_widget_set_sensitive (gtk_bin_get_child (GTK_BIN (zoom_control->details->zoom_out)), is_active);
gtk_widget_set_sensitive (zoom_control->details->zoom_label, is_active);
}
......@@ -84,4 +84,6 @@ gboolean nautilus_zoom_control_has_max_zoom_level (NautilusZoomControl
gboolean nautilus_zoom_control_can_zoom_in (NautilusZoomControl *zoom_control);
gboolean nautilus_zoom_control_can_zoom_out (NautilusZoomControl *zoom_control);
void nautilus_zoom_control_set_active_appearance (NautilusZoomControl *zoom_control, gboolean is_active);
#endif /* NAUTILUS_ZOOM_CONTROL_H */
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