set icon to button, click show/hide list

This commit is contained in:
sonichy
2025-06-11 16:22:14 +08:00
parent 9d5b0a987f
commit 36e777c0c5
2 changed files with 14 additions and 4 deletions

View File

@@ -25,17 +25,24 @@ export default class ExamplePreferences extends ExtensionPreferences {
icon_name = this.dir.get_path() + '/gnome.svg'; icon_name = this.dir.get_path() + '/gnome.svg';
const icon = new Gtk.Image({ const icon = new Gtk.Image({
gicon: Gio.icon_new_for_string(icon_name), gicon: Gio.icon_new_for_string(icon_name),
pixel_size: 64 pixel_size: 32
}); });
group.add(icon); //group.add(icon);
const button = new Gtk.Button({ const button = new Gtk.Button({
label: _('Browse'), //label: _('Browse'),
valign: Gtk.Align.CENTER valign: Gtk.Align.CENTER
}); });
//button.container.add(icon); button.set_child(icon);
button.connect('clicked', () => { button.connect('clicked', () => {
console.log('button clicked!'); console.log('button clicked!');
if (scrollWindow.visible) {
searchEntry.hide();
scrollWindow.hide();
} else {
searchEntry.show();
scrollWindow.show();
}
}); });
const row_icon = new Adw.ActionRow({ const row_icon = new Adw.ActionRow({
title: _('Choose a New Icon'), title: _('Choose a New Icon'),
@@ -130,6 +137,9 @@ export default class ExamplePreferences extends ExtensionPreferences {
}); });
group.add(scrollWindow); group.add(scrollWindow);
searchEntry.hide();
scrollWindow.hide();
// /usr/share/gnome-shell/extensions/arcmenu@arcmenu.com/settings/AboutPage.js // /usr/share/gnome-shell/extensions/arcmenu@arcmenu.com/settings/AboutPage.js
const page_about = new Adw.PreferencesPage({ const page_about = new Adw.PreferencesPage({

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 4.5 MiB