Skip to content

Commit

Permalink
tools: add small donate button in the statusbar
Browse files Browse the repository at this point in the history
  • Loading branch information
dbartolini committed Nov 5, 2024
1 parent a901554 commit 5f2e38b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/level_editor/resources/icons/hearth-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tools/level_editor/resources/resources.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
<file compressed="true" preprocess="xml-stripblanks">icons/crown.svg</file>
<file compressed="true" preprocess="xml-stripblanks">icons/game-run-symbolic.svg</file>
<file compressed="true" preprocess="xml-stripblanks">icons/game-stop-symbolic.svg</file>
<file compressed="true" preprocess="xml-stripblanks">icons/hearth-symbolic.svg</file>
<file compressed="true" preprocess="xml-stripblanks">icons/layer-locked-symbolic.svg</file>
<file compressed="true" preprocess="xml-stripblanks">icons/layer-visible-symbolic.svg</file>
<file compressed="true" preprocess="xml-stripblanks">icons/level-layers-symbolic.svg</file>
Expand Down
7 changes: 7 additions & 0 deletions tools/level_editor/statusbar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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");
Expand All @@ -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");
}

Expand Down

0 comments on commit 5f2e38b

Please sign in to comment.