Add simple context menu

This commit is contained in:
Jeremy Soller 2023-11-20 11:26:26 -07:00
parent a1b40e1d71
commit 858bad0f50
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
5 changed files with 205 additions and 89 deletions

View file

@ -1,6 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
use cosmic::widget::{icon, Icon};
use cosmic::{
iced::Point,
widget::{icon, Icon},
};
use cosmic_text::{Attrs, Buffer, Edit, Shaping, SyntaxEditor, ViEditor, Wrap};
use std::{fs, path::PathBuf, sync::Mutex};
@ -10,6 +13,7 @@ pub struct Tab {
pub path_opt: Option<PathBuf>,
attrs: Attrs<'static>,
pub editor: Mutex<ViEditor<'static>>,
pub context_menu: Option<Point>,
}
impl Tab {
@ -31,6 +35,7 @@ impl Tab {
path_opt: None,
attrs,
editor: Mutex::new(ViEditor::new(editor)),
context_menu: None,
};
// Update any other config settings