aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-statusbar.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-01-18 22:21:11 +0800
committerChristian Persch <chpe@src.gnome.org>2006-01-18 22:21:11 +0800
commit539426a9bd327676ad71b263e497ce19da1adde9 (patch)
tree0292a84438d6b7db5a7edc2f979bc52507fd1285 /src/ephy-statusbar.c
parentd52eb5001589d5480dfa2f661c37a7b8a3576fcd (diff)
downloadgsoc2013-epiphany-539426a9bd327676ad71b263e497ce19da1adde9.tar
gsoc2013-epiphany-539426a9bd327676ad71b263e497ce19da1adde9.tar.gz
gsoc2013-epiphany-539426a9bd327676ad71b263e497ce19da1adde9.tar.bz2
gsoc2013-epiphany-539426a9bd327676ad71b263e497ce19da1adde9.tar.lz
gsoc2013-epiphany-539426a9bd327676ad71b263e497ce19da1adde9.tar.xz
gsoc2013-epiphany-539426a9bd327676ad71b263e497ce19da1adde9.tar.zst
gsoc2013-epiphany-539426a9bd327676ad71b263e497ce19da1adde9.zip
Add caret mode indicator UI. Bug #145581.
2006-01-18 Christian Persch <chpe@cvs.gnome.org> * src/ephy-statusbar.c: (create_caret_indicator), (ephy_statusbar_init), (ephy_statusbar_new), (ephy_statusbar_set_caret_mode): * src/ephy-statusbar.h: * src/ephy-window.c: (browse_with_caret_notifier): Add caret mode indicator UI. Bug #145581.
Diffstat (limited to 'src/ephy-statusbar.c')
-rwxr-xr-xsrc/ephy-statusbar.c54
1 files changed, 54 insertions, 0 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