Skip to content

Commit

Permalink
Merge pull request #65 from AaronErhardt/update-relm4
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
AaronErhardt authored Mar 14, 2024
2 parents 4dc645a + fe1ab36 commit fcca331
Show file tree
Hide file tree
Showing 16 changed files with 298 additions and 263 deletions.
477 changes: 256 additions & 221 deletions tailor_gui/Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions tailor_gui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ description = "Tailord GUI (part of tuxedo-rs)"
repository = "https://github.com/AaronErhardt/tuxedo-rs"

[dependencies]
futures = "0.3.28"
futures = "0.3.30"
gettext-rs = { version = "0.7", features = ["gettext-system"] }
once_cell = "1.17.1"
relm4-components = { version = "0.7.0-beta.2", git = "https://github.com/Relm4/Relm4" }
relm4 = { version = "0.7.0-beta.2", git = "https://github.com/Relm4/Relm4", features = ["libadwaita", "gnome_44"] }
tailor_api = {version = "0.2.4", path = "../tailor_api" }
tailor_client = {version = "0.2.4", path = "../tailor_client" }
tokio = { version = "1.27", features = ["parking_lot"] }
once_cell = "1.19.0"
relm4-components = "0.8.0"
relm4 = { version = "0.8.1", features = ["libadwaita", "gnome_45"] }
tailor_api = { version = "0.2.4", path = "../tailor_api" }
tailor_client = { version = "0.2.4", path = "../tailor_client" }
tokio = { version = "1.36", features = ["parking_lot"] }
tracing = "0.1"
tracing-subscriber = "0.3"
tracker = "0.2"
relm4-icons = { version = "0.7.0-alpha.2", features = ["plus", "settings", "speedometer", "menu-large", "up", "down", "color", "cross-filled", "data-bar-vertical-ascending-filled"] }
clap = { version = "4.4.18", features = ["derive"] }
relm4-icons = "0.8.0"
clap = { version = "4.5.2", features = ["derive"] }
2 changes: 2 additions & 0 deletions tailor_gui/icons.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
base_resource_path = "/com/github/aaronerhardt/Tailor/"
icons = ["plus", "settings", "speedometer", "menu-large", "up", "down", "color", "cross-filled", "data-bar-vertical-ascending-filled"]
10 changes: 5 additions & 5 deletions tailor_gui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use relm4::{
adw, gtk, main_application, Component, ComponentController, ComponentParts, ComponentSender,
Controller,
};
use relm4_icons::icon_name;
use relm4_icons::icon_names;
use tailor_api::ProfileInfo;

use crate::components::fan_list::FanList;
Expand Down Expand Up @@ -131,7 +131,7 @@ impl Component for App {
},

pack_end = &gtk::MenuButton {
set_icon_name: icon_name::MENU_LARGE,
set_icon_name: icon_names::MENU_LARGE,
set_menu_model: Some(&primary_menu),
}
},
Expand All @@ -150,15 +150,15 @@ impl Component for App {

#[local_ref]
add_titled[Some("profiles"), "Profiles"] = profile_widget -> gtk::ScrolledWindow {} -> {
set_icon_name: Some(icon_name::SETTINGS),
set_icon_name: Some(icon_names::SETTINGS),
},
#[local_ref]
add_titled[Some("led"), "LED"] = led_list_widget -> gtk::ScrolledWindow {} -> {
set_icon_name: Some(icon_name::COLOR),
set_icon_name: Some(icon_names::COLOR),
},
#[local_ref]
add_titled[Some("fan"), "Fan control"] = fan_list -> gtk::ScrolledWindow {} -> {
set_icon_name: Some(icon_name::DATA_BAR_VERTICAL_ASCENDING_FILLED),
set_icon_name: Some(icon_names::DATA_BAR_VERTICAL_ASCENDING_FILLED),
},
},
#[name = "view_bar"]
Expand Down
10 changes: 5 additions & 5 deletions tailor_gui/src/components/factories/color.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use gtk::prelude::{OrientableExt, WidgetExt};
use relm4::factory::{DynamicIndex, FactoryComponent, FactorySender, FactoryView};
use relm4::gtk::traits::{BoxExt, ButtonExt};
use relm4::gtk::prelude::{BoxExt, ButtonExt};
use relm4::{factory, gtk, Component, ComponentController, Controller};
use relm4_icons::icon_name;
use relm4_icons::icon_names;
use tailor_api::{Color, ColorPoint};

