Move menus to ag-header-bar.ui and into menu-model
For some reason it stopped working with 3.16 (I’m not sure if it was OK in 3.14, though).
This commit is contained in:
parent
82a22241c9
commit
d2781a6eb2
@ -99,38 +99,6 @@ static GParamSpec *properties[PROP_COUNT];
|
|||||||
|
|
||||||
#define GET_PRIV(o) AgWindowPrivate *priv = ag_window_get_instance_private((o))
|
#define GET_PRIV(o) AgWindowPrivate *priv = ag_window_get_instance_private((o))
|
||||||
|
|
||||||
static void
|
|
||||||
ag_window_gear_menu_action(GSimpleAction *action,
|
|
||||||
GVariant *parameter,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GVariant *state;
|
|
||||||
|
|
||||||
state = g_action_get_state(G_ACTION(action));
|
|
||||||
g_action_change_state(
|
|
||||||
G_ACTION(action),
|
|
||||||
g_variant_new_boolean(!g_variant_get_boolean(state))
|
|
||||||
);
|
|
||||||
|
|
||||||
g_variant_unref(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
ag_window_view_menu_action(GSimpleAction *action,
|
|
||||||
GVariant *parameter,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
GVariant *state;
|
|
||||||
|
|
||||||
state = g_action_get_state(G_ACTION(action));
|
|
||||||
g_action_change_state(
|
|
||||||
G_ACTION(action),
|
|
||||||
g_variant_new_boolean(!g_variant_get_boolean(state))
|
|
||||||
);
|
|
||||||
|
|
||||||
g_variant_unref(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
const gchar *
|
const gchar *
|
||||||
ag_window_planet_character(GswePlanet planet)
|
ag_window_planet_character(GswePlanet planet)
|
||||||
{
|
{
|
||||||
@ -1670,8 +1638,6 @@ static GActionEntry win_entries[] = {
|
|||||||
{ "save", ag_window_save_action, NULL, NULL, NULL },
|
{ "save", ag_window_save_action, NULL, NULL, NULL },
|
||||||
{ "export-agc", ag_window_export_agc_action, NULL, NULL, NULL },
|
{ "export-agc", ag_window_export_agc_action, NULL, NULL, NULL },
|
||||||
{ "export-image", ag_window_export_image_action, NULL, NULL, NULL },
|
{ "export-image", ag_window_export_image_action, NULL, NULL, NULL },
|
||||||
{ "view-menu", ag_window_view_menu_action, NULL, "false", NULL },
|
|
||||||
{ "gear-menu", ag_window_gear_menu_action, NULL, "false", NULL },
|
|
||||||
{ "change-tab", ag_window_change_tab_action, "s", "'edit'", NULL },
|
{ "change-tab", ag_window_change_tab_action, "s", "'edit'", NULL },
|
||||||
{ "new-chart", ag_window_new_chart_action, NULL, NULL, NULL },
|
{ "new-chart", ag_window_new_chart_action, NULL, NULL, NULL },
|
||||||
{ "back", ag_window_back_action, NULL, NULL, NULL },
|
{ "back", ag_window_back_action, NULL, NULL, NULL },
|
||||||
|
@ -1,6 +1,61 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.0"/>
|
<requires lib="gtk+" version="3.0"/>
|
||||||
|
<menu id="menu_gear_menu">
|
||||||
|
<section>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">Save</attribute>
|
||||||
|
<attribute name="action">win.save</attribute>
|
||||||
|
<attribute name="accel"><Primary>s</attribute>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">Export…</attribute>
|
||||||
|
<attribute name="action">win.export-agc</attribute>
|
||||||
|
<attribute name="accel"><Primary><Shift>e</attribute>
|
||||||
|
</item>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">Export as image…</attribute>
|
||||||
|
<attribute name="action">win.export-image</attribute>
|
||||||
|
</item>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">Close</attribute>
|
||||||
|
<attribute name="action">win.close</attribute>
|
||||||
|
<attribute name="accel"><Primary>w</attribute>
|
||||||
|
</item>
|
||||||
|
</section>
|
||||||
|
</menu>
|
||||||
|
<menu id="menu_view_menu">
|
||||||
|
<section>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">Edit</attribute>
|
||||||
|
<attribute name="action">win.change-tab</attribute>
|
||||||
|
<attribute name="accel"><F4></attribute>
|
||||||
|
<attribute name="target">edit</attribute>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">Chart</attribute>
|
||||||
|
<attribute name="action">win.change-tab</attribute>
|
||||||
|
<attribute name="accel"><F5></attribute>
|
||||||
|
<attribute name="target">chart</attribute>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">Aspects</attribute>
|
||||||
|
<attribute name="action">win.change-tab</attribute>
|
||||||
|
<attribute name="accel"><F6></attribute>
|
||||||
|
<attribute name="target">aspects</attribute>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<attribute name="label" translatable="yes">Points</attribute>
|
||||||
|
<attribute name="action">win.change-tab</attribute>
|
||||||
|
<attribute name="accel"><F7></attribute>
|
||||||
|
<attribute name="target">points</attribute>
|
||||||
|
</item>
|
||||||
|
</section>
|
||||||
|
</menu>
|
||||||
<template class="AgHeaderBar" parent="GtkHeaderBar">
|
<template class="AgHeaderBar" parent="GtkHeaderBar">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="show_close_button">True</property>
|
<property name="show_close_button">True</property>
|
||||||
@ -111,7 +166,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuButton" id="view_menu">
|
<object class="GtkMenuButton" id="view_menu">
|
||||||
<property name="action_name">win.view-menu</property>
|
<property name="menu-model">menu_view_menu</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="image-button"/>
|
<class name="image-button"/>
|
||||||
</style>
|
</style>
|
||||||
@ -126,7 +181,7 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="GtkMenuButton" id="gear_menu">
|
<object class="GtkMenuButton" id="gear_menu">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="action_name">win.gear-menu</property>
|
<property name="menu-model">menu_gear_menu</property>
|
||||||
<style>
|
<style>
|
||||||
<class name="image-button"/>
|
<class name="image-button"/>
|
||||||
</style>
|
</style>
|
||||||
|
@ -2,61 +2,6 @@
|
|||||||
<!-- Generated with glade 3.18.3 -->
|
<!-- Generated with glade 3.18.3 -->
|
||||||
<interface>
|
<interface>
|
||||||
<requires lib="gtk+" version="3.12"/>
|
<requires lib="gtk+" version="3.12"/>
|
||||||
<menu id="view_menu">
|
|
||||||
<section>
|
|
||||||
<item>
|
|
||||||
<attribute name="label" translatable="yes">Edit</attribute>
|
|
||||||
<attribute name="action">win.change-tab</attribute>
|
|
||||||
<attribute name="accel"><F4></attribute>
|
|
||||||
<attribute name="target">edit</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="label" translatable="yes">Chart</attribute>
|
|
||||||
<attribute name="action">win.change-tab</attribute>
|
|
||||||
<attribute name="accel"><F5></attribute>
|
|
||||||
<attribute name="target">chart</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="label" translatable="yes">Aspects</attribute>
|
|
||||||
<attribute name="action">win.change-tab</attribute>
|
|
||||||
<attribute name="accel"><F6></attribute>
|
|
||||||
<attribute name="target">aspects</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="label" translatable="yes">Points</attribute>
|
|
||||||
<attribute name="action">win.change-tab</attribute>
|
|
||||||
<attribute name="accel"><F7></attribute>
|
|
||||||
<attribute name="target">points</attribute>
|
|
||||||
</item>
|
|
||||||
</section>
|
|
||||||
</menu>
|
|
||||||
<menu id="gear_menu">
|
|
||||||
<section>
|
|
||||||
<item>
|
|
||||||
<attribute name="label" translatable="yes">Save</attribute>
|
|
||||||
<attribute name="action">win.save</attribute>
|
|
||||||
<attribute name="accel"><Primary>s</attribute>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<attribute name="label" translatable="yes">Export…</attribute>
|
|
||||||
<attribute name="action">win.export-agc</attribute>
|
|
||||||
<attribute name="accel"><Primary><Shift>e</attribute>
|
|
||||||
</item>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<item>
|
|
||||||
<attribute name="label" translatable="yes">Export as image…</attribute>
|
|
||||||
<attribute name="action">win.export-image</attribute>
|
|
||||||
</item>
|
|
||||||
</section>
|
|
||||||
<section>
|
|
||||||
<item>
|
|
||||||
<attribute name="label" translatable="yes">Close</attribute>
|
|
||||||
<attribute name="action">win.close</attribute>
|
|
||||||
<attribute name="accel"><Primary>w</attribute>
|
|
||||||
</item>
|
|
||||||
</section>
|
|
||||||
</menu>
|
|
||||||
<object class="GtkListStore" id="house_system_model">
|
<object class="GtkListStore" id="house_system_model">
|
||||||
<columns>
|
<columns>
|
||||||
<!-- column-name house-system-id -->
|
<!-- column-name house-system-id -->
|
||||||
|
Loading…
Reference in New Issue
Block a user