Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
randomizer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Francois Techene
randomizer
Commits
4923d859
Commit
4923d859
authored
Jan 06, 2021
by
Francois Techene
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented firt UIs
parent
14c039f2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
130 additions
and
25 deletions
+130
-25
src/icons/checkbox-checked-symbolic.svg
src/icons/checkbox-checked-symbolic.svg
+6
-0
src/icons/numbers-symbolic.svg
src/icons/numbers-symbolic.svg
+36
-0
src/randomizer-window.c
src/randomizer-window.c
+11
-6
src/randomizer-window.h
src/randomizer-window.h
+4
-1
src/randomizer-window.ui
src/randomizer-window.ui
+70
-17
src/randomizer.gresource.xml
src/randomizer.gresource.xml
+3
-1
No files found.
src/icons/checkbox-checked-symbolic.svg
0 → 100644
View file @
4923d859
<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>
src/icons/numbers-symbolic.svg
0 → 100644
View file @
4923d859
<?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>
src/randomizer-window.c
View file @
4923d859
...
...
@@ -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
);
}
src/randomizer-window.h
View file @
4923d859
...
...
@@ -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
src/randomizer-window.ui
View file @
4923d859
<?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>
src/randomizer.gresource.xml
View file @
4923d859
<?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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment