Skip to content

Commit

Permalink
Slightly cleaned up header bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Alecaddd committed Jan 11, 2018
1 parent 65b18e0 commit 820f732
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 63 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ vala_precompile(VALA_C ${EXEC_NAME}

src/Partials/HeaderBarButton.vala
src/Partials/MenuButton.vala
src/Partials/Spacer.vala
src/Partials/Icon.vala

src/config.vala

Expand Down
32 changes: 0 additions & 32 deletions src/Partials/Icon.vala

This file was deleted.

27 changes: 0 additions & 27 deletions src/Partials/Spacer.vala

This file was deleted.

4 changes: 2 additions & 2 deletions src/Widgets/HeaderBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Akira.Widgets.HeaderBar : Gtk.HeaderBar {

public Akira.Partials.MenuButton menu;
public Akira.Partials.MenuButton toolset;
public Akira.Partials.MenuButton settings;
public Akira.Partials.HeaderBarButton settings;
public Akira.Partials.HeaderBarButton layout;
public Akira.Partials.HeaderBarButton ruler;

Expand Down Expand Up @@ -76,7 +76,7 @@ public class Akira.Widgets.HeaderBar : Gtk.HeaderBar {
toolset = new Akira.Partials.MenuButton ("insert-object", _("Add"), _("Add a New Object"));
toolset.popup = tools;

settings = new Akira.Partials.MenuButton ("open-menu", _("Settings"), _("Open Settings"));
settings = new Akira.Partials.HeaderBarButton ("preferences-other", _("Preferences"), _("Open Preferences (Ctrl+,)"));

layout = new Akira.Partials.HeaderBarButton ("preferences-system-windows", _("Layout"), _("Toggle Layout (Ctrl+.)"));
ruler = new Akira.Partials.HeaderBarButton ("applications-accessories", _("Ruler"), _("Toggle Ruler (Ctrl+⇧+R)"));
Expand Down
15 changes: 15 additions & 0 deletions src/Window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public class Akira.Window : Gtk.ApplicationWindow {
public const string ACTION_PREFIX = "win.";
public const string ACTION_NEW_WINDOW = "action_new_window";
public const string ACTION_PRESENTATION = "action_presentation";
public const string ACTION_LABELS = "action_labels";
public const string ACTION_QUIT = "action_quit";

public static Gee.MultiMap<string, string> action_accelerators = new Gee.HashMultiMap<string, string> ();

private const ActionEntry[] action_entries = {
{ ACTION_NEW_WINDOW, action_new_window },
{ ACTION_PRESENTATION, action_presentation },
{ ACTION_LABELS, action_labels },
{ ACTION_QUIT, action_quit }
};

Expand All @@ -54,6 +56,7 @@ public class Akira.Window : Gtk.ApplicationWindow {
static construct {
action_accelerators.set (ACTION_NEW_WINDOW, "<Control>n");
action_accelerators.set (ACTION_PRESENTATION, "<Control>period");
action_accelerators.set (ACTION_LABELS, "<Control>l");
action_accelerators.set (ACTION_QUIT, "<Control>q");
}

Expand Down Expand Up @@ -127,6 +130,18 @@ public class Akira.Window : Gtk.ApplicationWindow {
}
}

// This is a test, TBR!
private void action_labels () {
headerbar.toggle ();
headerbar.menu.toggle ();
headerbar.layout.toggle ();
headerbar.ruler.toggle ();
headerbar.toolset.toggle ();
headerbar.settings.toggle ();
headerbar.toggle ();
}
// END of test

private void action_quit () {
before_destroy ();
}
Expand Down

0 comments on commit 820f732

Please sign in to comment.