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
|
|
@ -14,6 +14,8 @@ dark = Dark
|
||||||
light = Light
|
light = Light
|
||||||
|
|
||||||
# Context menu
|
# Context menu
|
||||||
|
new-file = New file
|
||||||
|
new-folder = New folder
|
||||||
copy = Copy
|
copy = Copy
|
||||||
paste = Paste
|
paste = Paste
|
||||||
select-all = Select all
|
select-all = Select all
|
||||||
|
|
|
||||||
12
src/main.rs
12
src/main.rs
|
|
@ -100,6 +100,8 @@ pub struct Flags {
|
||||||
#[derive(Clone, Copy, Debug)]
|
#[derive(Clone, Copy, Debug)]
|
||||||
pub enum Action {
|
pub enum Action {
|
||||||
Copy,
|
Copy,
|
||||||
|
NewFile,
|
||||||
|
NewFolder,
|
||||||
Paste,
|
Paste,
|
||||||
SelectAll,
|
SelectAll,
|
||||||
Settings,
|
Settings,
|
||||||
|
|
@ -110,6 +112,8 @@ impl Action {
|
||||||
pub fn message(self, entity: segmented_button::Entity) -> Message {
|
pub fn message(self, entity: segmented_button::Entity) -> Message {
|
||||||
match self {
|
match self {
|
||||||
Action::Copy => Message::Copy(Some(entity)),
|
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::Paste => Message::Paste(Some(entity)),
|
||||||
Action::SelectAll => Message::SelectAll(Some(entity)),
|
Action::SelectAll => Message::SelectAll(Some(entity)),
|
||||||
Action::Settings => Message::ToggleContextPage(ContextPage::Settings),
|
Action::Settings => Message::ToggleContextPage(ContextPage::Settings),
|
||||||
|
|
@ -125,6 +129,8 @@ pub enum Message {
|
||||||
AppTheme(AppTheme),
|
AppTheme(AppTheme),
|
||||||
Config(Config),
|
Config(Config),
|
||||||
Copy(Option<segmented_button::Entity>),
|
Copy(Option<segmented_button::Entity>),
|
||||||
|
NewFile(Option<segmented_button::Entity>),
|
||||||
|
NewFolder(Option<segmented_button::Entity>),
|
||||||
Paste(Option<segmented_button::Entity>),
|
Paste(Option<segmented_button::Entity>),
|
||||||
SelectAll(Option<segmented_button::Entity>),
|
SelectAll(Option<segmented_button::Entity>),
|
||||||
SystemThemeModeChange(cosmic_theme::ThemeMode),
|
SystemThemeModeChange(cosmic_theme::ThemeMode),
|
||||||
|
|
@ -319,6 +325,12 @@ impl Application for App {
|
||||||
Message::Copy(entity_opt) => {
|
Message::Copy(entity_opt) => {
|
||||||
log::warn!("TODO: COPY");
|
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) => {
|
Message::Paste(entity_opt) => {
|
||||||
log::warn!("TODO: PASTE");
|
log::warn!("TODO: PASTE");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,9 @@ pub fn context_menu<'a>(entity: segmented_button::Entity) -> Element<'a, Message
|
||||||
};
|
};
|
||||||
|
|
||||||
widget::container(column!(
|
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!("copy"), Action::Copy),
|
||||||
menu_action(fl!("paste"), Action::Paste),
|
menu_action(fl!("paste"), Action::Paste),
|
||||||
menu_action(fl!("select-all"), Action::SelectAll),
|
menu_action(fl!("select-all"), Action::SelectAll),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue