st: Add StPolicyType enum

In order to replace GTK+'s GtkPolicyType. It's bit-compatible with it, too.
All callers have been updated to use it.

This is a purely accessory change in terms of X11 Display usage cleanup,
but helps see better what is left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317
This commit is contained in:
Carlos Garnacho
2018-11-27 13:45:36 +01:00
parent 0f799ae313
commit a977c1388a
14 changed files with 79 additions and 77 deletions

View File

@ -914,8 +914,8 @@ var PopupSubMenu = class extends PopupMenuBase {
// with long content, we make it scrollable - the scrollbar will only take
// effect if a CSS max-height is set on the top menu.
this.actor = new St.ScrollView({ style_class: 'popup-sub-menu',
hscrollbar_policy: Gtk.PolicyType.NEVER,
vscrollbar_policy: Gtk.PolicyType.NEVER });
hscrollbar_policy: St.PolicyType.NEVER,
vscrollbar_policy: St.PolicyType.NEVER });
this.actor.add_actor(this.box);
this.actor._delegate = this;
@ -957,7 +957,7 @@ var PopupSubMenu = class extends PopupMenuBase {
// when we *don't* need it, so turn off the scrollbar when that's true.
// Dynamic changes in whether we need it aren't handled properly.
this.actor.vscrollbar_policy =
needsScrollbar ? Gtk.PolicyType.AUTOMATIC : Gtk.PolicyType.NEVER;
needsScrollbar ? St.PolicyType.AUTOMATIC : St.PolicyType.NEVER;
if (needsScrollbar)
this.actor.add_style_pseudo_class('scrolled');