[gnome-shell] extensionPrefs: Use a single line for description



commit 5b92e3a9a8257a1564f624f702159b1e2607786b
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Nov 30 03:33:27 2019 +0100

    extensionPrefs: Use a single line for description
    
    The current fixed two-line label requires a custom widget, which
    make moving to a widget template harder.
    
    As the description will soon move elsewhere anyway, just go back
    to a single line with a standard label for now.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/1968

 js/extensionPrefs/main.js | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)
---
diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js
index 0803761a1e..4a8ace0851 100644
--- a/js/extensionPrefs/main.js
+++ b/js/extensionPrefs/main.js
@@ -471,16 +471,6 @@ var Expander = GObject.registerClass({
     }
 });
 
-var DescriptionLabel = GObject.registerClass(
-class DescriptionLabel extends Gtk.Label {
-    vfunc_get_preferred_height_for_width(width) {
-        // Hack: Request the maximum height allowed by the line limit
-        if (this.lines > 0)
-            return super.vfunc_get_preferred_height_for_width(0);
-        return super.vfunc_get_preferred_height_for_width(width);
-    }
-});
-
 var ExtensionRow = GObject.registerClass(
 class ExtensionRow extends Gtk.ListBoxRow {
     _init(extension) {
@@ -552,10 +542,13 @@ class ExtensionRow extends Gtk.ListBoxRow {
         vbox.add(label);
 
         let desc = this._extension.metadata.description.split('\n')[0];
-        label = new DescriptionLabel({ label: desc, wrap: true, lines: 2,
-                                       ellipsize: Pango.EllipsizeMode.END,
-                                       max_width_chars: 60,
-                                       xalign: 0, yalign: 0 });
+        label = new Gtk.Label({
+            label: desc,
+            ellipsize: Pango.EllipsizeMode.END,
+            max_width_chars: 60,
+            xalign: 0,
+            yalign: 0,
+        });
         vbox.add(label);
 
         let button = new Gtk.Button({ valign: Gtk.Align.CENTER,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]