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
7f51836d
Commit
7f51836d
authored
Feb 11, 2023
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump gtk-rs crates
parent
93bb458d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
24 deletions
+22
-24
Cargo.lock
Cargo.lock
+0
-0
Cargo.toml
Cargo.toml
+2
-2
application.rs
src/application.rs
+7
-9
image_page.rs
src/widgets/image_page.rs
+7
-7
paginator.rs
src/widgets/paginator.rs
+4
-4
window.rs
src/widgets/window.rs
+2
-2
No files found.
Cargo.lock
View file @
7f51836d
This diff is collapsed.
Click to expand it.
Cargo.toml
View file @
7f51836d
...
...
@@ -6,9 +6,9 @@ edition = "2021"
[dependencies]
gtk
=
{
package
=
"gtk4"
,
version
=
"0.
5"
,
features=
["v4_2
"]
}
gtk
=
{
package
=
"gtk4"
,
version
=
"0.
6"
,
features=
["gnome_44
"]
}
log
=
"0.4"
gettext-rs
=
{
version
=
"0.7"
,
features
=
["gettext-system"]
}
adw
=
{package
=
"libadwaita"
,
version
=
"0.
2
"
}
adw
=
{package
=
"libadwaita"
,
version
=
"0.
3
"
}
pretty_env_logger
=
"0.4"
regex
=
"1.5"
src/application.rs
View file @
7f51836d
...
...
@@ -24,7 +24,7 @@ mod imp {
impl
ApplicationImpl
for
Application
{
fn
activate
(
&
self
)
{
self
.parent_activate
();
let
application
=
self
.
instance
();
let
application
=
self
.
obj
();
let
window
=
Window
::
new
(
&
application
);
application
.add_window
(
&
window
);
...
...
@@ -34,7 +34,7 @@ mod imp {
fn
startup
(
&
self
)
{
self
.parent_startup
();
let
application
=
self
.
instance
();
let
application
=
self
.
obj
();
// Quit
let
quit
=
gio
::
ActionEntry
::
builder
(
"quit"
)
.activate
(
move
|
app
:
&
Self
::
Type
,
_
,
_
|
app
.quit
())
...
...
@@ -65,9 +65,7 @@ mod imp {
}
})
.build
();
application
.add_action_entries
([
quit
,
start_tour
,
skip_tour
,
next_page
,
previous_page
])
.unwrap
();
application
.add_action_entries
([
quit
,
start_tour
,
skip_tour
,
next_page
,
previous_page
]);
application
.set_accels_for_action
(
"app.quit"
,
&
[
"<Control>q"
]);
application
.set_accels_for_action
(
"app.skip-tour"
,
&
[
"Escape"
]);
...
...
@@ -86,10 +84,10 @@ glib::wrapper! {
impl
Application
{
#[allow(clippy
::
new_without_default)]
pub
fn
new
()
->
Self
{
glib
::
Object
::
new
(
&
[
(
"application-id"
,
&
config
::
APP_ID
),
(
"resource-base-path"
,
&
Some
(
"/org/gnome/Tour"
)),
]
)
glib
::
Object
::
builder
()
.property
(
"application-id"
,
&
config
::
APP_ID
)
.property
(
"resource-base-path"
,
&
Some
(
"/org/gnome/Tour"
))
.build
(
)
}
fn
window
(
&
self
)
->
Window
{
...
...
src/widgets/image_page.rs
View file @
7f51836d
...
...
@@ -27,7 +27,7 @@ mod imp {
impl
ObjectImpl
for
ImagePageWidget
{
fn
constructed
(
&
self
)
{
self
.parent_constructed
();
let
obj
=
self
.
instance
();
let
obj
=
self
.
obj
();
let
layout_manager
=
obj
.layout_manager
()
.map
(|
l
|
l
.downcast
::
<
gtk
::
BoxLayout
>
()
.unwrap
())
...
...
@@ -55,7 +55,7 @@ mod imp {
clamp
.set_child
(
Some
(
&
container
));
self
.picture
.set_can_shrink
(
false
);
self
.picture
.set_
keep_aspect_ratio
(
true
);
self
.picture
.set_
content_fit
(
gtk
::
ContentFit
::
Contain
);
container
.append
(
&
self
.picture
);
let
head_label
=
gtk
::
Label
::
builder
()
...
...
@@ -138,11 +138,11 @@ glib::wrapper! {
impl
ImagePageWidget
{
pub
fn
new
(
resource_uri
:
&
str
,
head
:
String
,
body
:
String
)
->
Self
{
glib
::
Object
::
new
::
<
Self
>
(
&
[
(
"resource-uri"
,
&
resource_uri
),
(
"head"
,
&
head
),
(
"body"
,
&
body
),
]
)
glib
::
Object
::
builder
()
.property
(
"resource-uri"
,
&
resource_uri
)
.property
(
"head"
,
&
head
)
.property
(
"body"
,
&
body
)
.build
(
)
}
pub
fn
set_body
(
&
self
,
body
:
&
str
)
{
...
...
src/widgets/paginator.rs
View file @
7f51836d
...
...
@@ -44,7 +44,7 @@ mod imp {
impl
ObjectImpl
for
PaginatorWidget
{
fn
constructed
(
&
self
)
{
self
.parent_constructed
();
let
obj
=
self
.
instance
();
let
obj
=
self
.
obj
();
let
layout_manager
=
obj
.layout_manager
()
.map
(|
l
|
l
.downcast
::
<
gtk
::
BoxLayout
>
()
.unwrap
())
...
...
@@ -67,7 +67,7 @@ mod imp {
gtk
::
Inhibit
(
false
)
}));
obj
.add_controller
(
&
controller
);
obj
.add_controller
(
controller
);
}
}
impl
WidgetImpl
for
PaginatorWidget
{}
...
...
@@ -77,7 +77,7 @@ mod imp {
if
!
self
.carousel
.is_bound
()
{
self
.parent_add_child
(
builder
,
child
,
type_
);
}
else
{
self
.
instance
()
self
.
obj
()
.add_page
(
child
.clone
()
.downcast
::
<
gtk
::
Widget
>
()
.unwrap
());
}
}
...
...
@@ -92,7 +92,7 @@ glib::wrapper! {
impl
PaginatorWidget
{
pub
fn
new
()
->
Self
{
glib
::
Object
::
new
(
&
[]
)
glib
::
Object
::
new
()
}
pub
fn
try_next
(
&
self
)
->
Option
<
()
>
{
...
...
src/widgets/window.rs
View file @
7f51836d
...
...
@@ -39,7 +39,7 @@ mod imp {
impl
ObjectImpl
for
Window
{
fn
constructed
(
&
self
)
{
self
.parent_constructed
();
let
widget
=
self
.
instance
();
let
widget
=
self
.
obj
();
widget
.set_icon_name
(
Some
(
config
::
APP_ID
));
// Devel Profile
...
...
@@ -71,7 +71,7 @@ glib::wrapper! {
impl
Window
{
pub
fn
new
(
app
:
&
Application
)
->
Self
{
glib
::
Object
::
new
(
&
[(
"application"
,
app
)]
)
glib
::
Object
::
builder
()
.property
(
"application"
,
app
)
.build
(
)
}
pub
fn
paginator
(
&
self
)
->
PaginatorWidget
{
...
...
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