summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Berndt <berndth@gmx.de>2009-06-11 17:46:08 +0200
committerAlexander Larsson <alexl@redhat.com>2009-12-10 18:06:36 +0100
commitc3da9152ce3efadbeaf92340ca832af6dbfc6266 (patch)
treebc3597b8fb020f249184745909ee4fff16064f67
parent689fd8e7ac943f1bed48dc0f6aad4b0e418e1005 (diff)
downloadnautilus-c3da9152ce3efadbeaf92340ca832af6dbfc6266.tar.gz
Make location bar more reactive, part 2: navigation bar
Followup to the last commit: The location bar of the inactive pane now has an insensitive apprearance, but is in fact clickable/focusable. A click makes the corresponding pane active via the focus-in event of the entry widget.
-rw-r--r--src/nautilus-location-bar.c17
-rw-r--r--src/nautilus-location-bar.h2
-rw-r--r--src/nautilus-navigation-window-pane.c3
3 files changed, 21 insertions, 1 deletions
diff --git a/src/nautilus-location-bar.c b/src/nautilus-location-bar.c
index 178ba03c2..52a618d25 100644
--- a/src/nautilus-location-bar.c
+++ b/src/nautilus-location-bar.c
@@ -588,6 +588,23 @@ nautilus_location_bar_update_label (NautilusLocationBar *bar)
g_object_unref (last_location);
}
+/* change background color based on activity state */
+void
+nautilus_location_bar_set_active(NautilusLocationBar *location_bar, gboolean is_active)
+{
+ if(is_active) {
+ /* reset style to default */
+ gtk_widget_modify_base (GTK_WIDGET (location_bar->details->entry), GTK_STATE_NORMAL, NULL);
+ }
+ else {
+ GtkStyle *style;
+ GdkColor color;
+ style = gtk_widget_get_style (GTK_WIDGET (location_bar->details->entry));
+ color = style->base[GTK_STATE_INSENSITIVE];
+ gtk_widget_modify_base(GTK_WIDGET (location_bar->details->entry), GTK_STATE_NORMAL, &color);
+ }
+}
+
NautilusEntry *
nautilus_location_bar_get_entry (NautilusLocationBar *location_bar)
{
diff --git a/src/nautilus-location-bar.h b/src/nautilus-location-bar.h
index eea9eb129..44d2158f7 100644
--- a/src/nautilus-location-bar.h
+++ b/src/nautilus-location-bar.h
@@ -61,6 +61,8 @@ typedef struct {
GType nautilus_location_bar_get_type (void);
GtkWidget* nautilus_location_bar_new (NautilusNavigationWindowPane *pane);
+void nautilus_location_bar_set_active (NautilusLocationBar *location_bar,
+ gboolean is_active);
NautilusEntry * nautilus_location_bar_get_entry (NautilusLocationBar *location_bar);
#endif /* NAUTILUS_LOCATION_BAR_H */
diff --git a/src/nautilus-navigation-window-pane.c b/src/nautilus-navigation-window-pane.c
index 41684c9e8..36f8de970 100644
--- a/src/nautilus-navigation-window-pane.c
+++ b/src/nautilus-navigation-window-pane.c
@@ -65,7 +65,8 @@ nautilus_navigation_window_pane_set_active (NautilusNavigationWindowPane *pane,
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) */
+ /* navigation bar (manual entry) */
+ nautilus_location_bar_set_active (NAUTILUS_LOCATION_BAR (pane->navigation_bar), is_active);
}
static gboolean