Skip to content
Snippets Groups Projects
Commit aafe750b authored by Bruce Cowan's avatar Bruce Cowan
Browse files

Add primary menu

parent 8229bcb5
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.0 -->
<!--
SPDX-FileCopyrightText: 2012-2019 Bruce Cowan <bruce@bcowan.me.uk>
SPDX-FileCopyrightText: 2012-2020 Bruce Cowan <bruce@bcowan.me.uk>
SPDX-License-Identifier: LGPL-3.0-or-later
-->
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.16"/>
<object class="GtkAdjustment" id="adjustment1">
......@@ -12,8 +12,30 @@
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkPopoverMenu" id="popovermenu1">
<property name="can_focus">False</property>
<child>
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="action_name">app.about</property>
<property name="text" translatable="yes">About Rugby</property>
</object>
<packing>
<property name="submenu">main</property>
</packing>
</child>
</object>
<template class="RugbyAppWindow" parent="GtkApplicationWindow">
<property name="can_focus">False</property>
<child>
<object class="GtkListBox" id="listbox">
<property name="height_request">400</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar">
<property name="visible">True</property>
......@@ -52,13 +74,24 @@
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkListBox" id="listbox">
<property name="height_request">400</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="popover">popovermenu1</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">open-menu-symbolic</property>
</object>
</child>
</object>
<packing>
<property name="pack_type">end</property>
</packing>
</child>
</object>
</child>
</template>
......
<?xml version="1.0"?>
<!--
SPDX-FileCopyrightText: 2017 Bruce Cowan <bruce@bcowan.me.uk>
SPDX-License-Identifier: LGPL-3.0-or-later
-->
<interface>
<menu id="appmenu">
<section>
<item>
<attribute name="label" translatable="yes">_About</attribute>
<attribute name="action">app.about</attribute>
<attribute name="accel">&lt;Primary&gt;a</attribute>
</item>
</section>
<section>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
</item>
</section>
</menu>
</interface>
......@@ -7,7 +7,6 @@
<gresources>
<gresource prefix="/uk/me/bcowan/rugby">
<file preprocess="xml-stripblanks">interface.ui</file>
<file preprocess="xml-stripblanks">menu.ui</file>
<file compressed="true">rugby.css</file>
</gresource>
</gresources>
#!/bin/sh
# SPDX-FileCopyrightText: 2018, 2019 Bruce Cowan <bruce@bcowan.me.uk>
# SPDX-FileCopyrightText: 2018-2020 Bruce Cowan <bruce@bcowan.me.uk>
#
# SPDX-License-Identifier: CC0-1.0
git log -1 --format=%cd --date-format:%Y
git log -1 --format=%cd --date=format:%Y
......@@ -36,15 +36,6 @@ about_activated (GSimpleAction *simple,
"authors", authors,
"comments", "Rugby scores possiblities program",
NULL);
}
static void
quit_activated (GSimpleAction *simple,
GVariant *parameter,
gpointer user_data)
{
g_application_quit (G_APPLICATION (user_data));
}
static void
......@@ -53,8 +44,7 @@ on_startup (GApplication *app,
{
const GActionEntry app_entries[] =
{
{ "about", about_activated },
{ "quit", quit_activated }
{ .name = "about", .activate = about_activated },
};
g_action_map_add_action_entries (G_ACTION_MAP (app),
......@@ -62,10 +52,6 @@ on_startup (GApplication *app,
G_N_ELEMENTS (app_entries),
app);
g_autoptr (GtkBuilder) builder = gtk_builder_new_from_resource ("/uk/me/bcowan/rugby/menu.ui");
GMenuModel *app_menu = G_MENU_MODEL (gtk_builder_get_object (builder, "appmenu"));
gtk_application_set_app_menu (GTK_APPLICATION (app), app_menu);
// CSS styling
g_autoptr (GtkCssProvider) provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (provider, "/uk/me/bcowan/rugby/rugby.css");
......
......@@ -9,7 +9,7 @@ conf.set('TRY_POINTS', get_option('try_points'))
conf.set('UTRY_POINTS', get_option('utry_points'))
conf.set('KICK_POINTS', get_option('kick_points'))
year = run_command('find_year.sh').stdout()
year = run_command('find_year.sh').stdout().strip()
conf.set_quoted('COPYRIGHT_YEAR', year)
config_h = configure_file(configuration: conf, output: 'config.h')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment