From 5f2e38b8ddce1db814d7b493f57c3591813e4209 Mon Sep 17 00:00:00 2001 From: Daniele Bartolini Date: Tue, 5 Nov 2024 19:33:21 +0100 Subject: [PATCH] tools: add small donate button in the statusbar --- tools/level_editor/resources/icons/hearth-symbolic.svg | 10 ++++++++++ tools/level_editor/resources/resources.gresource.xml | 1 + tools/level_editor/statusbar.vala | 7 +++++++ 3 files changed, 18 insertions(+) create mode 100644 tools/level_editor/resources/icons/hearth-symbolic.svg diff --git a/tools/level_editor/resources/icons/hearth-symbolic.svg b/tools/level_editor/resources/icons/hearth-symbolic.svg new file mode 100644 index 000000000..bd4c3c4ea --- /dev/null +++ b/tools/level_editor/resources/icons/hearth-symbolic.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tools/level_editor/resources/resources.gresource.xml b/tools/level_editor/resources/resources.gresource.xml index dab2720e4..a1e46532b 100644 --- a/tools/level_editor/resources/resources.gresource.xml +++ b/tools/level_editor/resources/resources.gresource.xml @@ -148,6 +148,7 @@ icons/crown.svg icons/game-run-symbolic.svg icons/game-stop-symbolic.svg + icons/hearth-symbolic.svg icons/layer-locked-symbolic.svg icons/layer-visible-symbolic.svg icons/level-layers-symbolic.svg diff --git a/tools/level_editor/statusbar.vala b/tools/level_editor/statusbar.vala index b3948d1f5..f568e3166 100644 --- a/tools/level_editor/statusbar.vala +++ b/tools/level_editor/statusbar.vala @@ -15,6 +15,7 @@ public class Statusbar : Gtk.Box // Widgets public Gtk.Label _status; public Gtk.Label _temporary_message; + public Gtk.Button _donate; public Gtk.Button _version; public Statusbar() @@ -29,6 +30,11 @@ public class Statusbar : Gtk.Box // Widgets _status = new Gtk.Label("Idle"); _temporary_message = new Gtk.Label(""); + _donate = new Gtk.Button.from_icon_name("hearth-symbolic", Gtk.IconSize.SMALL_TOOLBAR); + _donate.get_style_context().add_class("flat"); + _donate.clicked.connect(() => { + GLib.Application.get_default().activate_action("donate", null); + }); _version = new Gtk.Button.with_label(CROWN_VERSION); _version.get_style_context().add_class("flat"); _version.get_style_context().add_class("compact"); @@ -39,6 +45,7 @@ public class Statusbar : Gtk.Box this.pack_start(_status, false, false, 0); this.pack_start(_temporary_message, false, false, 0); this.pack_end(_version, false, false, 0); + this.pack_end(_donate, false, false, 6); this.get_style_context().add_class("statusbar"); }