Add menu items for projects and closing files

This commit is contained in:
Jeremy Soller 2023-11-13 07:32:20 -07:00
parent e278317565
commit 5032f74356
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
4 changed files with 33 additions and 5 deletions

View file

@ -72,6 +72,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum Message {
Config(Config),
CloseFile,
CloseProject,
Copy,
Cut,
DefaultFont(usize),
@ -523,6 +525,12 @@ impl cosmic::Application for App {
self.update_config();
}
}
Message::CloseFile => {
return self.update(Message::TabClose(self.tab_model.active()));
}
Message::CloseProject => {
log::info!("TODO");
}
Message::Copy => match self.active_tab() {
Some(tab) => {
let editor = tab.editor.lock().unwrap();