extensionPrefs: Simplify empty placeholder

GNOME Software will remove its extension support, so we should stop
referencing it in addition to extensions.gnome.org.

In fact, the placeholder is not the best place to hint at where new
extensions can be found, as the user will never see it in case the
distribution includes pre-installed extensions.

So remove the hint altogether, we will add it back in a more prominent
place later.

With the whole placeholder now being much lighter, we can stop dimming
the remaining elements.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1968
This commit is contained in:
Florian Müllner 2019-11-30 01:23:35 +01:00
parent 1054f7533a
commit 9916989272

View File

@ -451,62 +451,22 @@ class EmptyPlaceholder extends Gtk.Box {
orientation: Gtk.Orientation.VERTICAL, orientation: Gtk.Orientation.VERTICAL,
spacing: 6, spacing: 6,
margin: 32, margin: 32,
valign: Gtk.Align.CENTER,
}); });
let image = new Gtk.Image({ let image = new Gtk.Image({
icon_name: 'application-x-addon-symbolic', icon_name: 'application-x-addon-symbolic',
pixel_size: 96, pixel_size: 96,
visible: true, visible: true,
vexpand: true,
valign: Gtk.Align.END,
}); });
image.get_style_context().add_class(Gtk.STYLE_CLASS_DIM_LABEL);
this.add(image); this.add(image);
let label = new Gtk.Label({ let label = new Gtk.Label({
label: `<b><span size="x-large">${_("No Extensions Installed")}</span></b>`, label: `<b><span size="x-large">${_('No Installed Extensions')}</span></b>`,
use_markup: true, use_markup: true,
visible: true, visible: true,
}); });
label.get_style_context().add_class(Gtk.STYLE_CLASS_DIM_LABEL);
this.add(label); this.add(label);
let appInfo = Gio.DesktopAppInfo.new('org.gnome.Software.desktop');
let desc = new Gtk.Label({
label: _("Extensions can be installed through Software or <a href=\"https://extensions.gnome.org\">extensions.gnome.org</a>."),
use_markup: true,
wrap: true,
justify: Gtk.Justification.CENTER,
visible: true,
max_width_chars: 50,
hexpand: true,
vexpand: appInfo == null,
halign: Gtk.Align.CENTER,
valign: Gtk.Align.START,
});
this.add(desc);
if (appInfo) {
let button = new Gtk.Button({
label: _("Browse in Software"),
image: new Gtk.Image({
icon_name: "org.gnome.Software-symbolic",
}),
always_show_image: true,
margin_top: 12,
visible: true,
halign: Gtk.Align.CENTER,
valign: Gtk.Align.START,
vexpand: true,
});
this.add(button);
button.connect('clicked', w => {
let context = w.get_display().get_app_launch_context();
appInfo.launch([], context);
});
}
} }
}); });