Add reload button functionality
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
use std::rc::Rc;
|
||||
|
||||
use gtk::prelude::*;
|
||||
|
||||
use relm4::factory::FactoryVecDeque;
|
||||
@@ -22,6 +20,7 @@ pub enum SheetListingInput {
|
||||
ListBoxRowClicked(i32),
|
||||
Sort,
|
||||
Shuffle,
|
||||
ReloadSheets(Vec<Sheet>),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -82,6 +81,12 @@ impl SimpleComponent for SheetListingModel {
|
||||
}
|
||||
SheetListingInput::Sort => sort_sheets(&mut self.sheets),
|
||||
SheetListingInput::Shuffle => shuffle_sheets(&mut self.sheets),
|
||||
SheetListingInput::ReloadSheets(sheets) => {
|
||||
self.sheets.guard().clear();
|
||||
for sheet_model_type in sheets {
|
||||
self.sheets.guard().push_back(sheet_model_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user