⬇️ Fix dependency hell.
This commit is contained in:
parent
697d0bd6ca
commit
d004d686bd
3 changed files with 15 additions and 12 deletions
|
|
@ -4,7 +4,6 @@ version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
gtk4 = { version = "0.4", features = ["v4_4"] }
|
relm4 = { git = "https://github.com/AaronErhardt/relm4", rev = "7404ad64ca8763f6629cadcd743947cd29e1538a" }
|
||||||
relm4 = { git = "https://github.com/AaronErhardt/relm4", branch = "new-approach" }
|
|
||||||
relm4-macros = { git = "https://github.com/AaronErhardt/relm4", branch = "new-approach" }
|
relm4-macros = { git = "https://github.com/AaronErhardt/relm4", branch = "new-approach" }
|
||||||
tracker = "0.1.1"
|
tracker = "0.1.1"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
use gtk4::{prelude::*, Align, Label, Orientation, Widget};
|
use relm4::{
|
||||||
use relm4::{ComponentParts, Sender, SimpleComponent};
|
gtk::{prelude::*, Align, Box as GtkBox, Label, Orientation, Widget},
|
||||||
|
ComponentParts, Sender, SimpleComponent,
|
||||||
|
};
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
@ -73,7 +75,7 @@ impl SimpleComponent for LabeledItem {
|
||||||
type Output = ();
|
type Output = ();
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
base_box = gtk4::Box {
|
base_box = GtkBox {
|
||||||
add_css_class: "labeled-item",
|
add_css_class: "labeled-item",
|
||||||
set_orientation: Orientation::Horizontal,
|
set_orientation: Orientation::Horizontal,
|
||||||
set_hexpand: true,
|
set_hexpand: true,
|
||||||
|
|
@ -82,7 +84,7 @@ impl SimpleComponent for LabeledItem {
|
||||||
set_margin_top: 8,
|
set_margin_top: 8,
|
||||||
set_margin_bottom: 8,
|
set_margin_bottom: 8,
|
||||||
set_spacing: 16,
|
set_spacing: 16,
|
||||||
append: labeled_item_info = >k4::Box {
|
append: labeled_item_info = &GtkBox {
|
||||||
add_css_class: "labeled-item-info",
|
add_css_class: "labeled-item-info",
|
||||||
set_orientation: Orientation::Vertical,
|
set_orientation: Orientation::Vertical,
|
||||||
set_hexpand: true,
|
set_hexpand: true,
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
mod imp;
|
mod imp;
|
||||||
|
|
||||||
use gtk4::{glib::IsA, prelude::*, Align, Orientation, Widget};
|
use relm4::{
|
||||||
use relm4::{Component, ComponentController, ComponentParts, Controller};
|
gtk::{glib::IsA, prelude::*, Align, Box as GtkBox, Orientation, Widget},
|
||||||
|
Component, ComponentController, ComponentParts, Controller,
|
||||||
|
};
|
||||||
use std::{cell::Ref, ops::Deref};
|
use std::{cell::Ref, ops::Deref};
|
||||||
|
|
||||||
pub struct LabeledItem {
|
pub struct LabeledItem {
|
||||||
root: gtk4::Box,
|
root: GtkBox,
|
||||||
controller: Controller<imp::LabeledItem>,
|
controller: Controller<imp::LabeledItem>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -18,7 +20,7 @@ impl LabeledItem {
|
||||||
Self::default()
|
Self::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn widget(&self) -> gtk4::Box {
|
pub fn widget(&self) -> GtkBox {
|
||||||
self.root.clone()
|
self.root.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,7 +66,7 @@ impl LabeledItem {
|
||||||
|
|
||||||
impl Default for LabeledItem {
|
impl Default for LabeledItem {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let root = gtk4::Box::new(Orientation::Horizontal, 0);
|
let root = GtkBox::new(Orientation::Horizontal, 0);
|
||||||
let controller = imp::LabeledItem::init()
|
let controller = imp::LabeledItem::init()
|
||||||
.attach_to(&root)
|
.attach_to(&root)
|
||||||
.launch(())
|
.launch(())
|
||||||
|
|
@ -80,7 +82,7 @@ impl AsRef<Widget> for LabeledItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Deref for LabeledItem {
|
impl Deref for LabeledItem {
|
||||||
type Target = gtk4::Box;
|
type Target = GtkBox;
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
fn deref(&self) -> &Self::Target {
|
||||||
&self.root
|
&self.root
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue