Skip to content

Commit

Permalink
Setting actions to menu items, still trying to figure out accelerators
Browse files Browse the repository at this point in the history
  • Loading branch information
Alecaddd committed Jan 12, 2018
1 parent 6c5b6f8 commit 2528058
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/Utils/Dialogs.vala
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
*/

public class Akira.Utils.Dialogs : Object {
private Akira.Window window;
public weak Akira.Window window { get; construct; }

public Dialogs (Akira.Window window) {
this.window = window;
public Dialogs (Akira.Window main_window) {
Object (
window: main_window
);
}

public bool message_dialog (string title, string description, string icon, string primary_button) {
Expand Down
8 changes: 7 additions & 1 deletion src/Widgets/HeaderBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ public class Akira.Widgets.HeaderBar : Gtk.HeaderBar {
menu_items.add (new Gtk.MenuItem.with_label(_("Save")));
menu_items.add (new Gtk.MenuItem.with_label(_("Save As")));
menu_items.add (new Gtk.SeparatorMenuItem ());
menu_items.add (new Gtk.MenuItem.with_label(_("Quit")));
var quit = new Gtk.ImageMenuItem.with_label(_("Quit"));
var image = new Gtk.Image.from_icon_name ("window-close-symbolic", Gtk.IconSize.MENU);
quit.always_show_image = true;
quit.set_image (image);
quit.action_name = Akira.Window.ACTION_PREFIX + Akira.Window.ACTION_QUIT;
quit.accel_path = Akira.Window.ACTION_QUIT;
menu_items.add (quit);
menu_items.show_all ();

menu = new Akira.Partials.MenuButton ("document-open", _("Menu"), _("Open Menu"));
Expand Down

0 comments on commit 2528058

Please sign in to comment.