Add stubs for new file/new folder
This commit is contained in:
parent
ac93fc79d4
commit
bb5403faf9
3 changed files with 17 additions and 0 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -100,6 +100,8 @@ pub struct Flags {
|
|||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum Action {
|
||||
Copy,
|
||||
NewFile,
|
||||
NewFolder,
|
||||
Paste,
|
||||
SelectAll,
|
||||
Settings,
|
||||
|
|
@ -110,6 +112,8 @@ impl Action {
|
|||
pub fn message(self, entity: segmented_button::Entity) -> Message {
|
||||
match self {
|
||||
Action::Copy => Message::Copy(Some(entity)),
|
||||
Action::NewFile => Message::NewFile(Some(entity)),
|
||||
Action::NewFolder => Message::NewFolder(Some(entity)),
|
||||
Action::Paste => Message::Paste(Some(entity)),
|
||||
Action::SelectAll => Message::SelectAll(Some(entity)),
|
||||
Action::Settings => Message::ToggleContextPage(ContextPage::Settings),
|
||||
|
|
@ -125,6 +129,8 @@ pub enum Message {
|
|||
AppTheme(AppTheme),
|
||||
Config(Config),
|
||||
Copy(Option<segmented_button::Entity>),
|
||||
NewFile(Option<segmented_button::Entity>),
|
||||
NewFolder(Option<segmented_button::Entity>),
|
||||
Paste(Option<segmented_button::Entity>),
|
||||
SelectAll(Option<segmented_button::Entity>),
|
||||
SystemThemeModeChange(cosmic_theme::ThemeMode),
|
||||
|
|
@ -319,6 +325,12 @@ impl Application for App {
|
|||
Message::Copy(entity_opt) => {
|
||||
log::warn!("TODO: COPY");
|
||||
}
|
||||
Message::NewFile(entity_opt) => {
|
||||
log::warn!("TODO: NEW FILE");
|
||||
}
|
||||
Message::NewFolder(entity_opt) => {
|
||||
log::warn!("TODO: NEW FOLDER");
|
||||
}
|
||||
Message::Paste(entity_opt) => {
|
||||
log::warn!("TODO: PASTE");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ pub fn context_menu<'a>(entity: segmented_button::Entity) -> Element<'a, Message
|
|||
};
|
||||
|
||||
widget::container(column!(
|
||||
menu_action(fl!("new-file"), Action::NewFile),
|
||||
menu_action(fl!("new-folder"), Action::NewFolder),
|
||||
horizontal_rule(1),
|
||||
menu_action(fl!("copy"), Action::Copy),
|
||||
menu_action(fl!("paste"), Action::Paste),
|
||||
menu_action(fl!("select-all"), Action::SelectAll),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue