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
b44f77e5
Commit
b44f77e5
authored
Dec 31, 2021
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use gtk-rs from git
This is in preparation for a future gtk-rs release
parent
347c85f3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
19 deletions
+16
-19
Cargo.lock
Cargo.lock
+0
-0
Cargo.toml
Cargo.toml
+3
-3
application.rs
src/application.rs
+2
-3
image.rs
src/widgets/pages/image.rs
+1
-1
welcome.rs
src/widgets/pages/welcome.rs
+1
-1
paginator.rs
src/widgets/paginator.rs
+5
-5
window.rs
src/widgets/window.rs
+4
-6
No files found.
Cargo.lock
View file @
b44f77e5
This diff is collapsed.
Click to expand it.
Cargo.toml
View file @
b44f77e5
...
...
@@ -8,10 +8,10 @@ edition = "2018"
video
=
[
"gst_player"
,
"gst"
]
[dependencies]
gtk
=
{
package
=
"gtk4"
,
version
=
"0.3
"
,
features=
["v4_2"]
}
gtk
=
{
package
=
"gtk4"
,
git
=
"https://github.com/gtk-rs/gtk4-rs
"
,
features=
["v4_2"]
}
log
=
"0.4"
gettext-rs
=
{
version
=
"0.
6
"
,
features
=
["gettext-system"]
}
libadwaita
=
"0.1.0-beta-1"
gettext-rs
=
{
version
=
"0.
7
"
,
features
=
["gettext-system"]
}
adw
=
{package
=
"libadwaita"
,
git
=
"https://gitlab.gnome.org/World/Rust/libadwaita-rs"
}
pretty_env_logger
=
"0.4"
[dependencies.gst_player]
...
...
src/application.rs
View file @
b44f77e5
...
...
@@ -8,14 +8,13 @@ use log::info;
use
std
::{
cell
::
RefCell
,
rc
::
Rc
};
pub
struct
Application
{
app
:
libadwaita
::
Application
,
app
:
adw
::
Application
,
window
:
RefCell
<
Rc
<
Option
<
Window
>>>
,
}
impl
Application
{
pub
fn
new
()
->
Rc
<
Self
>
{
let
app
=
libadwaita
::
Application
::
new
(
Some
(
config
::
APP_ID
),
gio
::
ApplicationFlags
::
FLAGS_NONE
);
let
app
=
adw
::
Application
::
new
(
Some
(
config
::
APP_ID
),
gio
::
ApplicationFlags
::
FLAGS_NONE
);
app
.set_resource_base_path
(
Some
(
"/org/gnome/Tour"
));
let
application
=
Rc
::
new
(
Self
{
...
...
src/widgets/pages/image.rs
View file @
b44f77e5
...
...
@@ -32,7 +32,7 @@ impl ImagePageWidget {
.margin_start
(
12
)
.margin_end
(
12
)
.build
();
let
clamp
=
libadwaita
::
Clamp
::
new
();
let
clamp
=
adw
::
Clamp
::
new
();
clamp
.set_child
(
Some
(
&
container
));
let
picture
=
gtk
::
Picture
::
builder
()
...
...
src/widgets/pages/welcome.rs
View file @
b44f77e5
...
...
@@ -78,7 +78,7 @@ impl WelcomePageWidget {
self
.widget
.add_css_class
(
"page"
);
self
.widget
.add_css_class
(
"welcome-page"
);
let
clamp
=
libadwaita
::
Clamp
::
new
();
let
clamp
=
adw
::
Clamp
::
new
();
clamp
.set_child
(
Some
(
&
container
));
#[cfg(not(feature
=
"video"
))]
...
...
src/widgets/paginator.rs
View file @
b44f77e5
...
...
@@ -6,8 +6,8 @@ use std::rc::Rc;
pub
struct
PaginatorWidget
{
pub
widget
:
gtk
::
Box
,
carousel
:
libadwaita
::
Carousel
,
carousel_dots
:
libadwaita
::
CarouselIndicatorDots
,
carousel
:
adw
::
Carousel
,
carousel_dots
:
adw
::
CarouselIndicatorDots
,
headerbar
:
gtk
::
HeaderBar
,
pages
:
RefCell
<
Vec
<
gtk
::
Widget
>>
,
current_page
:
RefCell
<
u32
>
,
...
...
@@ -25,8 +25,8 @@ impl PaginatorWidget {
let
paginator
=
Rc
::
new
(
Self
{
widget
,
carousel
:
libadwaita
::
Carousel
::
new
(),
carousel_dots
:
libadwaita
::
CarouselIndicatorDots
::
new
(),
carousel
:
adw
::
Carousel
::
new
(),
carousel_dots
:
adw
::
CarouselIndicatorDots
::
new
(),
headerbar
:
gtk
::
HeaderBar
::
builder
()
.show_title_buttons
(
false
)
.build
(),
start_btn
:
gtk
::
Button
::
with_label
(
&
gettext
(
"_Start"
)),
next_overlay
:
gtk
::
Overlay
::
new
(),
...
...
@@ -114,7 +114,7 @@ impl PaginatorWidget {
self
.carousel
.set_hexpand
(
true
);
self
.carousel
.set_vexpand
(
true
);
self
.carousel
.set_scroll_params
(
&
libadwaita
::
SpringParams
::
new
(
1.0
,
0.5
,
300.0
));
.set_scroll_params
(
&
adw
::
SpringParams
::
new
(
1.0
,
0.5
,
300.0
));
self
.carousel
.connect_position_notify
(
clone!
(
@
weak
p
=>
move
|
_
|
{
...
...
src/widgets/window.rs
View file @
b44f77e5
use
adw
::
prelude
::
*
;
use
gettextrs
::
gettext
;
use
gtk
::
glib
;
use
gtk
::
prelude
::
*
;
use
libadwaita
::
traits
::
ApplicationWindowExt
;
use
std
::
cell
::
RefCell
;
use
std
::
rc
::
Rc
;
...
...
@@ -10,13 +8,13 @@ use super::paginator::PaginatorWidget;
use
crate
::
config
::{
APP_ID
,
PROFILE
};
pub
struct
Window
{
pub
widget
:
libadwaita
::
ApplicationWindow
,
pub
widget
:
adw
::
ApplicationWindow
,
pub
paginator
:
RefCell
<
Rc
<
PaginatorWidget
>>
,
}
impl
Window
{
pub
fn
new
(
app
:
&
libadwaita
::
Application
)
->
Self
{
let
widget
=
libadwaita
::
ApplicationWindow
::
new
(
app
);
pub
fn
new
(
app
:
&
adw
::
Application
)
->
Self
{
let
widget
=
adw
::
ApplicationWindow
::
new
(
app
);
let
paginator
=
RefCell
::
new
(
PaginatorWidget
::
new
());
...
...
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