Commit 4923d859 authored by Francois Techene's avatar Francois Techene

Implemented firt UIs

parent 14c039f2
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<g color="#000" font-weight="400" fill="#474747">
<path d="M3.5 1A2.506 2.506 0 0 0 1 3.5v9C1 13.876 2.124 15 3.5 15h9c1.376 0 2.5-1.124 2.5-2.5v-9C15 2.124 13.876 1 12.5 1zm0 1h9c.84 0 1.5.66 1.5 1.5v9c0 .84-.66 1.5-1.5 1.5h-9c-.84 0-1.5-.66-1.5-1.5v-9C2 2.66 2.66 2 3.5 2z" style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal;marker:none" font-family="sans-serif" white-space="normal" overflow="visible"/>
<path d="M14.5 2.5l-6 6-2-2-2 2 4 4 6-6z" style="line-height:normal;-inkscape-font-specification:Sans;text-indent:0;text-align:start;text-decoration-line:none;text-transform:none;marker:none" font-family="Sans" overflow="visible"/>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
version="1.1"
id="svg8">
<metadata
id="metadata14">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs12" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:800;font-stretch:normal;font-size:6.16639px;line-height:102.6%;font-family:Cantarell;-inkscape-font-specification:'Cantarell Ultra-Bold';text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#474747;fill-opacity:1;stroke-width:0.262193;stroke-linecap:square"
x="8.0277462"
y="10.139737"
id="text843"><tspan
id="tspan841"
x="8.0277462"
y="10.139737"
style="fill:#474747;fill-opacity:1;stroke-width:0.262193">1 2 3</tspan></text>
</svg>
......@@ -21,14 +21,13 @@
struct _RandomizerWindow
{
GtkApplicationWindow parent_instance;
HdyWindow parent_instance;
/* Template widgets */
GtkHeaderBar *header_bar;
GtkLabel *label;
HdyViewSwitcherTitle *switcher_title;
};
G_DEFINE_TYPE (RandomizerWindow, randomizer_window, GTK_TYPE_APPLICATION_WINDOW)
G_DEFINE_TYPE (RandomizerWindow, randomizer_window, HDY_TYPE_WINDOW)
static void
randomizer_window_class_init (RandomizerWindowClass *klass)
......@@ -36,8 +35,8 @@ randomizer_window_class_init (RandomizerWindowClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gtk_widget_class_set_template_from_resource (widget_class, "/sm/puri/Randomizer/randomizer-window.ui");
gtk_widget_class_bind_template_child (widget_class, RandomizerWindow, header_bar);
gtk_widget_class_bind_template_child (widget_class, RandomizerWindow, label);
gtk_widget_class_bind_template_child (widget_class, RandomizerWindow, switcher_title);
//gtk_widget_class_bind_template_child (widget_class, RandomizerWindow, label);
}
static void
......@@ -45,3 +44,9 @@ randomizer_window_init (RandomizerWindow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
RandomizerWindow *
randomizer_window_new (void)
{
return g_object_new (RANDOMIZER_TYPE_WINDOW, NULL);
}
......@@ -19,11 +19,14 @@
#pragma once
#include <gtk/gtk.h>
#include <handy.h>
G_BEGIN_DECLS
#define RANDOMIZER_TYPE_WINDOW (randomizer_window_get_type())
G_DECLARE_FINAL_TYPE (RandomizerWindow, randomizer_window, RANDOMIZER, WINDOW, GtkApplicationWindow)
G_DECLARE_FINAL_TYPE (RandomizerWindow, randomizer_window, RANDOMIZER, WINDOW, HdyWindow)
RandomizerWindow *randomizer_window_new (void);
G_END_DECLS
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.24"/>
<template class="RandomizerWindow" parent="GtkApplicationWindow">
<property name="default-width">600</property>
<requires lib="libhandy" version="0.0"/>
<template class="RandomizerWindow" parent="HdyWindow">
<property name="default-width">600</property>
<property name="default-height">300</property>
<child type="titlebar">
<object class="GtkHeaderBar" id="header_bar">
<property name="visible">True</property>
<property name="show-close-button">True</property>
<property name="title">Hello, World!</property>
</object>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="label">Hello, World!</property>
<object class="GtkBox">
<property name="visible">True</property>
<attributes>
<attribute name="weight" value="bold"/>
<attribute name="scale" value="2"/>
</attributes>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="HdyHeaderBar">
<property name="visible">True</property>
<property name="centering_policy">strict</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<property name="title">HdyViewSwitcher Demo</property>
<child type="title">
<object class="HdyViewSwitcherTitle" id="switcher_title">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">stack</property>
<property name="title" translatable="yes">Randomizer</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin">24</property>
<property name="label" translatable="yes">Yes or No ?</property>
</object>
<packing>
<property name="name">page1</property>
<property name="title" translatable="yes">Yes/No</property>
<property name="icon_name">checkbox-checked-symbolic</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="margin">24</property>
<property name="label" translatable="yes">Generate a random number</property>
</object>
<packing>
<property name="name">page2</property>
<property name="title" translatable="yes">Number</property>
<property name="icon_name">numbers-symbolic</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<object class="HdyViewSwitcherBar" id="switcher_bar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">stack</property>
<property name="reveal" bind-source="switcher_title" bind-property="title-visible" bind-flags="sync-create"/>
</object>
</child>
</object>
</child>
</template>
</interface>
</template>
</interface>
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/sm/puri/Randomizer">
<file>randomizer-window.ui</file>
<file preprocess="xml-stripblanks">randomizer-window.ui</file>
<file preprocess="xml-stripblanks">icons/checkbox-checked-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/numbers-symbolic.svg</file>
</gresource>
</gresources>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment