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
fad6492f
Commit
fad6492f
authored
Jul 14, 2020
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '18-update-labels' into 'master'
Update labels Closes #18 See merge request GNOME/gnome-tour!12
parents
d3b6be7d
e5d70d9c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
15 deletions
+37
-15
application.rs
src/application.rs
+3
-0
utils.rs
src/utils.rs
+13
-0
image.rs
src/widgets/pages/image.rs
+4
-1
welcome.rs
src/widgets/pages/welcome.rs
+2
-2
window.rs
src/widgets/window.rs
+15
-12
No files found.
src/application.rs
View file @
fad6492f
...
...
@@ -33,6 +33,7 @@ impl Application {
app
.quit
();
}),
);
// Start Tour
utils
::
action
(
&
self
.app
,
...
...
@@ -64,6 +65,7 @@ impl Application {
}
}),
);
utils
::
action
(
&
self
.app
,
"previous-page"
,
...
...
@@ -75,6 +77,7 @@ impl Application {
}
}),
);
self
.app
.set_accels_for_action
(
"app.quit"
,
&
[
"<primary>q"
]);
}
...
...
src/utils.rs
View file @
fad6492f
// based on https://gitlab.gnome.org/World/podcasts/-/blob/master/podcasts-gtk/src/i18n|utils.rs
use
gettextrs
::
gettext
;
pub
fn
action
<
T
,
F
>
(
thing
:
&
T
,
name
:
&
str
,
action
:
F
)
where
T
:
gio
::
ActionMapExt
,
...
...
@@ -10,3 +13,13 @@ where
// Add it to the map
thing
.add_action
(
&
act
);
}
pub
fn
i18n_f
(
format
:
&
str
,
args
:
&
[
&
str
])
->
String
{
let
s
=
gettext
(
format
);
let
mut
parts
=
s
.split
(
"{}"
);
let
mut
output
=
parts
.next
()
.unwrap_or
(
""
)
.to_string
();
for
(
p
,
a
)
in
parts
.zip
(
args
.iter
())
{
output
+=
&
(
a
.to_string
()
+
&
p
.to_string
());
}
output
}
src/widgets/pages/image.rs
View file @
fad6492f
...
...
@@ -34,7 +34,10 @@ impl ImagePageWidget {
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
);
container
.set_margin_bottom
(
48
);
container
.set_margin_top
(
12
);
container
.set_margin_start
(
12
);
container
.set_margin_end
(
12
);
let
image
=
gtk
::
Image
::
from_resource
(
&
resource_uri
);
image
.set_valign
(
gtk
::
Align
::
Start
);
...
...
src/widgets/pages/welcome.rs
View file @
fad6492f
...
...
@@ -51,7 +51,7 @@ impl WelcomePageWidget {
title
.show
();
self
.widget
.add
(
&
title
);
let
text
=
gtk
::
Label
::
new
(
Some
(
&
gettext
(
"Hi there!
If you are new to GNOME, you can take the tour to learn some
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
.set_margin_top
(
12
);
text
.show
();
...
...
@@ -69,7 +69,7 @@ impl WelcomePageWidget {
skip_tour_btn
.show
();
actions_container
.add
(
&
skip_tour_btn
);
let
start_tour_btn
=
gtk
::
Button
::
with_label
(
&
gettext
(
"_
Take the
Tour"
));
let
start_tour_btn
=
gtk
::
Button
::
with_label
(
&
gettext
(
"_
Start
Tour"
));
start_tour_btn
.set_property_height_request
(
40
);
start_tour_btn
.set_property_width_request
(
180
);
start_tour_btn
.set_use_underline
(
true
);
...
...
src/widgets/window.rs
View file @
fad6492f
use
crate
::
utils
;
use
gettextrs
::
gettext
;
use
gtk
::
prelude
::
*
;
use
std
::
cell
::
RefCell
;
...
...
@@ -34,7 +35,7 @@ impl Window {
}
fn
init
(
&
mut
self
)
{
self
.widget
.set_default_size
(
920
,
64
0
);
self
.widget
.set_default_size
(
720
,
50
0
);
self
.widget
.set_icon_name
(
Some
(
APP_ID
));
// Devel Profile
...
...
@@ -47,22 +48,22 @@ impl Window {
self
.paginator
.borrow_mut
()
.add_page
(
Box
::
new
(
ImagePageWidget
::
new
(
"/org/gnome/Tour/activities.svg"
,
gettext
(
"Activities Overview"
),
gettext
(
"Open Activities to
start
apps"
),
gettext
(
"
You can also view open windows, search and use workspaces
."
),
gettext
(
"Open Activities to
launch
apps"
),
gettext
(
"
The activities view can also be used to switch windows and search
."
),
)));
self
.paginator
.borrow_mut
()
.add_page
(
Box
::
new
(
ImagePageWidget
::
new
(
"/org/gnome/Tour/search.svg"
,
gettext
(
"Search"
),
gettext
(
"
In the Activities Overview, just start typing
to search"
),
gettext
(
"
Search can be used to launch apps, find settings, do calculations and much
more."
),
gettext
(
"
Just type
to search"
),
gettext
(
"
In the activities view, just start tying to search for apps, settings and
more."
),
)));
self
.paginator
.borrow_mut
()
.add_page
(
Box
::
new
(
ImagePageWidget
::
new
(
"/org/gnome/Tour/calendar.svg"
,
gettext
(
"Date & Time"
),
gettext
(
"Click the time to see
your now and next
"
),
gettext
(
"Th
is includes notifications, media controls, calendar events, the weather and world clock
s."
),
gettext
(
"Click the time to see
notifications
"
),
gettext
(
"Th
e notifications popover also includes personal planning tool
s."
),
)));
self
.paginator
.borrow_mut
()
.add_page
(
Box
::
new
(
ImagePageWidget
::
new
(
...
...
@@ -71,18 +72,20 @@ impl Window {
gettext
(
"View system information and settings"
),
gettext
(
"Get an overview of the system status and quickly change settings."
),
)));
self
.paginator
.borrow_mut
()
.add_page
(
Box
::
new
(
ImagePageWidget
::
new
(
"/org/gnome/Tour/software.svg"
,
gettext
(
"Software"
),
gettext
(
"
F
ind and install apps"
),
gettext
(
"
The Software app makes it easy to find and install all the apps you need
."
),
gettext
(
"
Use Software to f
ind and install apps"
),
gettext
(
"
Discover great apps through search, browsing and our recommendations
."
),
)));
let
name
=
glib
::
get_os_info
(
"NAME"
)
.unwrap_or
(
"GNOME"
.into
());
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
(
"T
he help app contains information, tips and tricks
."
),
gettext
(
"
Tour Completed
"
),
utils
::
i18n_f
(
"That's it! We hope that you enjoy {}."
,
&
[
&
name
]
),
gettext
(
"T
o get more advice and tips, see the Help app
."
),
);
last_page
.widget
.get_style_context
()
.add_class
(
"last-page"
);
self
.paginator
.borrow_mut
()
.add_page
(
Box
::
new
(
last_page
));
...
...
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