aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2006-08-05 14:38:47 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2006-08-05 14:38:47 +0800
commita00b972e5a9e3e7131fbf38538d42ecfeca8740c (patch)
tree5064d92515442e1efe5fcb7e28c7891e09c588eb /widgets
parent9f6f6f39aabb789354cf437cf9d8e2f1f470efe3 (diff)
downloadgsoc2013-evolution-a00b972e5a9e3e7131fbf38538d42ecfeca8740c.tar.gz
gsoc2013-evolution-a00b972e5a9e3e7131fbf38538d42ecfeca8740c.tar.zst
gsoc2013-evolution-a00b972e5a9e3e7131fbf38538d42ecfeca8740c.zip
Committed Johnny's string changes for search
svn path=/trunk/; revision=32474
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/ChangeLog10
-rw-r--r--widgets/misc/e-icon-entry.c26
-rw-r--r--widgets/misc/e-search-bar.c15
-rw-r--r--widgets/misc/e-search-bar.h3
4 files changed, 46 insertions, 8 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 2256055e89..d8df9e8ccd 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,13 @@
+2006-08-04 Johnny Jacob <jjohnny@novell.com>
+
+ * e-icon-entry.c: (set_cursor) : Added. Change cursor over icon.
+ (e_icon_entry_create_button) : Handle enter/leave-notify signals
+ for changing cursor.
+ * e-search-bar.c: (e_search_bar_construct) : Added mnemonic for
+ "Sho_w". Added tooltips for e-icon-entry.
+ (option_activated_cb) : Set the selected item's label in tooltip.
+
+
2006-08-02 Srinivasa Ragavan <sragavan@novell.com>
** Fix for bug #349565
diff --git a/widgets/misc/e-icon-entry.c b/widgets/misc/e-icon-entry.c
index 3933132ec0..8b8e5affbb 100644
--- a/widgets/misc/e-icon-entry.c
+++ b/widgets/misc/e-icon-entry.c
@@ -37,10 +37,8 @@
#include "e-icon-entry.h"
#include <gtk/gtkentry.h>
-#include <gtk/gtkeventbox.h>
#include <gtk/gtkbox.h>
#include <gtk/gtkhbox.h>
-#include <gtk/gtkimage.h>
#define E_ICON_ENTRY_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), E_TYPE_ICON_ENTRY, EIconEntryPrivate))
@@ -118,7 +116,7 @@ e_icon_entry_paint (GtkWidget *widget,
NULL, entry_widget, "entry_bg",
/* FIXME: was 0, 0 in gtk_entry_expose, but I think this is correct: */
x, y, width, height);
-
+
gtk_paint_shadow (entry_widget->style, widget->window,
GTK_STATE_NORMAL, GTK_SHADOW_IN,
NULL, entry_widget, "entry",
@@ -334,6 +332,7 @@ e_icon_entry_pack_widget (EIconEntry *entry,
gboolean start)
{
EIconEntryPrivate *priv;
+ GtkWidget *box;
g_return_if_fail (E_IS_ICON_ENTRY (entry));
@@ -350,6 +349,18 @@ e_icon_entry_pack_widget (EIconEntry *entry,
}
}
+static void
+set_cursor (GtkWidget *widget, GdkEventCrossing *event, gpointer dummy)
+{
+
+ if (event->type == GDK_ENTER_NOTIFY)
+ gdk_window_set_cursor (widget->window, gdk_cursor_new (GDK_HAND1));
+ else
+ gdk_window_set_cursor (widget->window, gdk_cursor_new (GDK_LEFT_PTR));
+
+
+}
+
GtkWidget *
e_icon_entry_create_button (const char *stock)
{
@@ -357,11 +368,14 @@ e_icon_entry_create_button (const char *stock)
GtkWidget *image;
eventbox = gtk_event_box_new ();
- gtk_container_set_border_width (GTK_CONTAINER (eventbox), 2);
- gtk_event_box_set_visible_window ( (eventbox), FALSE);
+ gtk_container_set_border_width (GTK_CONTAINER (eventbox), 2);
+ gtk_event_box_set_visible_window ((eventbox), FALSE);
image = gtk_image_new_from_stock (stock, GTK_ICON_SIZE_MENU);
- gtk_container_add (GTK_CONTAINER (eventbox), image);
+ gtk_container_add (GTK_CONTAINER (eventbox), image);
+
+ g_signal_connect_after (eventbox, "enter-notify-event", set_cursor, NULL);
+ g_signal_connect_after (eventbox, "leave-notify-event", set_cursor, NULL);
return eventbox;
}
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index 7202fa235f..7257c161d3 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -303,6 +303,7 @@ entry_focus_out_cb (GtkWidget *widget,
if (text && *text) {
gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, &(style->text[GTK_STATE_INSENSITIVE]));
gtk_entry_set_text (GTK_ENTRY (esb->entry), text);
+ gtk_tooltips_set_tip (esb->tooltips, esb->option_button, text, "Search type");
gtk_widget_hide (esb->clear_button);
}
}
@@ -430,6 +431,14 @@ option_activated_cb (GtkWidget *widget,
/* id = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "EsbItemId")); */
/* esb->item_id = id; */
+ char *text;
+
+ if (GTK_IS_RADIO_MENU_ITEM (gtk_menu_get_active ( GTK_MENU (esb->option_menu)))) {
+ text = get_selected_item_label (esb->option_menu);
+ if (text && *text)
+ gtk_tooltips_set_tip (esb->tooltips, esb->option_button, text, "Search type");
+ }
+
emit_query_changed (esb);
emit_search_activated (esb);
}
@@ -842,6 +851,7 @@ init (ESearchBar *esb)
esb->scopeoption = NULL;
esb->scopeoption_box = NULL;
+ esb->tooltips = NULL;
esb->pending_activate = 0;
esb->item_id = 0;
@@ -875,6 +885,8 @@ e_search_bar_construct (ESearchBar *search_bar,
gtk_box_set_homogeneous (GTK_BOX (search_bar), FALSE);
+ search_bar->tooltips = gtk_tooltips_new ();
+
bighbox = gtk_hbox_new (FALSE, 0);
search_bar->entry_box = gtk_hbox_new (0, FALSE);
search_bar->icon_entry = e_icon_entry_new ();
@@ -907,11 +919,12 @@ e_search_bar_construct (ESearchBar *search_bar,
/* To Translators: The "Show: " label is followed by the Quick Search Dropdown Menu where you can choose
to display "All Messages", "Unread Messages", "Message with 'Important' Label" and so on... */
- label = gtk_label_new_with_mnemonic (_("Show: "));
+ label = gtk_label_new_with_mnemonic (_("Sho_w: "));
gtk_widget_show (label);
gtk_box_pack_start (GTK_BOX(search_bar->viewoption_box), label, FALSE, FALSE, 0);
search_bar->viewoption = gtk_option_menu_new ();
+ gtk_label_set_mnemonic_widget (label, search_bar->viewoption);
gtk_box_pack_start (GTK_BOX(search_bar->viewoption_box), search_bar->viewoption, FALSE, TRUE, 0);
gtk_widget_show_all (search_bar->viewoption_box);
gtk_box_pack_start (GTK_BOX(search_bar), search_bar->viewoption_box, FALSE, FALSE, 0);
diff --git a/widgets/misc/e-search-bar.h b/widgets/misc/e-search-bar.h
index b49cc7ecfb..3cb8af0d96 100644
--- a/widgets/misc/e-search-bar.h
+++ b/widgets/misc/e-search-bar.h
@@ -21,6 +21,7 @@
#define __E_SEARCH_BAR_H__
#include <gtk/gtkhbox.h>
+#include <gtk/gtktooltips.h>
#include <bonobo/bonobo-ui-component.h>
@@ -94,7 +95,7 @@ struct _ESearchBar
GtkWidget *scopeoption_menu;
guint pending_activate;
-
+ GtkTooltips *tooltips;
/* The currently-selected item & subitem */
int item_id;
int viewitem_id; /* Current View Id */