use crate::components::color_button::ColorButton;
Expand Down Expand Up @@ -68,19 +68,19 @@ impl FactoryComponent for ColorRow {
set_spacing: 6,

gtk::Button {
set_icon_name: icon_name::UP,
set_icon_name: icon_names::UP,
connect_clicked[sender, index] => move |_| {
sender.output(ColorOutput::Up(index.clone())).unwrap();
}
},
gtk::Button {
set_icon_name: icon_name::DOWN,
set_icon_name: icon_names::DOWN,
connect_clicked[sender, index] => move |_| {
sender.output(ColorOutput::Down(index.clone())).unwrap();
}
},
gtk::Button {
set_icon_name: icon_name::CROSS_FILLED,
set_icon_name: icon_names::CROSS_FILLED,
add_css_class: "destructive-action",
connect_clicked[sender, index] => move |_| {
sender.output(ColorOutput::Remove(index.clone())).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions tailor_gui/src/components/factories/list_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use gtk::glib;
use gtk::prelude::{BoxExt, ButtonExt, EditableExt, ObjectExt, OrientableExt, WidgetExt};
use relm4::factory::{DynamicIndex, FactoryComponent, FactorySender};
use relm4::{adw, factory, gtk, RelmWidgetExt};
use relm4_icons::icon_name;
use relm4_icons::icon_names;

pub trait ListMsg {
fn ty() -> &'static str;
Expand Down Expand Up @@ -59,7 +59,7 @@ where
set_valign: gtk::Align::Center,

gtk::Button {
set_icon_name: icon_name::CROSS_FILLED,
set_icon_name: icon_names::CROSS_FILLED,
connect_clicked[sender, index, name = self.name.clone()] => move |btn| {
let window = btn.toplevel_window().unwrap();
let dialog = adw::MessageDialog::builder()
Expand Down
6 changes: 3 additions & 3 deletions tailor_gui/src/components/factories/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use once_cell::unsync::Lazy;
use relm4::factory::{DynamicIndex, FactoryComponent, FactorySender, FactoryVecDeque};
use relm4::{adw, factory, gtk, Component, ComponentController, Controller};
use relm4_components::simple_combo_box::SimpleComboBox;
use relm4_icons::icon_name;
use relm4_icons::icon_names;
use tailor_api::{LedDeviceInfo, LedProfile, ProfileInfo};

use super::profile_item_fan::{ProfileItemFan, ProfileItemFanInit};
Expand Down Expand Up @@ -82,7 +82,7 @@ impl FactoryComponent for Profile {

#[name = "delete_button"]
gtk::Button {
set_icon_name: icon_name::CROSS_FILLED,
set_icon_name: icon_names::CROSS_FILLED,
add_css_class: "destructive-action",
set_visible: false,
#[watch]
Expand All @@ -99,7 +99,7 @@ impl FactoryComponent for Profile {

#[template_child]
image -> gtk::Image {
set_icon_name: Some(icon_name::SPEEDOMETER),
set_icon_name: Some(icon_names::SPEEDOMETER),
},

#[template_child]
Expand Down
4 changes: 2 additions & 2 deletions tailor_gui/src/components/factories/profile_item_fan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use relm4::factory::FactoryView;
use relm4::prelude::{DynamicIndex, FactoryComponent};
use relm4::{adw, gtk, Component, ComponentController, Controller, FactorySender};
use relm4_components::simple_combo_box::SimpleComboBox;
use relm4_icons::icon_name;
use relm4_icons::icon_names;

use crate::templates;

Expand Down Expand Up @@ -32,7 +32,7 @@ impl FactoryComponent for ProfileItemFan {
templates::ProfileListItem {
#[template_child]
image -> gtk::Image {
set_icon_name: Some(icon_name::DATA_BAR_VERTICAL_ASCENDING_FILLED),
set_icon_name: Some(icon_names::DATA_BAR_VERTICAL_ASCENDING_FILLED),
},

#[template_child]
Expand Down
4 changes: 2 additions & 2 deletions tailor_gui/src/components/factories/profile_item_led.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use relm4::factory::FactoryView;
use relm4::prelude::{DynamicIndex, FactoryComponent};
use relm4::{adw, gtk, Component, ComponentController, Controller, FactorySender};
use relm4_components::simple_combo_box::SimpleComboBox;
use relm4_icons::icon_name;
use relm4_icons::icon_names;
use tailor_api::{LedDeviceInfo, LedProfile};

use crate::templates;
Expand Down Expand Up @@ -33,7 +33,7 @@ impl FactoryComponent for ProfileItemLed {
templates::ProfileListItem {
#[template_child]
image -> gtk::Image {
set_icon_name: Some(icon_name::COLOR),
set_icon_name: Some(icon_names::COLOR),
},

#[template_child]
Expand Down
2 changes: 1 addition & 1 deletion tailor_gui/src/components/fan_edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use gtk::gdk;
use gtk::gdk::RGBA;
use gtk::glib::{timeout_add_local_once, MainContext, SourceId};
use gtk::prelude::{BoxExt, ButtonExt, DrawingAreaExt, GestureDragExt, OrientableExt, WidgetExt};
use relm4::drawing::DrawHandler;
use relm4::abstractions::DrawHandler;
use relm4::{
adw, component, gtk, Component, ComponentController, ComponentParts, ComponentSender,
Controller, RelmWidgetExt,
Expand Down
4 changes: 2 additions & 2 deletions tailor_gui/src/components/fan_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use relm4::{
adw, component, gtk, Component, ComponentController, ComponentParts, ComponentSender,
Controller,
};
use relm4_icons::icon_name;
use relm4_icons::icon_names;

use super::factories::list_item::{ListItem, ListMsg};
use super::fan_edit::{FanEdit, FanEditInput};
Expand Down Expand Up @@ -78,7 +78,7 @@ impl Component for FanList {
set_hexpand: true,
},
gtk::Button {
set_icon_name: icon_name::PLUS,
set_icon_name: icon_names::PLUS,
connect_clicked => FanListInput::Add,
}
},
Expand Down
3 changes: 1 addition & 2 deletions tailor_gui/src/components/hardware_info.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::fmt::Write;

use relm4::gtk::prelude::{GridExt, OrientableExt, WidgetExt};
use relm4::gtk::traits::{ButtonExt, GtkWindowExt};
use relm4::gtk::prelude::{ButtonExt, GridExt, GtkWindowExt, OrientableExt, WidgetExt};
use relm4::{gtk, ComponentParts, ComponentSender, RelmWidgetExt, SimpleComponent};

use crate::state::hardware_capabilities;
Expand Down
6 changes: 3 additions & 3 deletions tailor_gui/src/components/led_edit.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use gtk::prelude::{ButtonExt, WidgetExt};
use relm4::factory::FactoryVecDeque;
use relm4::gtk::traits::OrientableExt;
use relm4::gtk::prelude::OrientableExt;
use relm4::prelude::DynamicIndex;
use relm4::{
adw, component, gtk, Component, ComponentController, ComponentParts, ComponentSender,
Controller, RelmWidgetExt,
};
use relm4_components::simple_combo_box::{SimpleComboBox, SimpleComboBoxMsg};
use relm4_icons::icon_name;
use relm4_icons::icon_names;
use tailor_api::{Color, ColorPoint, ColorProfile, ColorTransition};

use super::color_button::{ColorButton, ColorButtonInput};
Expand Down Expand Up @@ -132,7 +132,7 @@ impl Component for LedEdit {
set_hexpand: true,
},
gtk::Button {
set_icon_name: icon_name::PLUS,
set_icon_name: icon_names::PLUS,
set_halign: gtk::Align::End,
connect_clicked => LedEditInput::Add,
}
Expand Down
4 changes: 2 additions & 2 deletions tailor_gui/src/components/led_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use relm4::{
adw, component, gtk, Component, ComponentController, ComponentParts, ComponentSender,
Controller,
};
use relm4_icons::icon_name;
use relm4_icons::icon_names;

use super::factories::list_item::{ListItem, ListMsg};
use super::led_edit::{LedEdit, LedEditInput};
Expand Down Expand Up @@ -78,7 +78,7 @@ impl Component for LedList {
set_hexpand: true,
},
gtk::Button {
set_icon_name: icon_name::PLUS,
set_icon_name: icon_names::PLUS,
connect_clicked => LedListInput::Add,
}
},
Expand Down
4 changes: 2 additions & 2 deletions tailor_gui/src/components/profiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use gtk::prelude::ButtonExt;
use relm4::factory::FactoryVecDeque;
use relm4::prelude::DynamicIndex;
use relm4::{adw, component, gtk, Component, ComponentParts, ComponentSender, WidgetRef};
use relm4_icons::icon_name;
use relm4_icons::icon_names;

use super::factories::profile::{Profile, ProfileInit};
use super::new_entry::{NewEntryDialog, NewEntryInit, NewEntryOutput};
Expand Down Expand Up @@ -48,7 +48,7 @@ impl Component for Profiles {
set_title: "Profiles",
#[wrap(Some)]
set_header_suffix = &gtk::Button {
set_icon_name: icon_name::PLUS,
set_icon_name: icon_names::PLUS,
connect_clicked => ProfilesInput::Add,
}
},
Expand Down
3 changes: 1 addition & 2 deletions tailor_gui/src/templates.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use gtk::prelude::{ButtonExt, OrientableExt, WidgetExt};
use relm4::gtk::traits::{GtkWindowExt, ListBoxRowExt};
use gtk::prelude::{ButtonExt, GtkWindowExt, ListBoxRowExt, OrientableExt, WidgetExt};
use relm4::{adw, gtk, RelmWidgetExt, WidgetTemplate};

#[relm4::widget_template(pub)]
Expand Down

0 comments on commit fcca331

Please sign in to comment.