Commit b44f77e5 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

use gtk-rs from git

This is in preparation for a future gtk-rs release
parent 347c85f3
......@@ -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]
......
......@@ -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 {
......
......@@ -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()
......
......@@ -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"))]
......
......@@ -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 |_| {
......
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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment