T17 Editor: CodeEditor with gutter, folds, minimap, rulers, guides, brackets, whitespace, cursors, multi-cursor, sticky scroll, inlay hints, lenses, decorations, ghost text, inline chat and diff (T17a); completions, signatures, hover, code actions, rename, references, outline, go to symbol, call and type hierarchy (T17b); find and replace, search panel and filters (T17c); problems, output, debug console, extensions, settings with JSON, keybindings, theme previews, welcome, recent projects, switcher, task runner (T17d); status items (T17e)
Shared: generic undo History, OverflowMenu icon and tooltip, StatusBarItem leading, six Lucide icons.
This commit is contained in:
1 parent
a894e5f973
commit
5545ce6458
59 files changed
+10820
-71
No files matched your search
+16
-2
@@ -104,6 +104,8 @@ impl RenderOnce for DropdownMenu {
|
||||
pub struct OverflowMenu {
|
||||
id: ElementId,
|
||||
menu: Menu,
|
||||
icon: IconName,
|
||||
tooltip: SharedString,
|
||||
}
|
||||
|
||||
impl OverflowMenu {
|
||||
@@ -111,17 +113,29 @@ impl OverflowMenu {
|
||||
Self {
|
||||
id: id.into(),
|
||||
menu,
|
||||
icon: IconName::Ellipsis,
|
||||
tooltip: "More".into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn icon(mut self, icon: IconName) -> Self {
|
||||
self.icon = icon;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn tooltip(mut self, tooltip: impl Into<SharedString>) -> Self {
|
||||
self.tooltip = tooltip.into();
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl RenderOnce for OverflowMenu {
|
||||
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement {
|
||||
let state = state(&self.id, window, cx);
|
||||
let click = toggle(&state, &self.menu, cx);
|
||||
let button = IconButton::new((self.id.clone(), "button"), IconName::Ellipsis)
|
||||
let button = IconButton::new((self.id.clone(), "button"), self.icon)
|
||||
.variant(ButtonVariant::Ghost)
|
||||
.tooltip("More")
|
||||
.tooltip(self.tooltip)
|
||||
.on_click(move |event, window, cx| click(event, window, cx));
|
||||
host(self.id, button, &self.menu, &state, None, window, cx)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user