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
fc8565f7
Commit
fc8565f7
authored
Aug 05, 2020
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use libhandy::CarouselIndicator
parent
4e28f59b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
19 deletions
+22
-19
Cargo.lock
Cargo.lock
+8
-8
Cargo.toml
Cargo.toml
+1
-1
org.gnome.TourDevel.json
build-aux/org.gnome.TourDevel.json
+1
-1
welcome.rs
src/widgets/pages/welcome.rs
+3
-3
paginator.rs
src/widgets/paginator.rs
+8
-4
window.rs
src/widgets/window.rs
+1
-2
No files found.
Cargo.lock
View file @
fc8565f7
...
...
@@ -350,7 +350,7 @@ dependencies = [
"gio 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gtk 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libhandy 1.0.0
(git+https://gitlab.gnome.org/World/Rust/libhandy-rs.git
)",
"libhandy 1.0.0
-alpha (registry+https://github.com/rust-lang/crates.io-index
)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"pretty_env_logger 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
...
...
@@ -453,8 +453,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libhandy"
version = "1.0.0"
source = "
git+https://gitlab.gnome.org/World/Rust/libhandy-rs.git#8e83a51344d981f0cdb6a643ae3b6fc63b328d96
"
version = "1.0.0
-alpha
"
source = "
registry+https://github.com/rust-lang/crates.io-index
"
dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
...
...
@@ -468,14 +468,14 @@ dependencies = [
"gtk-sys 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)",
"libhandy-sys 1.0.0
(git+https://gitlab.gnome.org/World/Rust/libhandy-rs.git
)",
"libhandy-sys 1.0.0
-alpha (registry+https://github.com/rust-lang/crates.io-index
)",
"pango 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "libhandy-sys"
version = "1.0.0"
source = "
git+https://gitlab.gnome.org/World/Rust/libhandy-rs.git#8e83a51344d981f0cdb6a643ae3b6fc63b328d96
"
version = "1.0.0
-alpha
"
source = "
registry+https://github.com/rust-lang/crates.io-index
"
dependencies = [
"gdk 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gdk-pixbuf-sys 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
...
...
@@ -870,8 +870,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
"checksum libc 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3262021842bf00fe07dbd6cf34ff25c99d7a7ebef8deea84db72be3ea3bb0aff"
"checksum libhandy 1.0.0
(git+https://gitlab.gnome.org/World/Rust/libhandy-rs.git)" = "<none>
"
"checksum libhandy-sys 1.0.0
(git+https://gitlab.gnome.org/World/Rust/libhandy-rs.git)" = "<none>
"
"checksum libhandy 1.0.0
-alpha (registry+https://github.com/rust-lang/crates.io-index)" = "b9a7422b2333a10abc6075f7548c09f992907f73cb6da2e72de69c764def9378
"
"checksum libhandy-sys 1.0.0
-alpha (registry+https://github.com/rust-lang/crates.io-index)" = "6c134bdb832ef5d3812ba4aa7cd9220db6a532d8c856da66f66cfaca073b06eb
"
"checksum locale_config 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "73ac19ebe45489e5d53b4346d8b90bb3dd03275c5fdf2ce22a982516d86b535c"
"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e"
...
...
Cargo.toml
View file @
fc8565f7
...
...
@@ -11,6 +11,6 @@ gtk = { version = "0.9", features= ["v3_16"] }
gio
=
"0.9"
log
=
"0.4"
gettext-rs
=
{
version
=
"0.4"
,
features
=
["gettext-system"]
}
libhandy
=
{
git
=
"https://gitlab.gnome.org/World/Rust/libhandy-rs.git"
}
libhandy
=
"1.0.0-alpha"
pretty_env_logger
=
"0.4"
anyhow
=
"1.0"
build-aux/org.gnome.TourDevel.json
View file @
fc8565f7
...
...
@@ -48,7 +48,7 @@
"sources"
:
[{
"type"
:
"git"
,
"url"
:
"https://gitlab.gnome.org/GNOME/libhandy.git"
,
"
branch"
:
"0.83.0
"
"
commit"
:
"2e37d49b8b851315f3044aa53ccec67088859d76
"
}]
},
{
...
...
src/widgets/pages/welcome.rs
View file @
fc8565f7
...
...
@@ -36,9 +36,9 @@ impl WelcomePageWidget {
self
.widget
.set_margin_top
(
24
);
self
.widget
.set_margin_bottom
(
24
);
let
name
=
glib
::
get_os_info
(
"NAME"
)
.unwrap_or
(
"GNOME"
.into
());
let
version
=
glib
::
get_os_info
(
"VERSION"
)
.unwrap_or
(
"3.36"
.into
());
let
icon
=
glib
::
get_os_info
(
"LOGO"
)
.unwrap_or
(
"start-here-symbolic"
.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
icon
=
glib
::
get_os_info
(
"LOGO"
)
.unwrap_or
_else
(||
"start-here-symbolic"
.into
());
let
logo
=
gtk
::
Image
::
from_icon_name
(
Some
(
&
icon
),
gtk
::
IconSize
::
Dialog
);
logo
.set_pixel_size
(
196
);
...
...
src/widgets/paginator.rs
View file @
fc8565f7
...
...
@@ -5,11 +5,12 @@ use std::cell::RefCell;
use
std
::
rc
::
Rc
;
use
super
::
pages
::
Pageable
;
use
libhandy
::
prelude
::{
CarouselExt
,
HeaderBarExt
};
use
libhandy
::
prelude
::{
CarouselExt
,
CarouselIndicatorDotsExt
,
HeaderBarExt
};
pub
struct
PaginatorWidget
{
pub
widget
:
gtk
::
Box
,
carousel
:
libhandy
::
Carousel
,
carousel_dots
:
libhandy
::
CarouselIndicatorDots
,
headerbar
:
libhandy
::
HeaderBar
,
pages
:
RefCell
<
Vec
<
Box
<
dyn
Pageable
>>>
,
current_page
:
RefCell
<
u32
>
,
...
...
@@ -25,6 +26,7 @@ impl PaginatorWidget {
let
paginator
=
Rc
::
new
(
Self
{
widget
,
carousel
:
libhandy
::
Carousel
::
new
(),
carousel_dots
:
libhandy
::
CarouselIndicatorDots
::
new
(),
headerbar
:
libhandy
::
HeaderBar
::
new
(),
next_btn
:
gtk
::
Button
::
with_label
(
&
gettext
(
"_Next"
)),
close_btn
:
gtk
::
Button
::
with_label
(
&
gettext
(
"_Close"
)),
...
...
@@ -80,13 +82,13 @@ impl PaginatorWidget {
self
.next_btn
.set_opacity
(
opacity_next
);
self
.next_btn
.set_visible
(
opacity_next
>
0
_f64
);
let
pages
=
&
self
.pages
.borrow
();
let
page
=
pages
.get
(
page_nr
as
usize
)
.unwrap
();
self
.headerbar
.set_title
(
Some
(
&
page
.get_title
()));
self
.headerbar
.set_opacity
(
opacity_next
);
self
.current_page
.replace
(
page_nr
);
}
fn
init
(
&
self
,
p
:
Rc
<
Self
>
)
{
self
.carousel_dots
.show
();
self
.carousel_dots
.set_carousel
(
Some
(
&
self
.carousel
));
self
.carousel
.set_property_expand
(
true
);
self
.carousel
.set_animation_duration
(
300
);
self
.carousel
.show
();
...
...
@@ -116,9 +118,11 @@ impl PaginatorWidget {
next_overlay
.add_overlay
(
&
self
.close_btn
);
next_overlay
.show
();
self
.headerbar
.set_custom_title
(
Some
(
&
self
.carousel_dots
));
self
.headerbar
.pack_start
(
&
self
.previous_btn
);
self
.headerbar
.pack_end
(
&
next_overlay
);
self
.headerbar
.set_show_close_button
(
false
);
self
.headerbar
.set_opacity
(
0
_f64
);
self
.headerbar
.show
();
self
.widget
.add
(
&
self
.headerbar
);
...
...
src/widgets/window.rs
View file @
fc8565f7
...
...
@@ -42,7 +42,6 @@ impl Window {
if
PROFILE
==
"Devel"
{
self
.widget
.get_style_context
()
.add_class
(
"devel"
);
}
self
.paginator
.borrow_mut
()
.add_page
(
Box
::
new
(
WelcomePageWidget
::
new
()));
self
.paginator
.borrow_mut
()
.add_page
(
Box
::
new
(
ImagePageWidget
::
new
(
...
...
@@ -80,7 +79,7 @@ impl Window {
gettext
(
"Discover great apps through search, browsing and our recommendations."
),
)));
let
name
=
glib
::
get_os_info
(
"NAME"
)
.unwrap_or
(
"GNOME"
.into
());
let
name
=
glib
::
get_os_info
(
"NAME"
)
.unwrap_or
_else
(||
"GNOME"
.into
());
let
last_page
=
ImagePageWidget
::
new
(
"/org/gnome/Tour/ready-to-go.svg"
,
gettext
(
"Tour Completed"
),
...
...
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