Make component message verbiage simpler and more consistent
This commit is contained in:
parent
6dc4c4359a
commit
e49b82743d
9 changed files with 94 additions and 92 deletions
|
|
@ -38,13 +38,13 @@ impl SimpleComponent for CollatableFilmGrid {
|
|||
let collation_menu = FilmCollationMenu::builder().launch(()).forward(
|
||||
film_grid.sender(),
|
||||
|message| match message {
|
||||
FilmCollationMenuOutput::SortBy(sorting, direction) => {
|
||||
FilmCollationMenuOutput::SortedBy(sorting, direction) => {
|
||||
FilmGridInput::SortBy(sorting, direction)
|
||||
}
|
||||
FilmCollationMenuOutput::ApplyWatchedFilter(watched_filter) => {
|
||||
FilmGridInput::ApplyWatchedFilter(watched_filter)
|
||||
FilmCollationMenuOutput::WatchFilterApplied(watched_filter) => {
|
||||
FilmGridInput::ApplyWatchFilter(watched_filter)
|
||||
}
|
||||
FilmCollationMenuOutput::ApplyNameFilter(name_filter) => {
|
||||
FilmCollationMenuOutput::NameFilterApplied(name_filter) => {
|
||||
FilmGridInput::ApplyNameFilter(name_filter)
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ impl SimpleComponent for CollatableSeriesGrid {
|
|||
SeriesCollationMenu::builder()
|
||||
.launch(())
|
||||
.forward(series_grid.sender(), |message| match message {
|
||||
SeriesCollationMenuOutput::SortBy(sorting, direction) => {
|
||||
SeriesCollationMenuOutput::SortedBy(sorting, direction) => {
|
||||
SeriesGridInput::SortBy(sorting, direction)
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use gtk4::{Align, Button, Entry, Label, ListBox, MenuButton, Orientation, Popove
|
|||
use relm4::{ComponentParts, ComponentSender, SimpleComponent, component};
|
||||
|
||||
use crate::ui::components::sorting_popover_entry::sorting_popover_entry;
|
||||
use crate::ui::filtering::WatchedFilter;
|
||||
use crate::ui::filtering::WatchFilter;
|
||||
use crate::ui::sorting::{FilmsSorting, SortingDirection};
|
||||
use crate::ui::widget_extensions::ComponentSenderExt;
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ use crate::ui::widget_extensions::ComponentSenderExt;
|
|||
pub struct FilmCollationMenu {
|
||||
sorted_by: FilmsSorting,
|
||||
sort_direction: SortingDirection,
|
||||
watched_filter: Option<WatchedFilter>,
|
||||
watch_filter: Option<WatchFilter>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
@ -24,14 +24,14 @@ pub enum FilmCollationMenuInput {
|
|||
ToggleSortOrder,
|
||||
ToggleWatchedFilter,
|
||||
ToggleUnwatchedFilter,
|
||||
NameFilterSet(String),
|
||||
SetNameFilter(String),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum FilmCollationMenuOutput {
|
||||
SortBy(FilmsSorting, SortingDirection),
|
||||
ApplyWatchedFilter(Option<WatchedFilter>),
|
||||
ApplyNameFilter(Option<String>),
|
||||
SortedBy(FilmsSorting, SortingDirection),
|
||||
WatchFilterApplied(Option<WatchFilter>),
|
||||
NameFilterApplied(Option<String>),
|
||||
}
|
||||
|
||||
#[component(pub)]
|
||||
|
|
@ -106,7 +106,7 @@ impl SimpleComponent for FilmCollationMenu {
|
|||
set_secondary_icon_sensitive: false,
|
||||
|
||||
connect_changed[sender] => move |entry| {
|
||||
sender.input(FilmCollationMenuInput::NameFilterSet(entry.text().to_string()));
|
||||
sender.input(FilmCollationMenuInput::SetNameFilter(entry.text().to_string()));
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -118,14 +118,14 @@ impl SimpleComponent for FilmCollationMenu {
|
|||
set_icon_name: "eye-outline-filled-symbolic",
|
||||
#[watch]
|
||||
#[block_signal(watched_toggled)]
|
||||
set_active: model.watched_filter == Some(WatchedFilter::OnlyWatched),
|
||||
set_active: model.watch_filter == Some(WatchFilter::OnlyWatched),
|
||||
connect_toggled => FilmCollationMenuInput::ToggleWatchedFilter @watched_toggled,
|
||||
},
|
||||
ToggleButton {
|
||||
set_icon_name: "eye-closed-symbolic",
|
||||
#[watch]
|
||||
#[block_signal(unwatched_toggled)]
|
||||
set_active: model.watched_filter == Some(WatchedFilter::OnlyUnwatched),
|
||||
set_active: model.watch_filter == Some(WatchFilter::OnlyUnwatched),
|
||||
connect_toggled => FilmCollationMenuInput::ToggleUnwatchedFilter @unwatched_toggled,
|
||||
},
|
||||
},
|
||||
|
|
@ -140,7 +140,7 @@ impl SimpleComponent for FilmCollationMenu {
|
|||
let model = FilmCollationMenu {
|
||||
sorted_by: FilmsSorting::Name,
|
||||
sort_direction: SortingDirection::Ascending,
|
||||
watched_filter: None,
|
||||
watch_filter: None,
|
||||
};
|
||||
let widgets = view_output!();
|
||||
ComponentParts { model, widgets }
|
||||
|
|
@ -159,7 +159,7 @@ impl SimpleComponent for FilmCollationMenu {
|
|||
FilmsSorting::ReleaseDate => SortingDirection::Descending,
|
||||
FilmsSorting::Runtime => SortingDirection::Ascending,
|
||||
};
|
||||
sender.emit_output(FilmCollationMenuOutput::SortBy(
|
||||
sender.emit_output(FilmCollationMenuOutput::SortedBy(
|
||||
sorting,
|
||||
self.sort_direction,
|
||||
));
|
||||
|
|
@ -169,42 +169,44 @@ impl SimpleComponent for FilmCollationMenu {
|
|||
SortingDirection::Ascending => SortingDirection::Descending,
|
||||
SortingDirection::Descending => SortingDirection::Ascending,
|
||||
};
|
||||
sender.emit_output(FilmCollationMenuOutput::SortBy(
|
||||
sender.emit_output(FilmCollationMenuOutput::SortedBy(
|
||||
self.sorted_by,
|
||||
self.sort_direction,
|
||||
));
|
||||
}
|
||||
FilmCollationMenuInput::ToggleWatchedFilter => {
|
||||
match self.watched_filter {
|
||||
Some(WatchedFilter::OnlyWatched) => {
|
||||
self.watched_filter = None;
|
||||
match self.watch_filter {
|
||||
Some(WatchFilter::OnlyWatched) => {
|
||||
self.watch_filter = None;
|
||||
}
|
||||
_ => {
|
||||
self.watched_filter = Some(WatchedFilter::OnlyWatched);
|
||||
self.watch_filter = Some(WatchFilter::OnlyWatched);
|
||||
}
|
||||
}
|
||||
sender.emit_output(FilmCollationMenuOutput::ApplyWatchedFilter(
|
||||
self.watched_filter,
|
||||
sender.emit_output(FilmCollationMenuOutput::WatchFilterApplied(
|
||||
self.watch_filter,
|
||||
));
|
||||
}
|
||||
FilmCollationMenuInput::ToggleUnwatchedFilter => {
|
||||
match self.watched_filter {
|
||||
Some(WatchedFilter::OnlyUnwatched) => {
|
||||
self.watched_filter = None;
|
||||
match self.watch_filter {
|
||||
Some(WatchFilter::OnlyUnwatched) => {
|
||||
self.watch_filter = None;
|
||||
}
|
||||
_ => {
|
||||
self.watched_filter = Some(WatchedFilter::OnlyUnwatched);
|
||||
self.watch_filter = Some(WatchFilter::OnlyUnwatched);
|
||||
}
|
||||
}
|
||||
sender.emit_output(FilmCollationMenuOutput::ApplyWatchedFilter(
|
||||
self.watched_filter,
|
||||
sender.emit_output(FilmCollationMenuOutput::WatchFilterApplied(
|
||||
self.watch_filter,
|
||||
));
|
||||
}
|
||||
FilmCollationMenuInput::NameFilterSet(name_filter) => {
|
||||
FilmCollationMenuInput::SetNameFilter(name_filter) => {
|
||||
if name_filter.is_empty() {
|
||||
sender.emit_output(FilmCollationMenuOutput::ApplyNameFilter(None));
|
||||
sender.emit_output(FilmCollationMenuOutput::NameFilterApplied(None));
|
||||
} else {
|
||||
sender.emit_output(FilmCollationMenuOutput::ApplyNameFilter(Some(name_filter)));
|
||||
sender.emit_output(FilmCollationMenuOutput::NameFilterApplied(Some(
|
||||
name_filter,
|
||||
)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ pub enum SeriesCollationMenuInput {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub enum SeriesCollationMenuOutput {
|
||||
SortBy(SeriesSorting, SortingDirection),
|
||||
SortedBy(SeriesSorting, SortingDirection),
|
||||
}
|
||||
|
||||
#[component(pub)]
|
||||
|
|
@ -122,7 +122,7 @@ impl SimpleComponent for SeriesCollationMenu {
|
|||
SeriesSorting::Name => SortingDirection::Ascending,
|
||||
SeriesSorting::FirstReleaseDate => SortingDirection::Descending,
|
||||
};
|
||||
sender.emit_output(SeriesCollationMenuOutput::SortBy(
|
||||
sender.emit_output(SeriesCollationMenuOutput::SortedBy(
|
||||
sorting,
|
||||
self.sort_direction,
|
||||
));
|
||||
|
|
@ -132,7 +132,7 @@ impl SimpleComponent for SeriesCollationMenu {
|
|||
SortingDirection::Ascending => SortingDirection::Descending,
|
||||
SortingDirection::Descending => SortingDirection::Ascending,
|
||||
};
|
||||
sender.emit_output(SeriesCollationMenuOutput::SortBy(
|
||||
sender.emit_output(SeriesCollationMenuOutput::SortedBy(
|
||||
self.sorted_by,
|
||||
self.sort_direction,
|
||||
));
|
||||
|
|
|
|||
|
|
@ -15,22 +15,22 @@ pub struct FilmDetails {
|
|||
|
||||
#[derive(Debug)]
|
||||
pub enum FilmDetailsInput {
|
||||
ToggleWatchedStatus,
|
||||
ToggleDownloadedStatus,
|
||||
ToggleWatchStatus,
|
||||
ToggleDownloadStatus,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum FilmDetailsOutput {
|
||||
WatchedStatusChanged(bool),
|
||||
DownloadedStatusChanged(bool),
|
||||
WatchStatusChanged(bool),
|
||||
DownloadStatusChanged(bool),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum FilmDetailsCmdOutput {
|
||||
WatchedStatusPersistSucceeded,
|
||||
WatchedStatusPersistFailed(DataManagerError),
|
||||
DownloadedStatusPersistSucceeded,
|
||||
DownloadedStatusPersistFailed(DataManagerError),
|
||||
WatchStatusPersistSucceeded,
|
||||
WatchStatusPersistFailed(DataManagerError),
|
||||
DownloadStatusPersistSucceeded,
|
||||
DownloadStatusPersistFailed(DataManagerError),
|
||||
}
|
||||
|
||||
#[component(pub)]
|
||||
|
|
@ -66,14 +66,14 @@ impl Component for FilmDetails {
|
|||
#[watch]
|
||||
set_label: if model.film_overview.watched { "Watched" } else { "Watch" },
|
||||
set_active: model.film_overview.watched,
|
||||
connect_toggled => FilmDetailsInput::ToggleWatchedStatus,
|
||||
connect_toggled => FilmDetailsInput::ToggleWatchStatus,
|
||||
},
|
||||
|
||||
ToggleButton {
|
||||
#[watch]
|
||||
set_label: if model.film_overview.downloaded { "Downloaded" } else { "Mark downloaded" },
|
||||
set_active: model.film_overview.downloaded,
|
||||
connect_toggled => FilmDetailsInput::ToggleDownloadedStatus,
|
||||
connect_toggled => FilmDetailsInput::ToggleDownloadStatus,
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -108,10 +108,10 @@ impl Component for FilmDetails {
|
|||
_root: >k4::Box,
|
||||
) {
|
||||
match message {
|
||||
FilmDetailsInput::ToggleWatchedStatus => {
|
||||
FilmDetailsInput::ToggleWatchStatus => {
|
||||
let watched = !self.film_overview.watched;
|
||||
self.film_overview.watched = watched;
|
||||
sender.emit_output(FilmDetailsOutput::WatchedStatusChanged(watched));
|
||||
sender.emit_output(FilmDetailsOutput::WatchStatusChanged(watched));
|
||||
|
||||
sender.oneshot_command(clone!(
|
||||
#[strong(rename_to = uuid)]
|
||||
|
|
@ -119,16 +119,16 @@ impl Component for FilmDetails {
|
|||
async move {
|
||||
let result = DataManager::set_film_watched_status(uuid.as_str(), watched).await;
|
||||
match result {
|
||||
Ok(()) => FilmDetailsCmdOutput::WatchedStatusPersistSucceeded,
|
||||
Err(error) => FilmDetailsCmdOutput::WatchedStatusPersistFailed(error),
|
||||
Ok(()) => FilmDetailsCmdOutput::WatchStatusPersistSucceeded,
|
||||
Err(error) => FilmDetailsCmdOutput::WatchStatusPersistFailed(error),
|
||||
}
|
||||
}
|
||||
));
|
||||
}
|
||||
FilmDetailsInput::ToggleDownloadedStatus => {
|
||||
FilmDetailsInput::ToggleDownloadStatus => {
|
||||
let downloaded = !self.film_overview.downloaded;
|
||||
self.film_overview.downloaded = downloaded;
|
||||
sender.emit_output(FilmDetailsOutput::DownloadedStatusChanged(downloaded));
|
||||
sender.emit_output(FilmDetailsOutput::DownloadStatusChanged(downloaded));
|
||||
|
||||
sender.oneshot_command(clone!(
|
||||
#[strong(rename_to = uuid)]
|
||||
|
|
@ -136,8 +136,8 @@ impl Component for FilmDetails {
|
|||
async move {
|
||||
let result = DataManager::set_film_downloaded_status(uuid.as_str(), downloaded).await;
|
||||
match result {
|
||||
Ok(()) => FilmDetailsCmdOutput::DownloadedStatusPersistSucceeded,
|
||||
Err(error) => FilmDetailsCmdOutput::DownloadedStatusPersistFailed(error),
|
||||
Ok(()) => FilmDetailsCmdOutput::DownloadStatusPersistSucceeded,
|
||||
Err(error) => FilmDetailsCmdOutput::DownloadStatusPersistFailed(error),
|
||||
}
|
||||
}
|
||||
));
|
||||
|
|
@ -152,12 +152,12 @@ impl Component for FilmDetails {
|
|||
_root: >k4::Box,
|
||||
) {
|
||||
match message {
|
||||
FilmDetailsCmdOutput::WatchedStatusPersistSucceeded => {}
|
||||
FilmDetailsCmdOutput::WatchedStatusPersistFailed(error) => {
|
||||
FilmDetailsCmdOutput::WatchStatusPersistSucceeded => {}
|
||||
FilmDetailsCmdOutput::WatchStatusPersistFailed(error) => {
|
||||
println!("Watched status persist failed: {error:?}");
|
||||
}
|
||||
FilmDetailsCmdOutput::DownloadedStatusPersistSucceeded => {}
|
||||
FilmDetailsCmdOutput::DownloadedStatusPersistFailed(error) => {
|
||||
FilmDetailsCmdOutput::DownloadStatusPersistSucceeded => {}
|
||||
FilmDetailsCmdOutput::DownloadStatusPersistFailed(error) => {
|
||||
println!("Downloaded status persist failed: {error:?}");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use relm4::{Component, ComponentParts, ComponentSender, component};
|
|||
use crate::persist::data_manager::{DataManager, DataManagerError};
|
||||
use crate::ui::components::media_grid_item::{FilmGridItem, FilmGridItemInput};
|
||||
use crate::ui::factory_sorting::sort_factory_vec;
|
||||
use crate::ui::filtering::WatchedFilter;
|
||||
use crate::ui::filtering::WatchFilter;
|
||||
use crate::ui::sorting::{
|
||||
FilmsSorting, SortingDirection, cmp_films_by_name, cmp_films_by_rel_date, cmp_films_by_runtime,
|
||||
};
|
||||
|
|
@ -21,7 +21,7 @@ pub struct FilmGrid {
|
|||
#[derive(Debug)]
|
||||
pub enum FilmGridInput {
|
||||
SortBy(FilmsSorting, SortingDirection),
|
||||
ApplyWatchedFilter(Option<WatchedFilter>),
|
||||
ApplyWatchFilter(Option<WatchFilter>),
|
||||
ApplyNameFilter(Option<String>),
|
||||
}
|
||||
|
||||
|
|
@ -101,8 +101,8 @@ impl Component for FilmGrid {
|
|||
}
|
||||
});
|
||||
}
|
||||
FilmGridInput::ApplyWatchedFilter(watched_filter) => match watched_filter {
|
||||
Some(WatchedFilter::OnlyWatched) => {
|
||||
FilmGridInput::ApplyWatchFilter(watched_filter) => match watched_filter {
|
||||
Some(WatchFilter::OnlyWatched) => {
|
||||
for (index, item) in self.items.iter().enumerate() {
|
||||
if item.film().watched {
|
||||
self.items.send(index, FilmGridItemInput::SetVisible(true));
|
||||
|
|
@ -111,7 +111,7 @@ impl Component for FilmGrid {
|
|||
}
|
||||
}
|
||||
}
|
||||
Some(WatchedFilter::OnlyUnwatched) => {
|
||||
Some(WatchFilter::OnlyUnwatched) => {
|
||||
for (index, item) in self.items.iter().enumerate() {
|
||||
if item.film().watched {
|
||||
self.items.send(index, FilmGridItemInput::SetVisible(false));
|
||||
|
|
|
|||
|
|
@ -28,6 +28,15 @@ impl FilmGridItem {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum FilmGridItemInput {
|
||||
ClickOnItem,
|
||||
CloseDetails,
|
||||
ChangeWatchStatus(bool),
|
||||
ChangeDownloadStatus(bool),
|
||||
SetVisible(bool),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum FilmGridItemCmdOutput {
|
||||
PosterReady(Texture),
|
||||
|
|
@ -35,15 +44,6 @@ pub enum FilmGridItemCmdOutput {
|
|||
PosterFailed(DataManagerError),
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum FilmGridItemInput {
|
||||
ItemClicked,
|
||||
DetailsClosed,
|
||||
WatchedStatusChanged(bool),
|
||||
DownloadedStatusChanged(bool),
|
||||
SetVisible(bool),
|
||||
}
|
||||
|
||||
#[factory(pub)]
|
||||
impl FactoryComponent for FilmGridItem {
|
||||
type Init = FilmOverview;
|
||||
|
|
@ -60,7 +60,7 @@ impl FactoryComponent for FilmGridItem {
|
|||
set_visible: self.visible,
|
||||
|
||||
Button {
|
||||
connect_clicked => FilmGridItemInput::ItemClicked,
|
||||
connect_clicked => FilmGridItemInput::ClickOnItem,
|
||||
set_css_classes: &["flat", "media-grid-item"],
|
||||
|
||||
gtk4::Box {
|
||||
|
|
@ -150,7 +150,7 @@ impl FactoryComponent for FilmGridItem {
|
|||
}),
|
||||
#[watch]
|
||||
set_child: self.details.as_ref().map(ComponentController::widget),
|
||||
connect_closed => FilmGridItemInput::DetailsClosed,
|
||||
connect_closed => FilmGridItemInput::CloseDetails,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -183,27 +183,27 @@ impl FactoryComponent for FilmGridItem {
|
|||
|
||||
fn update(&mut self, message: FilmGridItemInput, sender: FactorySender<FilmGridItem>) {
|
||||
match message {
|
||||
FilmGridItemInput::ItemClicked => {
|
||||
FilmGridItemInput::ClickOnItem => {
|
||||
let details_controller = FilmDetails::builder().launch(self.film.clone()).forward(
|
||||
sender.input_sender(),
|
||||
|film_details_output| match film_details_output {
|
||||
FilmDetailsOutput::WatchedStatusChanged(watched) => {
|
||||
FilmGridItemInput::WatchedStatusChanged(watched)
|
||||
FilmDetailsOutput::WatchStatusChanged(watched) => {
|
||||
FilmGridItemInput::ChangeWatchStatus(watched)
|
||||
}
|
||||
FilmDetailsOutput::DownloadedStatusChanged(downloaded) => {
|
||||
FilmGridItemInput::DownloadedStatusChanged(downloaded)
|
||||
FilmDetailsOutput::DownloadStatusChanged(downloaded) => {
|
||||
FilmGridItemInput::ChangeDownloadStatus(downloaded)
|
||||
}
|
||||
},
|
||||
);
|
||||
self.details = Some(details_controller);
|
||||
}
|
||||
FilmGridItemInput::DetailsClosed => {
|
||||
FilmGridItemInput::CloseDetails => {
|
||||
self.details = None;
|
||||
}
|
||||
FilmGridItemInput::WatchedStatusChanged(watched) => {
|
||||
FilmGridItemInput::ChangeWatchStatus(watched) => {
|
||||
self.film.watched = watched;
|
||||
}
|
||||
FilmGridItemInput::DownloadedStatusChanged(downloaded) => {
|
||||
FilmGridItemInput::ChangeDownloadStatus(downloaded) => {
|
||||
self.film.downloaded = downloaded;
|
||||
}
|
||||
FilmGridItemInput::SetVisible(visible) => {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,12 @@ impl SeriesGridItem {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum SeriesGridItemInput {
|
||||
ClickOnItem,
|
||||
CloseDetails,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum SeriesGridItemCmdOutput {
|
||||
PosterReady(Texture),
|
||||
|
|
@ -34,12 +40,6 @@ pub enum SeriesGridItemCmdOutput {
|
|||
PosterFailed(DataManagerError),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum SeriesGridItemInput {
|
||||
ItemClicked,
|
||||
DetailsClosed,
|
||||
}
|
||||
|
||||
#[factory(pub)]
|
||||
impl FactoryComponent for SeriesGridItem {
|
||||
type Init = SeriesOverview;
|
||||
|
|
@ -53,7 +53,7 @@ impl FactoryComponent for SeriesGridItem {
|
|||
root = FlowBoxChild {
|
||||
set_focusable: false,
|
||||
Button {
|
||||
connect_clicked => SeriesGridItemInput::ItemClicked,
|
||||
connect_clicked => SeriesGridItemInput::ClickOnItem,
|
||||
set_css_classes: &["flat", "media-grid-item"],
|
||||
gtk4::Box {
|
||||
set_orientation: Orientation::Vertical,
|
||||
|
|
@ -113,7 +113,7 @@ impl FactoryComponent for SeriesGridItem {
|
|||
}),
|
||||
#[watch]
|
||||
set_child: self.details.as_ref().map(ComponentController::widget),
|
||||
connect_closed => SeriesGridItemInput::DetailsClosed,
|
||||
connect_closed => SeriesGridItemInput::CloseDetails,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -145,13 +145,13 @@ impl FactoryComponent for SeriesGridItem {
|
|||
|
||||
fn update(&mut self, message: SeriesGridItemInput, _sender: FactorySender<SeriesGridItem>) {
|
||||
match message {
|
||||
SeriesGridItemInput::ItemClicked => {
|
||||
SeriesGridItemInput::ClickOnItem => {
|
||||
let details_controller = SeriesDetails::builder()
|
||||
.launch(self.series.clone())
|
||||
.detach();
|
||||
self.details = Some(details_controller);
|
||||
}
|
||||
SeriesGridItemInput::DetailsClosed => {
|
||||
SeriesGridItemInput::CloseDetails => {
|
||||
self.details = None;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
pub enum WatchedFilter {
|
||||
pub enum WatchFilter {
|
||||
OnlyWatched,
|
||||
OnlyUnwatched,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue