aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@gnome.org>2009-12-23 17:08:16 +0800
committerSrinivasa Ragavan <sragavan@gnome.org>2009-12-23 17:13:00 +0800
commit05c11c2cee07576e60963aa91ede71a6ecb6bea2 (patch)
tree691c0acb8a44b1cdbc93f6263587c5c5b861b475 /shell
parentb687d95facc104af1e7f03beaf27cb36f402b625 (diff)
downloadgsoc2013-evolution-05c11c2cee07576e60963aa91ede71a6ecb6bea2.tar.gz
gsoc2013-evolution-05c11c2cee07576e60963aa91ede71a6ecb6bea2.tar.zst
gsoc2013-evolution-05c11c2cee07576e60963aa91ede71a6ecb6bea2.zip
Provison to hide search label for Anjal's use.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-content.c2
-rw-r--r--shell/e-shell-searchbar.c48
-rw-r--r--shell/e-shell-searchbar.h6
3 files changed, 54 insertions, 2 deletions
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c
index 61490fd8d5..799df0d4fe 100644
--- a/shell/e-shell-content.c
+++ b/shell/e-shell-content.c
@@ -260,7 +260,7 @@ shell_content_forall (GtkContainer *container,
priv = E_SHELL_CONTENT_GET_PRIVATE (container);
- if (include_internals && priv->searchbar != NULL && container == priv->searchbar->parent)
+ if (include_internals && priv->searchbar != NULL && container == (GtkContainer *)priv->searchbar->parent)
callback (priv->searchbar, callback_data);
/* Chain up to parent's forall() method. */
diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c
index f9b0b2e967..c37a09a2ff 100644
--- a/shell/e-shell-searchbar.c
+++ b/shell/e-shell-searchbar.c
@@ -55,6 +55,7 @@ struct _EShellSearchbarPrivate {
guint filter_visible : 1;
guint search_visible : 1;
guint scope_visible : 1;
+ guint label_visible : 1;
};
enum {
@@ -67,7 +68,8 @@ enum {
PROP_SEARCH_VISIBLE,
PROP_SCOPE_COMBO_BOX,
PROP_SCOPE_VISIBLE,
- PROP_SHELL_VIEW
+ PROP_SHELL_VIEW,
+ PROP_LABEL_VISIBLE,
};
static gpointer parent_class;
@@ -321,6 +323,11 @@ shell_searchbar_set_property (GObject *object,
GParamSpec *pspec)
{
switch (property_id) {
+ case PROP_LABEL_VISIBLE:
+ e_shell_searchbar_set_label_visible (
+ E_SHELL_SEARCHBAR (object),
+ g_value_get_boolean (value));
+ return;
case PROP_FILTER_VISIBLE:
e_shell_searchbar_set_filter_visible (
E_SHELL_SEARCHBAR (object),
@@ -380,6 +387,12 @@ shell_searchbar_get_property (GObject *object,
E_SHELL_SEARCHBAR (object)));
return;
+ case PROP_LABEL_VISIBLE:
+ g_value_set_boolean (
+ value, e_shell_searchbar_get_label_visible (
+ E_SHELL_SEARCHBAR (object)));
+ return;
+
case PROP_FILTER_VISIBLE:
g_value_set_boolean (
value, e_shell_searchbar_get_filter_visible (
@@ -543,6 +556,17 @@ shell_searchbar_class_init (EShellSearchbarClass *class)
g_object_class_install_property (
object_class,
+ PROP_LABEL_VISIBLE,
+ g_param_spec_boolean (
+ "label-visible",
+ NULL,
+ NULL,
+ TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
+
+ g_object_class_install_property (
+ object_class,
PROP_FILTER_VISIBLE,
g_param_spec_boolean (
"filter-visible",
@@ -691,6 +715,9 @@ shell_searchbar_init (EShellSearchbar *searchbar)
gtk_widget_show (widget);
label = GTK_LABEL (widget);
+ e_binding_new (
+ searchbar, "label-visible",
+ widget, "visible");
widget = e_hinted_entry_new ();
gtk_label_set_mnemonic_widget (label, widget);
@@ -819,6 +846,25 @@ e_shell_searchbar_get_filter_combo_box (EShellSearchbar *searchbar)
}
gboolean
+e_shell_searchbar_get_label_visible (EShellSearchbar *searchbar)
+{
+ g_return_val_if_fail (E_IS_SHELL_SEARCHBAR (searchbar), FALSE);
+
+ return searchbar->priv->label_visible;
+}
+
+void
+e_shell_searchbar_set_label_visible (EShellSearchbar *searchbar,
+ gboolean label_visible)
+{
+ g_return_if_fail (E_IS_SHELL_SEARCHBAR (searchbar));
+
+ searchbar->priv->label_visible = label_visible;
+
+ g_object_notify (G_OBJECT (searchbar), "label-visible");
+}
+
+gboolean
e_shell_searchbar_get_filter_visible (EShellSearchbar *searchbar)
{
g_return_val_if_fail (E_IS_SHELL_SEARCHBAR (searchbar), FALSE);
diff --git a/shell/e-shell-searchbar.h b/shell/e-shell-searchbar.h
index b6104491b4..6bb402bf53 100644
--- a/shell/e-shell-searchbar.h
+++ b/shell/e-shell-searchbar.h
@@ -103,6 +103,12 @@ gboolean e_shell_searchbar_get_search_visible
void e_shell_searchbar_set_search_visible
(EShellSearchbar *searchbar,
gboolean search_visible);
+gboolean e_shell_searchbar_get_label_visible
+ (EShellSearchbar *searchbar);
+void e_shell_searchbar_set_label_visible
+ (EShellSearchbar *searchbar,
+ gboolean label_visible);
+
EActionComboBox *
e_shell_searchbar_get_scope_combo_box
(EShellSearchbar *searchbar);