mirror of
https://github.com/aljazceru/notedeck.git
synced 2025-12-19 09:34:19 +01:00
integrate column moving
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -238,6 +238,6 @@ pub enum IntermediaryRoute {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub enum ColumnsAction {
|
pub enum ColumnsAction {
|
||||||
// Switch(usize), TODO: could use for keyboard selection
|
Switch(usize, usize), // from Switch.0 to Switch.1,
|
||||||
Remove(usize),
|
Remove(usize),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ impl SwitchingAction {
|
|||||||
ColumnsAction::Remove(index) => {
|
ColumnsAction::Remove(index) => {
|
||||||
get_active_columns_mut(ctx.accounts, decks_cache).delete_column(index)
|
get_active_columns_mut(ctx.accounts, decks_cache).delete_column(index)
|
||||||
}
|
}
|
||||||
|
ColumnsAction::Switch(from, to) => {
|
||||||
|
get_active_columns_mut(ctx.accounts, decks_cache).move_col(from, to);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
SwitchingAction::Decks(decks_action) => match *decks_action {
|
SwitchingAction::Decks(decks_action) => match *decks_action {
|
||||||
DecksAction::Switch(index) => {
|
DecksAction::Switch(index) => {
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
|
use crate::colors;
|
||||||
|
use crate::column::ColumnsAction;
|
||||||
|
use crate::nav::RenderNavAction;
|
||||||
|
use crate::nav::SwitchingAction;
|
||||||
use crate::{
|
use crate::{
|
||||||
colors,
|
|
||||||
column::Columns,
|
column::Columns,
|
||||||
nav::RenderNavAction,
|
|
||||||
route::Route,
|
route::Route,
|
||||||
timeline::{ColumnTitle, TimelineId, TimelineKind, TimelineRoute},
|
timeline::{ColumnTitle, TimelineId, TimelineKind, TimelineRoute},
|
||||||
ui::{
|
ui::{
|
||||||
@@ -10,7 +12,8 @@ use crate::{
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use egui::{Margin, RichText, Stroke, UiBuilder};
|
use egui::Margin;
|
||||||
|
use egui::{RichText, Stroke, UiBuilder};
|
||||||
use enostr::Pubkey;
|
use enostr::Pubkey;
|
||||||
use nostrdb::{Ndb, Transaction};
|
use nostrdb::{Ndb, Transaction};
|
||||||
use notedeck::{ImageCache, NotedeckTextStyle};
|
use notedeck::{ImageCache, NotedeckTextStyle};
|
||||||
@@ -88,10 +91,9 @@ impl<'a> NavTitle<'a> {
|
|||||||
TitleResponse::RemoveColumn => Some(RenderNavAction::RemoveColumn),
|
TitleResponse::RemoveColumn => Some(RenderNavAction::RemoveColumn),
|
||||||
TitleResponse::MoveColumn(to_index) => {
|
TitleResponse::MoveColumn(to_index) => {
|
||||||
let from = self.col_id;
|
let from = self.col_id;
|
||||||
None // TODO:
|
Some(RenderNavAction::SwitchingAction(SwitchingAction::Columns(
|
||||||
// Some(RenderNavAction::SwitchingAction(SwitchingAction::Columns(
|
ColumnsAction::Switch(from, to_index),
|
||||||
// ColumnsAction::Switch(from, to_index),
|
)))
|
||||||
// )))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if back_button_resp.map_or(false, |r| r.clicked()) {
|
} else if back_button_resp.map_or(false, |r| r.clicked()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user