From d004d686bd83e55f8f5058700941284ca84dc579 Mon Sep 17 00:00:00 2001 From: Lucy Date: Tue, 5 Apr 2022 12:33:34 -0400 Subject: [PATCH] =?UTF-8?q?=E2=AC=87=EF=B8=8F=20Fix=20dependency=20hell.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- widgets/Cargo.toml | 3 +-- widgets/src/labeled_item/imp.rs | 10 ++++++---- widgets/src/labeled_item/mod.rs | 14 ++++++++------ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/widgets/Cargo.toml b/widgets/Cargo.toml index 7113c74c..3ddbb09f 100644 --- a/widgets/Cargo.toml +++ b/widgets/Cargo.toml @@ -4,7 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] -gtk4 = { version = "0.4", features = ["v4_4"] } -relm4 = { git = "https://github.com/AaronErhardt/relm4", branch = "new-approach" } +relm4 = { git = "https://github.com/AaronErhardt/relm4", rev = "7404ad64ca8763f6629cadcd743947cd29e1538a" } relm4-macros = { git = "https://github.com/AaronErhardt/relm4", branch = "new-approach" } tracker = "0.1.1" diff --git a/widgets/src/labeled_item/imp.rs b/widgets/src/labeled_item/imp.rs index d488b5b6..9642c7df 100644 --- a/widgets/src/labeled_item/imp.rs +++ b/widgets/src/labeled_item/imp.rs @@ -1,5 +1,7 @@ -use gtk4::{prelude::*, Align, Label, Orientation, Widget}; -use relm4::{ComponentParts, Sender, SimpleComponent}; +use relm4::{ + gtk::{prelude::*, Align, Box as GtkBox, Label, Orientation, Widget}, + ComponentParts, Sender, SimpleComponent, +}; use std::cell::RefCell; #[derive(Debug)] @@ -73,7 +75,7 @@ impl SimpleComponent for LabeledItem { type Output = (); view! { - base_box = gtk4::Box { + base_box = GtkBox { add_css_class: "labeled-item", set_orientation: Orientation::Horizontal, set_hexpand: true, @@ -82,7 +84,7 @@ impl SimpleComponent for LabeledItem { set_margin_top: 8, set_margin_bottom: 8, set_spacing: 16, - append: labeled_item_info = >k4::Box { + append: labeled_item_info = &GtkBox { add_css_class: "labeled-item-info", set_orientation: Orientation::Vertical, set_hexpand: true, diff --git a/widgets/src/labeled_item/mod.rs b/widgets/src/labeled_item/mod.rs index d3bc4aa7..25101969 100644 --- a/widgets/src/labeled_item/mod.rs +++ b/widgets/src/labeled_item/mod.rs @@ -1,11 +1,13 @@ mod imp; -use gtk4::{glib::IsA, prelude::*, Align, Orientation, Widget}; -use relm4::{Component, ComponentController, ComponentParts, Controller}; +use relm4::{ + gtk::{glib::IsA, prelude::*, Align, Box as GtkBox, Orientation, Widget}, + Component, ComponentController, ComponentParts, Controller, +}; use std::{cell::Ref, ops::Deref}; pub struct LabeledItem { - root: gtk4::Box, + root: GtkBox, controller: Controller, } @@ -18,7 +20,7 @@ impl LabeledItem { Self::default() } - pub fn widget(&self) -> gtk4::Box { + pub fn widget(&self) -> GtkBox { self.root.clone() } @@ -64,7 +66,7 @@ impl LabeledItem { impl Default for LabeledItem { fn default() -> Self { - let root = gtk4::Box::new(Orientation::Horizontal, 0); + let root = GtkBox::new(Orientation::Horizontal, 0); let controller = imp::LabeledItem::init() .attach_to(&root) .launch(()) @@ -80,7 +82,7 @@ impl AsRef for LabeledItem { } impl Deref for LabeledItem { - type Target = gtk4::Box; + type Target = GtkBox; fn deref(&self) -> &Self::Target { &self.root