recreated python fully

This commit is contained in:
Vivianne 2022-03-18 00:13:47 -07:00
parent dec437969c
commit 83ced714d7
3 changed files with 12 additions and 7 deletions

View File

@ -3,16 +3,19 @@ namespace Deskcandy {
public class Application : Gtk.Application {
private Gtk.Window window;
public bool enabled { get; set; }
public Application() {
Object(application_id: "moe.solarpunk.Deskcandy");
var xwinwrap_enabled_prop = new PropertyAction("xwinwrap-enabled", this, "xwinwrap-enabled");
xwinwrap_enabled_prop.notify.connect(this.on_xwinwrap_enabled_changed);
var toggle_enabled = new PropertyAction("toggle-enabled", this, "enabled");
toggle_enabled.notify.connect(this.on_toggle_enabled);
this.add_action(toggle_enabled);
this.set_up_actions();
}
private void on_xwinwrap_enabled_changed() {
private void on_toggle_enabled() {
}
private void set_up_actions() {

View File

@ -906,7 +906,7 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="tooltip-text" translatable="yes">Start or stop the desktop effects</property>
<property name="action-name">app.xwinwrap-enabled</property>
<property name="action-name">app.toggle-enabled</property>
</object>
<packing>
<property name="position">1</property>

View File

@ -23,6 +23,7 @@ namespace Deskcandy {
var create_preset = new SimpleAction("create", null);
preset_action_group.add_action(create_preset);
create_preset.activate.connect(this.on_create_preset);
var delete_preset = new SimpleAction("delete", null);
delete_preset.activate.connect(this.on_delete_preset);
preset_action_group.add_action(delete_preset);
@ -33,7 +34,7 @@ namespace Deskcandy {
var menu = (GLib.MenuModel)builder.get_object("main_menu");
this.open_menu_button.menu_model = menu;
app.connect("notify::xwinwrap-enabled", this.on_notify_xwinwrap_enabled);
app.notify["enabled"].connect(this.on_notify_enabled);
this.refresh_socket();
}
@ -87,8 +88,9 @@ namespace Deskcandy {
message("delete");
}
private void on_notify_xwinwrap_enabled(Gtk.Widget w, Gtk.Application app, GLib.PropertyAction prop) {
this.headerbar.subtitle = prop.enabled ? "started" : "stopped";
private void on_notify_enabled(Object o, GLib.ParamSpec param) {
var val = ((Application)o).enabled;
this.headerbar.subtitle = val ? "started" : "stopped";
}
}
}