[StScrollView] Add support for GtkPolicyType for scrollbars
Previously we were hacking out the vertical scrollbar, this patch allow us to sanely say in which directions we want to scroll. Note this patch intentionally changes St to depend on GTK+ in the API. I believe this is a correct long term change where we should view St as co-evolving with GTK+ rather than replacing or paralleling. https://bugzilla.gnome.org/show_bug.cgi?id=609015
This commit is contained in:
@@ -14,9 +14,19 @@ let vbox = new St.BoxLayout({ vertical: true,
|
||||
style: "padding: 10px;" });
|
||||
stage.add_actor(vbox);
|
||||
|
||||
let toggle = new St.Button({ label: 'Horizontal Scrolling',
|
||||
toggle_mode: true });
|
||||
vbox.add(toggle);
|
||||
|
||||
let v = new St.ScrollView();
|
||||
vbox.add(v, { expand: true });
|
||||
|
||||
toggle.connect('notify::checked', function () {
|
||||
v.set_policy(toggle.checked ? St.ScrollPolicy.AUTOMATIC
|
||||
: St.ScrollPolicy.NEVER,
|
||||
St.ScrollPolicy.AUTOMATIC);
|
||||
});
|
||||
|
||||
let b = new St.BoxLayout({ vertical: true,
|
||||
style: "border: 2px solid #880000; border-radius: 10px; padding: 0px 5px;" });
|
||||
v.add_actor(b);
|
||||
|
Reference in New Issue
Block a user