[gnome-games/wip/exalm/ds: 13/21] nintendo-ds: Add NintendoDsLayoutItem
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/ds: 13/21] nintendo-ds: Add NintendoDsLayoutItem
- Date: Sat, 19 Jan 2019 14:05:59 +0000 (UTC)
commit ac1e8c3483acf7dc015ceaf2509aa9532ba009e2
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Sun Jan 6 20:47:41 2019 +0500
nintendo-ds: Add NintendoDsLayoutItem
It will be used in screen layout switcher in the next commit.
plugins/nintendo-ds/data/meson.build | 6 +++++
plugins/nintendo-ds/data/nintendo-ds.gresource.xml | 6 +++++
.../nintendo-ds/data/ui/nintendo-ds-layout-item.ui | 26 ++++++++++++++++++++++
plugins/nintendo-ds/src/meson.build | 3 ++-
.../nintendo-ds/src/nintendo-ds-layout-item.vala | 23 +++++++++++++++++++
5 files changed, 63 insertions(+), 1 deletion(-)
---
diff --git a/plugins/nintendo-ds/data/meson.build b/plugins/nintendo-ds/data/meson.build
index 007c8981..0100e094 100644
--- a/plugins/nintendo-ds/data/meson.build
+++ b/plugins/nintendo-ds/data/meson.build
@@ -1,5 +1,11 @@
install_data (plugin_name + '.plugin', install_dir: plugins_dir)
+nintendo_ds_resources = gnome.compile_resources (
+ 'nintendo-ds',
+ 'nintendo-ds.gresource.xml',
+ c_name: 'resources'
+)
+
configure_file (
input: 'org.gnome.Games.plugins.nintendo-ds.gschema.xml',
output: 'org.gnome.Games.plugins.nintendo-ds.gschema.xml',
diff --git a/plugins/nintendo-ds/data/nintendo-ds.gresource.xml
b/plugins/nintendo-ds/data/nintendo-ds.gresource.xml
new file mode 100644
index 00000000..8a9a07e0
--- /dev/null
+++ b/plugins/nintendo-ds/data/nintendo-ds.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/Games/plugins/nintendo-ds">
+ <file>ui/nintendo-ds-layout-item.ui</file>
+ </gresource>
+</gresources>
diff --git a/plugins/nintendo-ds/data/ui/nintendo-ds-layout-item.ui
b/plugins/nintendo-ds/data/ui/nintendo-ds-layout-item.ui
new file mode 100644
index 00000000..7971f6cd
--- /dev/null
+++ b/plugins/nintendo-ds/data/ui/nintendo-ds-layout-item.ui
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <requires lib="gtk+" version="3.16"/>
+ <template class="GamesNintendoDsLayoutItem" parent="GtkFlowBoxChild">
+ <property name="visible">True</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="margin">6</property>
+ <property name="spacing">6</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkImage" id="icon">
+ <property name="visible">True</property>
+ <property name="pixel-size">64</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label">
+ <property name="visible">True</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>
diff --git a/plugins/nintendo-ds/src/meson.build b/plugins/nintendo-ds/src/meson.build
index 0313ac92..358c0f46 100644
--- a/plugins/nintendo-ds/src/meson.build
+++ b/plugins/nintendo-ds/src/meson.build
@@ -1,5 +1,6 @@
vala_sources = [
'nintendo-ds-icon.vala',
+ 'nintendo-ds-layout-item.vala',
'nintendo-ds-plugin.vala',
]
@@ -13,7 +14,7 @@ c_args = [
shared_module (
'games-' + plugin_name + '-plugin',
- vala_sources + c_sources,
+ vala_sources + c_sources + nintendo_ds_resources,
dependencies: gnome_games_dep,
c_args: c_args,
install: true,
diff --git a/plugins/nintendo-ds/src/nintendo-ds-layout-item.vala
b/plugins/nintendo-ds/src/nintendo-ds-layout-item.vala
new file mode 100644
index 00000000..91b9971f
--- /dev/null
+++ b/plugins/nintendo-ds/src/nintendo-ds-layout-item.vala
@@ -0,0 +1,23 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+[GtkTemplate (ui = "/org/gnome/Games/plugins/nintendo-ds/ui/nintendo-ds-layout-item.ui")]
+private class Games.NintendoDsLayoutItem : Gtk.FlowBoxChild {
+ [GtkChild]
+ private Gtk.Image icon;
+
+ [GtkChild]
+ private Gtk.Label label;
+
+ private string layout;
+
+ public NintendoDsLayoutItem (string layout, string label, string icon) {
+ this.layout = layout;
+
+ this.icon.icon_name = icon;
+ this.label.label = label;
+ }
+
+ public string get_layout () {
+ return layout;
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]