diff --git a/data/theme/gnome-shell-sass/widgets/_quick-settings.scss b/data/theme/gnome-shell-sass/widgets/_quick-settings.scss index 54d169321..e19137180 100644 --- a/data/theme/gnome-shell-sass/widgets/_quick-settings.scss +++ b/data/theme/gnome-shell-sass/widgets/_quick-settings.scss @@ -31,6 +31,12 @@ &:rtl > StBoxLayout { padding-right: $base_padding*2.5; } .quick-toggle-title { font-weight: bold; } + + & StBoxLayout > .quick-toggle-subtitle { + font-weight: normal; + font-size: 12px; + } + .quick-toggle-icon, .quick-toggle-arrow { icon-size: $base_icon_size; } } diff --git a/js/ui/quickSettings.js b/js/ui/quickSettings.js index c07cdcadd..fd584e2b4 100644 --- a/js/ui/quickSettings.js +++ b/js/ui/quickSettings.js @@ -37,6 +37,9 @@ var QuickToggle = GObject.registerClass({ 'title': GObject.ParamSpec.string('title', '', '', GObject.ParamFlags.READWRITE, null), + 'subtitle': GObject.ParamSpec.string('subtitle', '', '', + GObject.ParamFlags.READWRITE, + null), 'icon-name': GObject.ParamSpec.override('icon-name', St.Button), 'gicon': GObject.ParamSpec.object('gicon', '', '', GObject.ParamFlags.READWRITE, @@ -85,13 +88,38 @@ var QuickToggle = GObject.registerClass({ x_expand: true, }); this.label_actor = this._title; - this._box.add_child(this._title); + + this._subtitle = new St.Label({ + style_class: 'quick-toggle-subtitle', + y_align: Clutter.ActorAlign.CENTER, + x_align: Clutter.ActorAlign.START, + x_expand: true, + }); + + const titleBox = new St.BoxLayout({ + y_align: Clutter.ActorAlign.CENTER, + x_align: Clutter.ActorAlign.START, + x_expand: true, + vertical: true, + }); + titleBox.add_child(this._title); + titleBox.add_child(this._subtitle); + this._box.add_child(titleBox); this._title.clutter_text.ellipsize = Pango.EllipsizeMode.END; this.bind_property('title', this._title, 'text', GObject.BindingFlags.SYNC_CREATE); + + this.bind_property('subtitle', + this._subtitle, 'text', + GObject.BindingFlags.SYNC_CREATE); + this.bind_property_full('subtitle', + this._subtitle, 'visible', + GObject.BindingFlags.SYNC_CREATE, + (bind, source) => [true, source !== null], + null); } set label(label) {