aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-09-05 01:04:55 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-10-06 20:16:21 +0800
commitef05d73b0a06cfc5eaf1a74c7b5c25134d81e328 (patch)
treef500ff7dda030e1ee0fb7d79f639a9b0422ac8a9 /shell
parent0e064de971dd8b5e565558cd14efdca8ae4dbcb0 (diff)
downloadgsoc2013-evolution-ef05d73b0a06cfc5eaf1a74c7b5c25134d81e328.tar
gsoc2013-evolution-ef05d73b0a06cfc5eaf1a74c7b5c25134d81e328.tar.gz
gsoc2013-evolution-ef05d73b0a06cfc5eaf1a74c7b5c25134d81e328.tar.bz2
gsoc2013-evolution-ef05d73b0a06cfc5eaf1a74c7b5c25134d81e328.tar.lz
gsoc2013-evolution-ef05d73b0a06cfc5eaf1a74c7b5c25134d81e328.tar.xz
gsoc2013-evolution-ef05d73b0a06cfc5eaf1a74c7b5c25134d81e328.tar.zst
gsoc2013-evolution-ef05d73b0a06cfc5eaf1a74c7b5c25134d81e328.zip
Remove EHintedEntry.
GtkEntry in GTK+ 3.2 now provides this functionality through the new GtkEntry:placeholder-text property.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-content.c1
-rw-r--r--shell/e-shell-searchbar.c32
2 files changed, 18 insertions, 15 deletions
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c
index c7a41510f2..069e0bfa83 100644
--- a/shell/e-shell-content.c
+++ b/shell/e-shell-content.c
@@ -40,7 +40,6 @@
#include "filter/e-rule-editor.h"
#include "widgets/misc/e-action-combo-box.h"
#include "widgets/misc/e-alert-bar.h"
-#include "widgets/misc/e-hinted-entry.h"
#include "e-shell-backend.h"
#include "e-shell-searchbar.h"
diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c
index 13b0b49349..370d6b4f5e 100644
--- a/shell/e-shell-searchbar.c
+++ b/shell/e-shell-searchbar.c
@@ -36,7 +36,6 @@
#include "e-util/e-util.h"
#include "widgets/misc/e-action-combo-box.h"
-#include "widgets/misc/e-hinted-entry.h"
#include "e-shell-window-actions.h"
@@ -979,7 +978,7 @@ e_shell_searchbar_init (EShellSearchbar *searchbar)
label = GTK_LABEL (widget);
- widget = e_hinted_entry_new ();
+ widget = gtk_entry_new ();
gtk_label_set_mnemonic_widget (label, widget);
gtk_box_pack_start (box, widget, TRUE, TRUE, 0);
searchbar->priv->search_entry = widget;
@@ -1168,26 +1167,26 @@ e_shell_searchbar_set_filter_visible (EShellSearchbar *searchbar,
const gchar *
e_shell_searchbar_get_search_hint (EShellSearchbar *searchbar)
{
- EHintedEntry *entry;
+ GtkEntry *entry;
g_return_val_if_fail (E_IS_SHELL_SEARCHBAR (searchbar), NULL);
- entry = E_HINTED_ENTRY (searchbar->priv->search_entry);
+ entry = GTK_ENTRY (searchbar->priv->search_entry);
- return e_hinted_entry_get_hint (entry);
+ return gtk_entry_get_placeholder_text (entry);
}
void
e_shell_searchbar_set_search_hint (EShellSearchbar *searchbar,
const gchar *search_hint)
{
- EHintedEntry *entry;
+ GtkEntry *entry;
g_return_if_fail (E_IS_SHELL_SEARCHBAR (searchbar));
- entry = E_HINTED_ENTRY (searchbar->priv->search_entry);
+ entry = GTK_ENTRY (searchbar->priv->search_entry);
- e_hinted_entry_set_hint (entry, search_hint);
+ gtk_entry_set_placeholder_text (entry, search_hint);
g_object_notify (G_OBJECT (searchbar), "search-hint");
}
@@ -1233,26 +1232,31 @@ e_shell_searchbar_set_search_option (EShellSearchbar *searchbar,
const gchar *
e_shell_searchbar_get_search_text (EShellSearchbar *searchbar)
{
- EHintedEntry *entry;
+ GtkEntry *entry;
g_return_val_if_fail (E_IS_SHELL_SEARCHBAR (searchbar), NULL);
- entry = E_HINTED_ENTRY (searchbar->priv->search_entry);
+ entry = GTK_ENTRY (searchbar->priv->search_entry);
- return e_hinted_entry_get_text (entry);
+ return gtk_entry_get_text (entry);
}
void
e_shell_searchbar_set_search_text (EShellSearchbar *searchbar,
const gchar *search_text)
{
- EHintedEntry *entry;
+ GtkEntry *entry;
g_return_if_fail (E_IS_SHELL_SEARCHBAR (searchbar));
- entry = E_HINTED_ENTRY (searchbar->priv->search_entry);
+ entry = GTK_ENTRY (searchbar->priv->search_entry);
- e_hinted_entry_set_text (entry, search_text);
+ /* XXX Really wish gtk_entry_set_text()
+ * would just learn to accept NULL. */
+ if (search_text == NULL)
+ search_text = "";
+
+ gtk_entry_set_text (entry, search_text);
shell_searchbar_update_search_widgets (searchbar);