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
6e056116
Commit
6e056116
authored
Jan 17, 2022
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fixes-ii' into 'bilelmoussaoui/fixes'
Fixes II See merge request GNOME/gnome-tour!61
parents
86aa9043
552e4e30
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
42 deletions
+35
-42
Cargo.lock
Cargo.lock
+0
-0
Cargo.toml
Cargo.toml
+5
-5
org.gnome.Tour.metainfo.xml.in.in
data/org.gnome.Tour.metainfo.xml.in.in
+1
-1
paginator.ui
data/resources/ui/paginator.ui
+19
-30
meson.build
meson.build
+1
-0
paginator.rs
src/widgets/paginator.rs
+9
-6
No files found.
Cargo.lock
View file @
6e056116
This diff is collapsed.
Click to expand it.
Cargo.toml
View file @
6e056116
...
...
@@ -2,25 +2,25 @@
name
=
"gnome-tour"
version
=
"40.0.0"
authors
=
[
"Bilal Elmoussaoui <bil.elmoussaoui@gmail.com>"
]
edition
=
"20
18
"
edition
=
"20
21
"
[features]
video
=
[
"gst_player"
,
"gst"
]
[dependencies]
gtk
=
{
package
=
"gtk4"
,
git
=
"https://github.com/gtk-rs/gtk4-rs
"
,
features=
["v4_2"]
}
gtk
=
{
package
=
"gtk4"
,
version
=
"0.4
"
,
features=
["v4_2"]
}
log
=
"0.4"
gettext-rs
=
{
version
=
"0.7"
,
features
=
["gettext-system"]
}
adw
=
{package
=
"libadwaita"
,
git
=
"https://gitlab.gnome.org/World/Rust/libadwaita-rs
"
}
adw
=
{package
=
"libadwaita"
,
version
=
"0.1
"
}
pretty_env_logger
=
"0.4"
[dependencies.gst_player]
version
=
"0.1
7
"
version
=
"0.1
8
"
package
=
"gstreamer-player"
optional
=
true
[dependencies.gst]
version
=
"0.1
7
"
version
=
"0.1
8
"
package
=
"gstreamer"
optional
=
true
data/org.gnome.Tour.metainfo.xml.in.in
View file @
6e056116
...
...
@@ -3,7 +3,7 @@
<component
type=
"desktop-application"
>
<id>
@app-id@
</id>
<metadata_license>
CC0
</metadata_license>
<project_license>
GPL-3.0
+
</project_license>
<project_license>
GPL-3.0
-or-later
</project_license>
<name>
Tour
</name>
<summary>
GNOME Tour and Greeter
</summary>
<description>
...
...
data/resources/ui/paginator.ui
View file @
6e056116
...
...
@@ -15,15 +15,13 @@
</object>
</child>
<child>
<object
class=
"GtkBox"
>
<property
name=
"margin-start"
>
12
</property>
<property
name=
"margin-end"
>
12
</property>
<child>
<object
class=
"GtkOverlay"
id=
"previous_overlay"
>
<property
name=
"valign"
>
center
</property>
<child
>
<child
type=
"overlay"
>
<object
class=
"GtkButton"
id=
"previous_btn"
>
<property
name=
"margin-start"
>
12
</property>
<property
name=
"icon-name"
>
left-large-symbolic
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"valign"
>
center
</property>
<property
name=
"action-name"
>
app.previous-page
</property>
<property
name=
"tooltip-text"
translatable=
"yes"
>
Previous
</property>
...
...
@@ -32,46 +30,37 @@
</style>
</object>
</child>
</object>
</child>
<child>
<object
class=
"AdwCarousel"
id=
"carousel"
>
<property
name=
"hexpand"
>
True
</property>
<property
name=
"vexpand"
>
True
</property>
</object>
</child>
<child>
<object
class=
"GtkOverlay"
id=
"start_overlay"
>
<property
name=
"valign"
>
center
</property>
<child>
<object
class=
"GtkButton"
id=
"start_btn"
>
<child
type=
"overlay"
>
<object
class=
"GtkButton"
id=
"next_btn"
>
<property
name=
"margin-end"
>
12
</property>
<property
name=
"icon-name"
>
right-large-symbolic
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"valign"
>
center
</property>
<property
name=
"action-name"
>
app.start-tour
</property>
<property
name=
"tooltip-text"
translatable=
"yes"
>
Star
t
</property>
<property
name=
"action-name"
>
app.next-page
</property>
<property
name=
"tooltip-text"
translatable=
"yes"
>
Nex
t
</property>
<style>
<class
name=
"suggested-action"
/>
<class
name=
"circular"
/>
</style>
</object>
</child>
<child
type=
"overlay"
>
<object
class=
"GtkOverlay"
id=
"next_overlay"
>
<property
name=
"valign"
>
center
</property>
<property
name=
"can-target"
>
false
</property>
<child>
<object
class=
"GtkButton"
id=
"next_btn"
>
<object
class=
"GtkButton"
id=
"start_btn"
>
<property
name=
"margin-end"
>
12
</property>
<property
name=
"icon-name"
>
right-large-symbolic
</property>
<property
name=
"halign"
>
end
</property>
<property
name=
"valign"
>
center
</property>
<property
name=
"action-name"
>
app.next-page
</property>
<property
name=
"tooltip-text"
translatable=
"yes"
>
Nex
t
</property>
<property
name=
"action-name"
>
app.start-tour
</property>
<property
name=
"tooltip-text"
translatable=
"yes"
>
Star
t
</property>
<style>
<class
name=
"suggested-action"
/>
<class
name=
"circular"
/>
</style>
</object>
</child>
</object>
</child>
<child>
<object
class=
"AdwCarousel"
id=
"carousel"
>
<property
name=
"hexpand"
>
True
</property>
<property
name=
"vexpand"
>
True
</property>
</object>
</child>
</object>
...
...
meson.build
View file @
6e056116
project('gnome-tour',
'rust',
version: '41.rc',
license: 'GPL-3.0-or-later',
meson_version : '>= 0.50')
i18n = import('i18n')
...
...
src/widgets/paginator.rs
View file @
6e056116
...
...
@@ -17,8 +17,6 @@ mod imp {
pub
(
super
)
pages
:
RefCell
<
Vec
<
gtk
::
Widget
>>
,
pub
(
super
)
current_page
:
Cell
<
u32
>
,
#[template_child]
pub
(
super
)
next_overlay
:
TemplateChild
<
gtk
::
Overlay
>
,
#[template_child]
pub
(
super
)
next_btn
:
TemplateChild
<
gtk
::
Button
>
,
#[template_child]
pub
(
super
)
start_btn
:
TemplateChild
<
gtk
::
Button
>
,
...
...
@@ -31,7 +29,6 @@ mod imp {
Self
{
carousel
:
TemplateChild
::
default
(),
start_btn
:
TemplateChild
::
default
(),
next_overlay
:
TemplateChild
::
default
(),
next_btn
:
TemplateChild
::
default
(),
previous_btn
:
TemplateChild
::
default
(),
pages
:
RefCell
::
new
(
Vec
::
new
()),
...
...
@@ -142,9 +139,9 @@ impl PaginatorWidget {
let
(
opacity_previous
,
opacity_start
,
opacity_next
)
=
if
(
0.0
..
1.0
)
.contains
(
&
position
)
{
if
position
==
0.0
{
(
position
,
1.0
,
position
)
(
position
,
1.0
-
position
,
position
)
}
else
{
(
position
,
1.0
,
position
)
(
position
,
1.0
-
position
,
position
)
}
}
else
if
(
0.0
<=
position
)
&&
(
position
<=
forelast_page
)
{
(
1.0
,
0.0
,
1.0
)
...
...
@@ -156,12 +153,18 @@ impl PaginatorWidget {
panic!
(
"Position of the carousel is outside the allowed range"
);
};
// While transitioning to the last page the next button is still visible
// pressing it would crash the app so we make it not targetable.
let
can_target_start
=
opacity_next
<
f64
::
EPSILON
;
let
can_target_next
=
opacity_next
>
0
_f64
&&
position
<
forelast_page
;
imp
.start_btn
.set_opacity
(
opacity_start
);
imp
.start_btn
.set_visible
(
opacity_start
>
0
_f64
);
imp
.start_btn
.set_can_target
(
can_target_start
);
imp
.next_btn
.set_opacity
(
opacity_next
);
imp
.next_btn
.set_visible
(
opacity_next
>
0
_f64
);
imp
.next_
overlay
.set_can_target
(
opacity_next
>
0
_f64
);
imp
.next_
btn
.set_can_target
(
can_target_next
);
imp
.previous_btn
.set_opacity
(
opacity_previous
);
imp
.previous_btn
.set_visible
(
opacity_previous
>
0
_f64
);
...
...
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