10
src/app.rs
10
src/app.rs
@@ -729,6 +729,11 @@ fn timelines_view(ui: &mut egui::Ui, sizes: Size, app: &mut Damus) {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let mut save_cols = false;
|
||||||
|
if let Some(action) = side_panel_action {
|
||||||
|
save_cols = save_cols || action.process(app);
|
||||||
|
}
|
||||||
|
|
||||||
let num_cols = app.columns().num_columns();
|
let num_cols = app.columns().num_columns();
|
||||||
let mut responses = Vec::with_capacity(num_cols);
|
let mut responses = Vec::with_capacity(num_cols);
|
||||||
for col_index in 0..num_cols {
|
for col_index in 0..num_cols {
|
||||||
@@ -747,11 +752,6 @@ fn timelines_view(ui: &mut egui::Ui, sizes: Size, app: &mut Damus) {
|
|||||||
//strip.cell(|ui| timeline::timeline_view(ui, app, timeline_ind));
|
//strip.cell(|ui| timeline::timeline_view(ui, app, timeline_ind));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut save_cols = false;
|
|
||||||
if let Some(action) = side_panel_action {
|
|
||||||
save_cols = save_cols || action.process(app);
|
|
||||||
}
|
|
||||||
|
|
||||||
for response in responses {
|
for response in responses {
|
||||||
let save = response.process_render_nav_response(app);
|
let save = response.process_render_nav_response(app);
|
||||||
save_cols = save_cols || save;
|
save_cols = save_cols || save;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ use crate::{app_style::emoji_font_family, decks::Deck};
|
|||||||
pub struct DeckState {
|
pub struct DeckState {
|
||||||
pub deck_name: String,
|
pub deck_name: String,
|
||||||
pub selected_glyph: Option<char>,
|
pub selected_glyph: Option<char>,
|
||||||
pub deleting: bool,
|
|
||||||
pub selecting_glyph: bool,
|
pub selecting_glyph: bool,
|
||||||
pub warn_no_title: bool,
|
pub warn_no_title: bool,
|
||||||
pub warn_no_icon: bool,
|
pub warn_no_icon: bool,
|
||||||
@@ -42,7 +41,6 @@ impl Default for DeckState {
|
|||||||
Self {
|
Self {
|
||||||
deck_name: Default::default(),
|
deck_name: Default::default(),
|
||||||
selected_glyph: Default::default(),
|
selected_glyph: Default::default(),
|
||||||
deleting: Default::default(),
|
|
||||||
selecting_glyph: true,
|
selecting_glyph: true,
|
||||||
warn_no_icon: Default::default(),
|
warn_no_icon: Default::default(),
|
||||||
warn_no_title: Default::default(),
|
warn_no_title: Default::default(),
|
||||||
|
|||||||
11
src/nav.rs
11
src/nav.rs
@@ -192,10 +192,6 @@ impl RenderNavResponse {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(Route::EditDeck(index)) = r {
|
|
||||||
SwitchingAction::Decks(DecksAction::Removing(index)).process(app);
|
|
||||||
}
|
|
||||||
|
|
||||||
switching_occured = true;
|
switching_occured = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,6 +314,7 @@ fn render_nav_body(
|
|||||||
resp
|
resp
|
||||||
}
|
}
|
||||||
Route::EditDeck(index) => {
|
Route::EditDeck(index) => {
|
||||||
|
let mut action = None;
|
||||||
let cur_deck = get_decks_mut(&app.accounts, &mut app.decks_cache)
|
let cur_deck = get_decks_mut(&app.accounts, &mut app.decks_cache)
|
||||||
.decks_mut()
|
.decks_mut()
|
||||||
.get_mut(*index)
|
.get_mut(*index)
|
||||||
@@ -338,7 +335,9 @@ fn render_nav_body(
|
|||||||
cur_deck.edit(configure_deck_response);
|
cur_deck.edit(configure_deck_response);
|
||||||
}
|
}
|
||||||
EditDeckResponse::Delete => {
|
EditDeckResponse::Delete => {
|
||||||
deck_state.deleting = true;
|
action = Some(RenderNavAction::SwitchingAction(SwitchingAction::Decks(
|
||||||
|
DecksAction::Removing(*index),
|
||||||
|
)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
get_active_columns_mut(&app.accounts, &mut app.decks_cache)
|
get_active_columns_mut(&app.accounts, &mut app.decks_cache)
|
||||||
@@ -346,7 +345,7 @@ fn render_nav_body(
|
|||||||
.go_back();
|
.go_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
None
|
action
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,17 +2,15 @@ use egui::{
|
|||||||
vec2, Color32, InnerResponse, Label, Layout, Margin, RichText, ScrollArea, Separator, Stroke,
|
vec2, Color32, InnerResponse, Label, Layout, Margin, RichText, ScrollArea, Separator, Stroke,
|
||||||
Widget,
|
Widget,
|
||||||
};
|
};
|
||||||
use tracing::info;
|
use tracing::{error, info};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
accounts::{Accounts, AccountsRoute},
|
accounts::{Accounts, AccountsRoute},
|
||||||
app::get_active_columns_mut,
|
app::{get_active_columns_mut, get_decks_mut},
|
||||||
app_style,
|
app_style::{self, DECK_ICON_SIZE},
|
||||||
app_style::DECK_ICON_SIZE,
|
|
||||||
colors,
|
colors,
|
||||||
column::Column,
|
column::Column,
|
||||||
decks::DecksAction,
|
decks::{DecksAction, DecksCache},
|
||||||
decks::DecksCache,
|
|
||||||
imgcache::ImageCache,
|
imgcache::ImageCache,
|
||||||
nav::SwitchingAction,
|
nav::SwitchingAction,
|
||||||
route::Route,
|
route::Route,
|
||||||
@@ -331,7 +329,20 @@ impl<'a> DesktopSidePanel<'a> {
|
|||||||
if router.routes().iter().any(|&r| r == Route::EditDeck(index)) {
|
if router.routes().iter().any(|&r| r == Route::EditDeck(index)) {
|
||||||
router.go_back();
|
router.go_back();
|
||||||
} else {
|
} else {
|
||||||
router.route_to(Route::EditDeck(index));
|
switching_response = Some(crate::nav::SwitchingAction::Decks(
|
||||||
|
DecksAction::Switch(index),
|
||||||
|
));
|
||||||
|
if let Some(edit_deck) = get_decks_mut(accounts, decks_cache)
|
||||||
|
.decks_mut()
|
||||||
|
.get_mut(index)
|
||||||
|
{
|
||||||
|
edit_deck
|
||||||
|
.columns_mut()
|
||||||
|
.get_first_router()
|
||||||
|
.route_to(Route::EditDeck(index));
|
||||||
|
} else {
|
||||||
|
error!("Cannot push EditDeck route to index {}", index);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user