[gnome-boxes/wip/exalm/libhandy1: 1/6] Port to libhandy 1.0
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/wip/exalm/libhandy1: 1/6] Port to libhandy 1.0
- Date: Tue, 26 May 2020 15:53:41 +0000 (UTC)
commit 96d13b42fd024dd23f90da57a234be26e34dc0e1
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Sun May 24 21:11:32 2020 +0500
Port to libhandy 1.0
build-aux/flatpak/org.gnome.Boxes.json | 3 +--
data/ui/welcome-tutorial.ui | 2 +-
src/main.vala | 2 --
src/meson.build | 4 +++-
src/welcome-tutorial.vala | 14 +++++++-------
5 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/build-aux/flatpak/org.gnome.Boxes.json b/build-aux/flatpak/org.gnome.Boxes.json
index 8cd1b090..e0d1fb47 100644
--- a/build-aux/flatpak/org.gnome.Boxes.json
+++ b/build-aux/flatpak/org.gnome.Boxes.json
@@ -523,8 +523,7 @@
"sources" : [
{
"type" : "git",
- "url" : "https://source.puri.sm/Librem5/libhandy.git",
- "branch" : "libhandy-0-0"
+ "url" : "https://gitlab.gnome.org/GNOME/libhandy.git"
}
]
},
diff --git a/data/ui/welcome-tutorial.ui b/data/ui/welcome-tutorial.ui
index d47a1e8b..ffecf09f 100644
--- a/data/ui/welcome-tutorial.ui
+++ b/data/ui/welcome-tutorial.ui
@@ -23,7 +23,7 @@
<property name="expand">True</property>
<child>
- <object class="HdyPaginator" id="paginator">
+ <object class="HdyCarousel" id="carousel">
<property name="visible">True</property>
<property name="animation-duration">400</property>
<property name="indicator-style">dots</property>
diff --git a/src/main.vala b/src/main.vala
index 5182ad4d..ff7e14f3 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -79,8 +79,6 @@ public int main (string[] args) {
error (err.message);
}
- Hdy.init (ref args);
-
var app = new Boxes.App ();
var exit_status = app.run (args);
diff --git a/src/meson.build b/src/meson.build
index eeb05310..d6705165 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -10,6 +10,8 @@ vala_args = [
'--vapidir', vapi_dir,
'--vapidir', join_paths (vapi_dir, 'upstream'),
'--target-glib=2.38',
+ # FIXME Remove this after libhandy 1.0 is released
+ '--disable-since-check',
]
common_dependencies = [
@@ -144,7 +146,7 @@ dependencies = [
dependency ('tracker-sparql-2.0'),
dependency ('vte-2.91', version: '>= 0.40.2'),
dependency ('webkit2gtk-4.0'),
- dependency ('libhandy-0.0', version: '>= 0.0.11'),
+ dependency ('libhandy-1', version: '>= 0.80.0'),
cc.find_library('m', required : false),
valac.find_library ('gio-2.0-workaround', dirs: vapi_dir),
valac.find_library ('linux'),
diff --git a/src/welcome-tutorial.vala b/src/welcome-tutorial.vala
index 1cf1c7d0..215aee44 100644
--- a/src/welcome-tutorial.vala
+++ b/src/welcome-tutorial.vala
@@ -5,7 +5,7 @@
[GtkTemplate (ui = "/org/gnome/Boxes/ui/welcome-tutorial.ui")]
private class Boxes.WelcomeTutorial : Gtk.Dialog {
[GtkChild]
- private Paginator paginator;
+ private Carousel carousel;
[GtkChild]
private Button go_back_button;
[GtkChild]
@@ -18,7 +18,7 @@
use_header_bar = 1;
pages = new GLib.List<unowned WelcomeTutorialPage> ();
- foreach (var page in paginator.get_children ()) {
+ foreach (var page in carousel.get_children ()) {
assert (page is WelcomeTutorialPage);
pages.append (page as WelcomeTutorialPage);
}
@@ -47,7 +47,7 @@ private void set_background_color (Gdk.RGBA color) {
[GtkCallback]
private void on_position_changed () {
var n_pages = pages.length ();
- var position = paginator.position;
+ var position = carousel.position;
// Toggle button's visibility
go_back_button.opacity = double.min (position, 1);
@@ -68,20 +68,20 @@ private void on_position_changed () {
[GtkCallback]
private void on_next_button_clicked () {
- var index = (int) Math.round (paginator.position) + 1;
+ var index = (int) Math.round (carousel.position) + 1;
if (index >= pages.length ())
return;
- paginator.scroll_to (pages.nth_data (index));
+ carousel.scroll_to (pages.nth_data (index));
}
[GtkCallback]
private void on_back_button_clicked () {
- var index = (int) Math.round (paginator.position) - 1;
+ var index = (int) Math.round (carousel.position) - 1;
if (index < 0)
return;
- paginator.scroll_to (pages.nth_data (index));
+ carousel.scroll_to (pages.nth_data (index));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]