diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/ephy-statusbar.c | 54 | ||||
-rw-r--r-- | src/ephy-statusbar.h | 3 | ||||
-rw-r--r-- | src/ephy-window.c | 8 |
3 files changed, 63 insertions, 2 deletions
diff --git a/src/ephy-statusbar.c b/src/ephy-statusbar.c index a01b81920..76778967c 100755 --- a/src/ephy-statusbar.c +++ b/src/ephy-statusbar.c @@ -26,6 +26,8 @@ #include "ephy-stock-icons.h" #include <string.h> +#include <glib/gi18n.h> +#include <gtk/gtklabel.h> #include <gtk/gtkprogressbar.h> #include <gtk/gtkeventbox.h> #include <gtk/gtkimage.h> @@ -44,6 +46,7 @@ struct _EphyStatusbarPrivate { GtkWidget *icon_container; + GtkWidget *caret_indicator; GtkWidget *security_icon; GtkWidget *progressbar; GtkWidget *security_evbox; @@ -92,6 +95,38 @@ ephy_statusbar_class_init (EphyStatusbarClass *klass) } static void +create_caret_indicator (EphyStatusbar *statusbar) +{ + EphyStatusbarPrivate *priv = statusbar->priv; + GtkWidget *label, *ebox; + + priv->caret_indicator = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME (priv->caret_indicator), + GTK_SHADOW_IN); + ebox = gtk_event_box_new (); + gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), FALSE); + gtk_container_add (GTK_CONTAINER (priv->caret_indicator), ebox); + gtk_widget_show (ebox); + + /* Translators: this is displayed in the statusbar; choose a short word + * or even an abbreviation. + */ + label = gtk_label_new (_("Caret")); + gtk_container_add (GTK_CONTAINER (ebox), label); + gtk_widget_show (label); + + gtk_tooltips_set_tip (statusbar->tooltips, ebox, + /* Translators: this is the tooltip on the "Caret" icon + * in the statusbar. + */ + _("In keyboard selection mode, press F7 to exit"), + NULL); + + gtk_box_pack_start (GTK_BOX (priv->icon_container), priv->caret_indicator, + FALSE, FALSE, 0); +} + +static void create_statusbar_security_icon (EphyStatusbar *s) { s->security_frame = gtk_frame_new (NULL); @@ -199,6 +234,7 @@ ephy_statusbar_init (EphyStatusbar *t) create_statusbar_progress (t); create_statusbar_security_icon (t); create_statusbar_popups_manager_icon (t); + create_caret_indicator (t); sync_shadow_type (t, NULL, NULL); g_signal_connect (t, "style-set", G_CALLBACK (sync_shadow_type), NULL); @@ -228,6 +264,24 @@ ephy_statusbar_new (void) } /** + * ephy_statusbar_set_caret_mode: + * @statusbar: an #EphyStatusbar + * @enabled: + * + * Sets the statusbar's caret browsing mode indicator. + **/ +void +ephy_statusbar_set_caret_mode (EphyStatusbar *statusbar, + gboolean enabled) +{ + EphyStatusbarPrivate *priv = statusbar->priv; + + enabled = enabled != FALSE; + + g_object_set (priv->caret_indicator, "visible", enabled, NULL); +} + +/** * ephy_statusbar_set_security_state: * @statusbar: an #EphyStatusbar * @stock_id: stock-id of the icon showing the security state diff --git a/src/ephy-statusbar.h b/src/ephy-statusbar.h index 92ceb3b5f..6db674193 100644 --- a/src/ephy-statusbar.h +++ b/src/ephy-statusbar.h @@ -65,6 +65,9 @@ GtkTooltips *ephy_statusbar_get_tooltips (EphyStatusbar *statusbar); GtkWidget *ephy_statusbar_get_security_frame (EphyStatusbar *statusbar); +void ephy_statusbar_set_caret_mode (EphyStatusbar *statusbar, + gboolean enabled); + void ephy_statusbar_set_security_state (EphyStatusbar *statusbar, const char *stock_id, const char *tooltip); diff --git a/src/ephy-window.c b/src/ephy-window.c index 7e9c965c2..d891c078e 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -2884,12 +2884,16 @@ browse_with_caret_notifier (GConfClient *client, GConfEntry *entry, EphyWindow *window) { + EphyWindowPrivate *priv = window->priv; GtkAction *action; + gboolean enabled; + enabled = eel_gconf_get_boolean (CONF_BROWSE_WITH_CARET); action = gtk_action_group_get_action (window->priv->action_group, "BrowseWithCaret"); - gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), - eel_gconf_get_boolean (CONF_BROWSE_WITH_CARET)); + gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), enabled); + + ephy_statusbar_set_caret_mode (EPHY_STATUSBAR (priv->statusbar), enabled); } static void |