Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-welcome
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-welcome
Commits
81dc8443
Commit
81dc8443
authored
Aug 10, 2020
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
surround the welcome page with a handy handle
parent
b51e78f3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
welcome.rs
src/widgets/pages/welcome.rs
+16
-11
No files found.
src/widgets/pages/welcome.rs
View file @
81dc8443
...
@@ -6,12 +6,12 @@ use gio::FileExt;
...
@@ -6,12 +6,12 @@ use gio::FileExt;
use
gtk
::
prelude
::
*
;
use
gtk
::
prelude
::
*
;
pub
struct
WelcomePageWidget
{
pub
struct
WelcomePageWidget
{
pub
widget
:
gtk
::
Box
,
pub
widget
:
libhandy
::
WindowHandle
,
}
}
impl
WelcomePageWidget
{
impl
WelcomePageWidget
{
pub
fn
new
()
->
Self
{
pub
fn
new
()
->
Self
{
let
widget
=
gtk
::
Box
::
new
(
gtk
::
Orientation
::
Vertical
,
0
);
let
widget
=
libhandy
::
WindowHandle
::
new
(
);
let
welcome_page
=
Self
{
widget
};
let
welcome_page
=
Self
{
widget
};
welcome_page
.init
();
welcome_page
.init
();
...
@@ -65,29 +65,31 @@ impl WelcomePageWidget {
...
@@ -65,29 +65,31 @@ impl WelcomePageWidget {
}
}
fn
init
(
&
self
)
{
fn
init
(
&
self
)
{
self
.widget
.set_property_expand
(
true
);
let
container
=
gtk
::
Box
::
new
(
gtk
::
Orientation
::
Vertical
,
0
);
self
.widget
.set_valign
(
gtk
::
Align
::
Center
);
self
.widget
.set_halign
(
gtk
::
Align
::
Center
);
container
.set_property_expand
(
true
);
self
.widget
.set_margin_top
(
24
);
container
.set_valign
(
gtk
::
Align
::
Center
);
self
.widget
.set_margin_bottom
(
24
);
container
.set_halign
(
gtk
::
Align
::
Center
);
container
.set_margin_top
(
24
);
container
.set_margin_bottom
(
24
);
let
name
=
glib
::
get_os_info
(
"NAME"
)
.unwrap_or_else
(||
"GNOME"
.into
());
let
name
=
glib
::
get_os_info
(
"NAME"
)
.unwrap_or_else
(||
"GNOME"
.into
());
let
version
=
glib
::
get_os_info
(
"VERSION"
)
.unwrap_or_else
(||
"3.36"
.into
());
let
version
=
glib
::
get_os_info
(
"VERSION"
)
.unwrap_or_else
(||
"3.36"
.into
());
let
header
=
self
.get_header_widget
();
let
header
=
self
.get_header_widget
();
self
.widget
.add
(
&
header
);
container
.add
(
&
header
);
let
title
=
gtk
::
Label
::
new
(
Some
(
&
gettext
(
format!
(
"Welcome to {} {}"
,
name
,
version
))));
let
title
=
gtk
::
Label
::
new
(
Some
(
&
gettext
(
format!
(
"Welcome to {} {}"
,
name
,
version
))));
title
.set_margin_top
(
36
);
title
.set_margin_top
(
36
);
title
.get_style_context
()
.add_class
(
"large-title"
);
title
.get_style_context
()
.add_class
(
"large-title"
);
title
.show
();
title
.show
();
self
.widget
.add
(
&
title
);
container
.add
(
&
title
);
let
text
=
gtk
::
Label
::
new
(
Some
(
&
gettext
(
"Hi there! Take the tour to learn your way around and discover essential features."
)));
let
text
=
gtk
::
Label
::
new
(
Some
(
&
gettext
(
"Hi there! Take the tour to learn your way around and discover essential features."
)));
text
.get_style_context
()
.add_class
(
"body"
);
text
.get_style_context
()
.add_class
(
"body"
);
text
.set_margin_top
(
12
);
text
.set_margin_top
(
12
);
text
.show
();
text
.show
();
self
.widget
.add
(
&
text
);
container
.add
(
&
text
);
let
actions_container
=
gtk
::
Box
::
new
(
gtk
::
Orientation
::
Horizontal
,
12
);
let
actions_container
=
gtk
::
Box
::
new
(
gtk
::
Orientation
::
Horizontal
,
12
);
actions_container
.set_halign
(
gtk
::
Align
::
Center
);
actions_container
.set_halign
(
gtk
::
Align
::
Center
);
...
@@ -113,7 +115,10 @@ impl WelcomePageWidget {
...
@@ -113,7 +115,10 @@ impl WelcomePageWidget {
actions_container
.show
();
actions_container
.show
();
self
.widget
.add
(
&
actions_container
);
container
.add
(
&
actions_container
);
container
.show
();
self
.widget
.add
(
&
container
);
self
.widget
.show
();
self
.widget
.show
();
}
}
}
}
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