forked from 1b-agent/opencadstudio-upstream
Blocks palette: tabs, options, drag insertion and -INSERT
Rebuild the Blocks palette with Current Drawing / Recent / Favorites / Libraries tabs, wildcard filter, six views, insertion options, click and drop insertion and a block context menu. INSERT opens the palette, the new -INSERT runs on the command line, the ribbon Insert button becomes a block gallery, and BLOCKMRULIST, BLOCKREDEFINEMODE, BLOCKNAVIGATE, BLOCKSTATE, EXPLMODE and INSNAME are added. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
3dcebf0dc6
commit
0826101c5e
49 files changed
+3401
-573
No files matched your search
+14
-1
@@ -20,7 +20,7 @@ use crate::modules::{CadModule, IconKind, RibbonGroup, RibbonItem};
|
||||
use crate::plugin::all_ribbon_modules;
|
||||
use crate::ui::properties::{linetype_display_name, lw_options, LinetypeItem};
|
||||
|
||||
mod widgets;
|
||||
pub(crate) mod widgets;
|
||||
mod draw_panel;
|
||||
pub(crate) use draw_panel::tools as panel_tools;
|
||||
mod modify_panel;
|
||||
@@ -745,6 +745,19 @@ impl Ribbon {
|
||||
|
||||
// ── Dropdown overlay ──────────────────────────────────────────────────
|
||||
|
||||
/// Place `panel` (`w` wide) under dropdown `id`, closing on a click
|
||||
/// outside it.
|
||||
pub fn place_dropdown<'a>(
|
||||
&self,
|
||||
id: &str,
|
||||
panel: Element<'a, Message>,
|
||||
w: f32,
|
||||
win_w: f32,
|
||||
) -> Element<'a, Message> {
|
||||
let (align_right, h_pad, top) = self.dd_anchor(id, w, win_w);
|
||||
dropdown_backdrop(position_ribbon_dropdown(panel, align_right, h_pad, top))
|
||||
}
|
||||
|
||||
pub fn dropdown_overlay(
|
||||
&self,
|
||||
undo_labels: &[String],
|
||||
|
||||
@@ -446,7 +446,7 @@ pub(super) fn combo_btn_style(
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn popup_row_style(theme: &Theme, status: button::Status) -> button::Style {
|
||||
pub(crate) fn popup_row_style(theme: &Theme, status: button::Status) -> button::Style {
|
||||
let palette = theme.palette();
|
||||
let pair = if matches!(status, button::Status::Hovered | button::Status::Pressed) {
|
||||
palette.background.weak
|
||||
@@ -460,7 +460,7 @@ pub(super) fn popup_row_style(theme: &Theme, status: button::Status) -> button::
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn popup_panel_style(theme: &Theme) -> container::Style {
|
||||
pub(crate) fn popup_panel_style(theme: &Theme) -> container::Style {
|
||||
let palette = theme.palette();
|
||||
container::Style {
|
||||
background: Some(Background::Color(palette.background.base.color)),
|
||||
|
||||
+729
-210
File diff suppressed because it is too large.
Load diff
@@ -233,13 +233,13 @@ pub fn click_page(selected: &mut Vec<usize>, anchor: &mut usize, page: usize, ct
|
||||
// accent-coloured card titles, segmented choices and toggle chips, with the
|
||||
// help button on the left of the footer and the named action on the right.
|
||||
|
||||
fn accent_text(theme: &Theme) -> text::Style {
|
||||
pub(crate) fn accent_text(theme: &Theme) -> text::Style {
|
||||
text::Style {
|
||||
color: Some(theme.palette().primary.base.color),
|
||||
}
|
||||
}
|
||||
|
||||
fn card_style(theme: &Theme) -> container::Style {
|
||||
pub(crate) fn card_style(theme: &Theme) -> container::Style {
|
||||
container::Style {
|
||||
background: Some(Background::Color(theme.palette().background.weak.color)),
|
||||
border: Border {
|
||||
@@ -251,7 +251,7 @@ fn card_style(theme: &Theme) -> container::Style {
|
||||
}
|
||||
}
|
||||
|
||||
fn well_style(theme: &Theme) -> container::Style {
|
||||
pub(crate) fn well_style(theme: &Theme) -> container::Style {
|
||||
container::Style {
|
||||
background: Some(Background::Color(theme.palette().background.base.color)),
|
||||
border: Border {
|
||||
|
||||
Reference in new issue
Block a user