Skip to content

Commit 2e10fb5

Browse files
authored
Reapply Use switch instead of CheckBox (#1589)
1 parent 4da179e commit 2e10fb5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Services/PluginManager.vala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ public class Scratch.Services.PluginsManager : GLib.Object {
159159
private Gtk.Widget get_widget_for_plugin_info (Object obj) {
160160
var info = (Peas.PluginInfo)obj;
161161

162-
var checkbox = new Gtk.CheckButton () {
162+
var load_switch = new Gtk.Switch () {
163163
valign = CENTER,
164-
active = info.is_loaded ()
164+
state = info.is_loaded ()
165165
};
166166

167167
var image = new Gtk.Image.from_icon_name (info.get_icon_name (), LARGE_TOOLBAR) {
@@ -196,11 +196,11 @@ public class Scratch.Services.PluginsManager : GLib.Object {
196196
};
197197
content.add (image);
198198
content.add (description_box);
199-
content.add (checkbox);
199+
content.add (load_switch);
200200
content.set_data<string> ("name", info.get_name ());
201201

202-
checkbox.toggled.connect (() => {
203-
if (checkbox.active) {
202+
load_switch.notify["active"].connect (() => {
203+
if (load_switch.active) {
204204
engine.load_plugin (info);
205205
} else {
206206
engine.unload_plugin (info);

0 commit comments

Comments
 (0)