[nautilus] Make location bar more reactive, part 2: navigation bar



commit c3da9152ce3efadbeaf92340ca832af6dbfc6266
Author: Holger Berndt <berndth gmx de>
Date:   Thu Jun 11 17:46:08 2009 +0200

    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.

 src/nautilus-location-bar.c           |   17 +++++++++++++++++
 src/nautilus-location-bar.h           |    2 ++
 src/nautilus-navigation-window-pane.c |    3 ++-
 3 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/src/nautilus-location-bar.c b/src/nautilus-location-bar.c
index 178ba03..52a618d 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 eea9eb1..44d2158 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 41684c9..36f8de9 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]