forked from 1b-agent/opencadstudio-upstream
feat: add theme-aware expandable Draw panel
This commit is contained in:
1 parent
b19992cbcb
commit
2b4d8fe046
3 files changed
+119
-2
No files matched your search
@@ -21,6 +21,7 @@ use crate::plugin::all_ribbon_modules;
|
||||
use crate::ui::properties::{linetype_display_name, lw_options, LinetypeItem};
|
||||
|
||||
mod widgets;
|
||||
mod draw_panel;
|
||||
use widgets::{StyleContext, *};
|
||||
mod collapse;
|
||||
use collapse::{CollapsePanels, Panel};
|
||||
@@ -391,7 +392,7 @@ impl Ribbon {
|
||||
|
||||
pub fn select_dropdown_item(&mut self, dropdown_id: &'static str, cmd: &'static str) {
|
||||
self.last_cmd.insert(dropdown_id, cmd);
|
||||
self.open_dropdown = None;
|
||||
self.close_dropdown();
|
||||
}
|
||||
|
||||
// ── View ──────────────────────────────────────────────────────────────
|
||||
@@ -725,6 +726,10 @@ impl Ribbon {
|
||||
}
|
||||
let open_id = self.open_dropdown.as_deref()?;
|
||||
|
||||
if draw_panel::owns_dropdown(open_id) {
|
||||
return Some(draw_panel::overlay(self, open_id, win));
|
||||
}
|
||||
|
||||
if open_id == UNDO_HISTORY_ID || open_id == REDO_HISTORY_ID {
|
||||
let is_undo = open_id == UNDO_HISTORY_ID;
|
||||
let labels = if is_undo { undo_labels } else { redo_labels };
|
||||
@@ -1364,7 +1369,7 @@ fn render_group<'a>(
|
||||
|
||||
column![
|
||||
tools_el,
|
||||
container(text(t!(group.title)).size(9).style(muted_text_style)).padding([1, 4]),
|
||||
draw_panel::group_title(group.title, open_dd),
|
||||
]
|
||||
.align_x(iced::Center)
|
||||
.spacing(0)
|
||||
|
||||
Reference in new issue
Block a user