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
bfed29f9
Commit
bfed29f9
authored
Jan 30, 2020
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Last page: add a specific class
parent
17596715
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
image.rs
src/widgets/pages/image.rs
+13
-8
window.rs
src/widgets/window.rs
+4
-2
No files found.
src/widgets/pages/image.rs
View file @
bfed29f9
...
...
@@ -29,7 +29,7 @@ impl Pageable for ImagePageWidget {
impl
ImagePageWidget
{
pub
fn
new
(
resource_uri
:
&
str
,
title
:
String
,
head
:
String
,
body
:
String
)
->
Self
{
let
widget
=
gtk
::
Box
::
new
(
gtk
::
Orientation
::
Vertical
,
12
);
let
widget
=
gtk
::
Box
::
new
(
gtk
::
Orientation
::
Vertical
,
0
);
let
image_page
=
Self
{
widget
,
...
...
@@ -44,21 +44,24 @@ impl ImagePageWidget {
}
fn
init
(
&
self
)
{
self
.widget
.set_halign
(
gtk
::
Align
::
Center
);
self
.widget
.set_valign
(
gtk
::
Align
::
Center
);
self
.widget
.set_property_margin
(
48
);
self
.widget
.set_halign
(
gtk
::
Align
::
Fill
);
self
.widget
.set_valign
(
gtk
::
Align
::
Fill
);
let
container
=
gtk
::
Box
::
new
(
gtk
::
Orientation
::
Vertical
,
12
);
container
.set_halign
(
gtk
::
Align
::
Center
);
container
.set_valign
(
gtk
::
Align
::
Center
);
container
.set_property_margin
(
48
);
let
image
=
gtk
::
Picture
::
new_for_resource
(
Some
(
&
self
.resource_uri
));
image
.set_valign
(
gtk
::
Align
::
Start
);
self
.widget
.add
(
&
image
);
container
.add
(
&
image
);
let
head_label
=
gtk
::
Label
::
new
(
Some
(
&
self
.get_head
()));
head_label
.set_justify
(
gtk
::
Justification
::
Center
);
head_label
.set_valign
(
gtk
::
Align
::
Center
);
head_label
.set_margin_top
(
36
);
head_label
.get_style_context
()
.add_class
(
"page-title"
);
self
.widget
.add
(
&
head_label
);
container
.add
(
&
head_label
);
let
body_label
=
gtk
::
Label
::
new
(
Some
(
&
self
.get_body
()));
body_label
.set_lines
(
2
);
...
...
@@ -67,6 +70,8 @@ impl ImagePageWidget {
body_label
.set_valign
(
gtk
::
Align
::
Center
);
body_label
.get_style_context
()
.add_class
(
"page-body"
);
body_label
.set_margin_top
(
12
);
self
.widget
.add
(
&
body_label
);
container
.add
(
&
body_label
);
self
.widget
.add
(
&
container
);
}
}
src/widgets/window.rs
View file @
bfed29f9
...
...
@@ -123,12 +123,14 @@ impl Window {
gettext
(
"The Software app makese it easy to find and install all the apps you need."
),
)));
self
.paginator
.add_page
(
Box
::
new
(
ImagePageWidget
::
new
(
let
last_page
=
ImagePageWidget
::
new
(
"/org/gnome/Tour/ready-to-go.svg"
,
gettext
(
"Learn More"
),
gettext
(
"That's it! To learn more, see the Help"
),
gettext
(
"The help app contains information, tips and tricks."
),
)));
);
last_page
.widget
.get_style_context
()
.add_class
(
"last-page"
);
self
.paginator
.add_page
(
Box
::
new
(
last_page
));
self
.container
.add_named
(
&
self
.paginator.widget
,
"pages"
);
self
.widget
.add
(
&
self
.container
);
...
...
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