Update cargo dependencies, fix icons
This commit is contained in:
parent
011dab8d99
commit
fae93ee352
960
Cargo.lock
generated
960
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
18
Cargo.toml
18
Cargo.toml
@ -7,25 +7,25 @@ edition = "2021"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Core library
|
# Core library
|
||||||
relm4 = "0.6.2"
|
relm4 = "0.8.1"
|
||||||
# relm4-macros = "0.6.2"
|
# relm4-macros = "0.6.2"
|
||||||
# Optional: reusable components
|
# Optional: reusable components
|
||||||
relm4-components = "0.6.2"
|
relm4-components = "0.8.1"
|
||||||
# Optional: icons
|
# Optional: icons
|
||||||
relm4-icons = { version = "0.6.0", features = ["plus"] }
|
relm4-icons = "0.8.2"
|
||||||
|
|
||||||
walkdir = "2" # For traversing directories recursively
|
walkdir = "2" # For traversing directories recursively
|
||||||
opener = "0.6.1" # For opening files with the systems default application
|
opener = "0.7.1" # For opening files with the systems default application
|
||||||
|
|
||||||
log = "0.4.20"
|
log = "0.4.21"
|
||||||
env_logger = "0.10.1"
|
env_logger = "0.11.3"
|
||||||
clap = { version = "4.4.6", features = ["derive"] }
|
clap = { version = "4.5.4", features = ["derive"] }
|
||||||
|
|
||||||
sqlx = { version = "0.7", features = [ "runtime-tokio", "sqlite", "migrate", "macros" ] }
|
sqlx = { version = "0.7", features = [ "runtime-tokio", "sqlite", "migrate", "macros" ] }
|
||||||
tokio = { version = "1", features = ["full"] }
|
tokio = { version = "1", features = ["full"] }
|
||||||
blake3 = "1.5.0"
|
blake3 = "1.5.1"
|
||||||
dotenvy = "0.15.7"
|
dotenvy = "0.15.7"
|
||||||
chrono = "0.4.33"
|
chrono = "0.4.38"
|
||||||
|
|
||||||
strum = "0.26"
|
strum = "0.26"
|
||||||
strum_macros = "0.26"
|
strum_macros = "0.26"
|
||||||
|
@ -8,6 +8,7 @@ use relm4::{
|
|||||||
prelude::*,
|
prelude::*,
|
||||||
AsyncComponentSender,
|
AsyncComponentSender,
|
||||||
};
|
};
|
||||||
|
use relm4_icons::icon_names;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
database::Database,
|
database::Database,
|
||||||
@ -73,23 +74,23 @@ impl AsyncComponent for AppModel {
|
|||||||
set_margin_all: 10,
|
set_margin_all: 10,
|
||||||
set_spacing: 3,
|
set_spacing: 3,
|
||||||
gtk::Button {
|
gtk::Button {
|
||||||
set_icon_name: "view-refresh-symbolic",
|
set_icon_name: icon_names::REFRESH,
|
||||||
set_margin_end: 10,
|
set_margin_end: 10,
|
||||||
connect_clicked[sender] => move |_| sender.input(AppInput::Refresh),
|
connect_clicked[sender] => move |_| sender.input(AppInput::Refresh),
|
||||||
},
|
},
|
||||||
gtk::ToggleButton {
|
gtk::ToggleButton {
|
||||||
set_icon_name: "document-edit-symbolic",
|
set_icon_name: icon_names::EDIT,
|
||||||
set_margin_end: 10,
|
set_margin_end: 10,
|
||||||
connect_clicked[sender] => move |button| sender.input(AppInput::SetEditMode(button.is_active())),
|
connect_clicked[sender] => move |button| sender.input(AppInput::SetEditMode(button.is_active())),
|
||||||
},
|
},
|
||||||
#[name = "button_sort"]
|
#[name = "button_sort"]
|
||||||
gtk::ToggleButton {
|
gtk::ToggleButton {
|
||||||
set_icon_name: "view-sort-descending-symbolic",
|
set_icon_name: icon_names::ARROW_SORT_REGULAR,
|
||||||
set_active: true,
|
set_active: true,
|
||||||
connect_clicked[sender] => move |_| sender.input(AppInput::Sort),
|
connect_clicked[sender] => move |_| sender.input(AppInput::Sort),
|
||||||
},
|
},
|
||||||
gtk::ToggleButton {
|
gtk::ToggleButton {
|
||||||
set_icon_name: "media-playlist-shuffle-symbolic",
|
set_icon_name: icon_names::PLAYLIST_SHUFFLE,
|
||||||
set_group: Some(&button_sort),
|
set_group: Some(&button_sort),
|
||||||
connect_clicked[sender] => move |_| sender.input(AppInput::Shuffle),
|
connect_clicked[sender] => move |_| sender.input(AppInput::Shuffle),
|
||||||
},
|
},
|
||||||
|
@ -60,7 +60,7 @@ impl SimpleComponent for McduModel {
|
|||||||
|
|
||||||
fn init(
|
fn init(
|
||||||
_init: Self::Init,
|
_init: Self::Init,
|
||||||
root: &Self::Root,
|
root: Self::Root,
|
||||||
sender: ComponentSender<Self>,
|
sender: ComponentSender<Self>,
|
||||||
) -> ComponentParts<Self> {
|
) -> ComponentParts<Self> {
|
||||||
let model = McduModel::new();
|
let model = McduModel::new();
|
||||||
|
@ -162,8 +162,8 @@ impl AsyncComponent for SheetEditDialogModel {
|
|||||||
secondary_text: Some(String::from("Please make sure all fields are filled")),
|
secondary_text: Some(String::from("Please make sure all fields are filled")),
|
||||||
is_modal: true,
|
is_modal: true,
|
||||||
destructive_accept: false,
|
destructive_accept: false,
|
||||||
confirm_label: String::from("Ok"),
|
confirm_label: Some(String::from("Ok")),
|
||||||
cancel_label: String::from("Cancel"),
|
cancel_label: None,
|
||||||
option_label: None,
|
option_label: None,
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
|
|
||||||
use relm4::factory::FactoryVecDeque;
|
use relm4::factory::{FactoryVecDeque, Position};
|
||||||
use relm4::RelmListBoxExt;
|
use relm4::RelmListBoxExt;
|
||||||
use relm4::{gtk, ComponentParts, ComponentSender, SimpleComponent};
|
use relm4::{gtk, ComponentParts, ComponentSender, SimpleComponent};
|
||||||
|
|
||||||
@ -21,6 +21,7 @@ pub enum SheetListingInput {
|
|||||||
Sort,
|
Sort,
|
||||||
Shuffle,
|
Shuffle,
|
||||||
ReloadSheets(Vec<Sheet>),
|
ReloadSheets(Vec<Sheet>),
|
||||||
|
None,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -54,10 +55,12 @@ impl SimpleComponent for SheetListingModel {
|
|||||||
|
|
||||||
fn init(
|
fn init(
|
||||||
init: Self::Init,
|
init: Self::Init,
|
||||||
root: &Self::Root,
|
root: Self::Root,
|
||||||
sender: ComponentSender<Self>,
|
sender: ComponentSender<Self>,
|
||||||
) -> ComponentParts<Self> {
|
) -> ComponentParts<Self> {
|
||||||
let mut sheets = FactoryVecDeque::new(gtk::ListBox::default(), sender.input_sender());
|
let mut sheets = FactoryVecDeque::builder()
|
||||||
|
.launch(gtk::ListBox::default())
|
||||||
|
.forward(sender.input_sender(), |_| SheetListingInput::None);
|
||||||
for sheet_model_type in init {
|
for sheet_model_type in init {
|
||||||
sheets.guard().push_back(sheet_model_type);
|
sheets.guard().push_back(sheet_model_type);
|
||||||
}
|
}
|
||||||
@ -95,6 +98,7 @@ impl SimpleComponent for SheetListingModel {
|
|||||||
}
|
}
|
||||||
sender.output(SheetListingOutput::ContentsChanged);
|
sender.output(SheetListingOutput::ContentsChanged);
|
||||||
}
|
}
|
||||||
|
SheetListingInput::None => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,17 +3,12 @@ use relm4::prelude::*;
|
|||||||
|
|
||||||
use crate::sheet::Sheet;
|
use crate::sheet::Sheet;
|
||||||
|
|
||||||
use super::sheet_listing::SheetListingInput;
|
|
||||||
|
|
||||||
pub struct SheetModel {
|
pub struct SheetModel {
|
||||||
pub label: String,
|
pub label: String,
|
||||||
pub sheet: Sheet,
|
pub sheet: Sheet,
|
||||||
visible: bool,
|
visible: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct RowActivated;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct OnQueryUpdate {
|
pub struct OnQueryUpdate {
|
||||||
pub query: String,
|
pub query: String,
|
||||||
@ -24,9 +19,8 @@ impl FactoryComponent for SheetModel {
|
|||||||
type Init = Sheet;
|
type Init = Sheet;
|
||||||
type ParentWidget = gtk::ListBox;
|
type ParentWidget = gtk::ListBox;
|
||||||
type CommandOutput = ();
|
type CommandOutput = ();
|
||||||
type ParentInput = SheetListingInput;
|
|
||||||
type Input = OnQueryUpdate;
|
type Input = OnQueryUpdate;
|
||||||
type Output = RowActivated;
|
type Output = ();
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
#[root]
|
#[root]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user