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
114b6206
Commit
114b6206
authored
Jun 19, 2023
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wip/cdavis/use-toolbar-view' into 'master'
paginator: Use AdwToolbarView, subclass AdwBin See merge request GNOME/gnome-tour!68
parents
a91c4ec7
2a92106a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
19 deletions
+17
-19
Cargo.lock
Cargo.lock
+4
-6
Cargo.toml
Cargo.toml
+1
-1
paginator.ui
data/resources/ui/paginator.ui
+8
-9
paginator.rs
src/widgets/paginator.rs
+4
-3
No files found.
Cargo.lock
View file @
114b6206
...
...
@@ -521,12 +521,11 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libadwaita"
version = "0.
3.1
"
version = "0.
4.4
"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
b1c4efd2020a4fcedbad2c4a97de97bf6045e5dc49d61d5a5d0cfd753db60700
"
checksum = "
1ab9c0843f9f23ff25634df2743690c3a1faffe0a190e60c490878517eb81abf
"
dependencies = [
"bitflags",
"futures-channel",
"gdk-pixbuf",
"gdk4",
"gio",
...
...
@@ -534,15 +533,14 @@ dependencies = [
"gtk4",
"libadwaita-sys",
"libc",
"once_cell",
"pango",
]
[[package]]
name = "libadwaita-sys"
version = "0.
3.0
"
version = "0.
4.4
"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "
0727b85b4fe2b1bed5ac90df6343de15cbf8118bfb96d7c3cc1512681a4b34ac
"
checksum = "
4231cb2499a9f0c4cdfa4885414b33e39901ddcac61150bc0bb4ff8a57ede404
"
dependencies = [
"gdk4-sys",
"gio-sys",
...
...
Cargo.toml
View file @
114b6206
...
...
@@ -9,6 +9,6 @@ edition = "2021"
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.
3
"
}
adw
=
{package
=
"libadwaita"
,
version
=
"0.
4
"
}
pretty_env_logger
=
"0.4"
regex
=
"1.5"
data/resources/ui/paginator.ui
View file @
114b6206
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template
class=
"PaginatorWidget"
parent=
"GtkBox"
>
<property
name=
"orientation"
>
vertical
</property>
<child>
<template
class=
"PaginatorWidget"
parent=
"AdwBin"
>
<property
name=
"child"
>
<object
class=
"AdwToolbarView"
>
<child
type=
"top"
>
<object
class=
"GtkHeaderBar"
>
<property
name=
"show-title-buttons"
>
True
</property>
<property
name=
"title-widget"
>
<object
class=
"AdwCarouselIndicatorDots"
id=
"carousel_dots"
>
<property
name=
"carousel"
>
carousel
</property>
</object>
</property>
<style>
<class
name=
"flat"
/>
</style>
</object>
</child>
<child
>
<property
name=
"content"
>
<object
class=
"GtkOverlay"
id=
"previous_overlay"
>
<property
name=
"valign"
>
center
</property>
<child
type=
"overlay"
>
...
...
@@ -66,7 +63,9 @@
</object>
</child>
</object>
</child>
</property>
</object>
</property>
<child>
<object
class=
"GtkEventControllerKey"
>
<signal
name=
"key-pressed"
handler=
"on_key_pressed"
swapped=
"true"
/>
...
...
src/widgets/paginator.rs
View file @
114b6206
use
gtk
::{
gdk
,
glib
,
prelude
::
*
,
subclass
::
prelude
::
*
};
use
adw
::
subclass
::
prelude
::
*
;
use
gtk
::{
gdk
,
glib
,
prelude
::
*
};
mod
imp
{
use
std
::
cell
::{
Cell
,
RefCell
};
...
...
@@ -24,7 +25,7 @@ mod imp {
#[glib
::
object_subclass]
impl
ObjectSubclass
for
PaginatorWidget
{
const
NAME
:
&
'static
str
=
"PaginatorWidget"
;
type
ParentType
=
gtk
::
Box
;
type
ParentType
=
adw
::
Bin
;
type
Type
=
super
::
PaginatorWidget
;
type
Interfaces
=
(
gtk
::
Buildable
,);
...
...
@@ -46,7 +47,7 @@ mod imp {
}
}
impl
WidgetImpl
for
PaginatorWidget
{}
impl
B
ox
Impl
for
PaginatorWidget
{}
impl
B
in
Impl
for
PaginatorWidget
{}
impl
BuildableImpl
for
PaginatorWidget
{
fn
add_child
(
&
self
,
builder
:
&
gtk
::
Builder
,
child
:
&
glib
::
Object
,
type_
:
Option
<&
str
>
)
{
if
!
self
.carousel
.is_bound
()
{
...
...
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