[gnome-shell] StScrollView: Expose scrollbars visibility as property
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] StScrollView: Expose scrollbars visibility as property
- Date: Wed, 29 Jun 2011 16:50:13 +0000 (UTC)
commit 3765acc0a59f9120843201bbe867f52af8fe52fb
Author: Adel Gadllah <adel gadllah gmail com>
Date: Wed Jun 29 18:07:06 2011 +0200
StScrollView: Expose scrollbars visibility as property
Add two boolean readonly properties that tell whether
the scrollbars are visible or not.
https://bugzilla.gnome.org/show_bug.cgi?id=651866
src/st/st-scroll-view.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/src/st/st-scroll-view.c b/src/st/st-scroll-view.c
index a628690..63e66c1 100644
--- a/src/st/st-scroll-view.c
+++ b/src/st/st-scroll-view.c
@@ -113,6 +113,8 @@ enum {
PROP_VSCROLL,
PROP_HSCROLLBAR_POLICY,
PROP_VSCROLLBAR_POLICY,
+ PROP_HSCROLLBAR_VISIBLE,
+ PROP_VSCROLLBAR_VISIBLE,
PROP_MOUSE_SCROLL,
};
@@ -138,6 +140,12 @@ st_scroll_view_get_property (GObject *object,
case PROP_VSCROLLBAR_POLICY:
g_value_set_enum (value, priv->vscrollbar_policy);
break;
+ case PROP_HSCROLLBAR_VISIBLE:
+ g_value_set_boolean (value, priv->hscrollbar_visible);
+ break;
+ case PROP_VSCROLLBAR_VISIBLE:
+ g_value_set_boolean (value, priv->vscrollbar_visible);
+ break;
case PROP_MOUSE_SCROLL:
g_value_set_boolean (value, priv->mouse_scroll);
break;
@@ -646,8 +654,22 @@ st_scroll_view_allocate (ClutterActor *actor,
if (priv->child)
clutter_actor_allocate (priv->child, &child_box, flags);
- priv->hscrollbar_visible = hscrollbar_visible;
- priv->vscrollbar_visible = vscrollbar_visible;
+ if (priv->hscrollbar_visible != hscrollbar_visible)
+ {
+ g_object_freeze_notify (G_OBJECT (actor));
+ priv->hscrollbar_visible = hscrollbar_visible;
+ g_object_notify (G_OBJECT (actor), "hscrollbar-visible");
+ g_object_thaw_notify (G_OBJECT (actor));
+ }
+
+ if (priv->vscrollbar_visible != vscrollbar_visible)
+ {
+ g_object_freeze_notify (G_OBJECT (actor));
+ priv->vscrollbar_visible = vscrollbar_visible;
+ g_object_notify (G_OBJECT (actor), "vscrollbar-visible");
+ g_object_thaw_notify (G_OBJECT (actor));
+ }
+
}
static void
@@ -786,6 +808,20 @@ st_scroll_view_class_init (StScrollViewClass *klass)
G_PARAM_READWRITE);
g_object_class_install_property (object_class, PROP_HSCROLLBAR_POLICY, pspec);
+ pspec = g_param_spec_boolean ("hscrollbar-visible",
+ "Horizontal Scrollbar Visibility",
+ "Whether the horizontal scrollbar is visible",
+ TRUE,
+ G_PARAM_READABLE);
+ g_object_class_install_property (object_class, PROP_HSCROLLBAR_VISIBLE, pspec);
+
+ pspec = g_param_spec_boolean ("vscrollbar-visible",
+ "Vertical Scrollbar Visibility",
+ "Whether the vertical scrollbar is visible",
+ TRUE,
+ G_PARAM_READABLE);
+ g_object_class_install_property (object_class, PROP_VSCROLLBAR_VISIBLE, pspec);
+
pspec = g_param_spec_boolean ("enable-mouse-scrolling",
"Enable Mouse Scrolling",
"Enable automatic mouse wheel scrolling",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]