[StScrollView] Fix incorrect assertion, defaults, and test case
The type we don't currently handle is _ALWAYS, my original use of g_return_if_fail was wrong. Also the default should be AUTOMATIC in the properties, not ALWAYS. Finally the test case was still using the incorrect St.ScrollPolicy. https://bugzilla.gnome.org/show_bug.cgi?id=609015
This commit is contained in:
parent
ec725cc6d4
commit
fb9fd6925a
@ -504,7 +504,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
|
|||||||
"Vertical Scrollbar Policy",
|
"Vertical Scrollbar Policy",
|
||||||
"When the vertical scrollbar is displayed",
|
"When the vertical scrollbar is displayed",
|
||||||
GTK_TYPE_POLICY_TYPE,
|
GTK_TYPE_POLICY_TYPE,
|
||||||
GTK_POLICY_ALWAYS,
|
GTK_POLICY_AUTOMATIC,
|
||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
g_object_class_install_property (object_class, PROP_VSCROLLBAR_POLICY, pspec);
|
g_object_class_install_property (object_class, PROP_VSCROLLBAR_POLICY, pspec);
|
||||||
|
|
||||||
@ -512,7 +512,7 @@ st_scroll_view_class_init (StScrollViewClass *klass)
|
|||||||
"Horizontal Scrollbar Policy",
|
"Horizontal Scrollbar Policy",
|
||||||
"When the horizontal scrollbar is displayed",
|
"When the horizontal scrollbar is displayed",
|
||||||
GTK_TYPE_POLICY_TYPE,
|
GTK_TYPE_POLICY_TYPE,
|
||||||
GTK_POLICY_ALWAYS,
|
GTK_POLICY_AUTOMATIC,
|
||||||
G_PARAM_READWRITE);
|
G_PARAM_READWRITE);
|
||||||
g_object_class_install_property (object_class, PROP_HSCROLLBAR_POLICY, pspec);
|
g_object_class_install_property (object_class, PROP_HSCROLLBAR_POLICY, pspec);
|
||||||
|
|
||||||
@ -918,7 +918,7 @@ st_scroll_view_set_policy (StScrollView *scroll,
|
|||||||
StAdjustment *hadjust, *vadjust;
|
StAdjustment *hadjust, *vadjust;
|
||||||
|
|
||||||
g_return_if_fail (ST_IS_SCROLL_VIEW (scroll));
|
g_return_if_fail (ST_IS_SCROLL_VIEW (scroll));
|
||||||
g_return_if_fail (hscroll == GTK_POLICY_ALWAYS || vscroll == GTK_POLICY_ALWAYS);
|
g_return_if_fail (hscroll != GTK_POLICY_ALWAYS && vscroll != GTK_POLICY_ALWAYS);
|
||||||
|
|
||||||
priv = ST_SCROLL_VIEW (scroll)->priv;
|
priv = ST_SCROLL_VIEW (scroll)->priv;
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||||
|
|
||||||
const Clutter = imports.gi.Clutter;
|
const Clutter = imports.gi.Clutter;
|
||||||
|
const Gtk = imports.gi.Gtk;
|
||||||
const St = imports.gi.St;
|
const St = imports.gi.St;
|
||||||
|
|
||||||
const UI = imports.testcommon.ui;
|
const UI = imports.testcommon.ui;
|
||||||
@ -22,9 +23,9 @@ let v = new St.ScrollView();
|
|||||||
vbox.add(v, { expand: true });
|
vbox.add(v, { expand: true });
|
||||||
|
|
||||||
toggle.connect('notify::checked', function () {
|
toggle.connect('notify::checked', function () {
|
||||||
v.set_policy(toggle.checked ? St.ScrollPolicy.AUTOMATIC
|
v.set_policy(toggle.checked ? Gtk.PolicyType.AUTOMATIC
|
||||||
: St.ScrollPolicy.NEVER,
|
: Gtk.PolicyType.NEVER,
|
||||||
St.ScrollPolicy.AUTOMATIC);
|
Gtk.PolicyType.AUTOMATIC);
|
||||||
});
|
});
|
||||||
|
|
||||||
let b = new St.BoxLayout({ vertical: true,
|
let b = new St.BoxLayout({ vertical: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user