mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-27 20:16:50 -06:00
Fix up merged PRs: Draw Table and Table Eraser sit in the Table Design tab
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1659e06565
commit
2173cf9569
@@ -2816,6 +2816,18 @@ fn table_design(app: &mut SlideApp, ui: &mut Ui) {
|
||||
});
|
||||
});
|
||||
});
|
||||
// Draw Borders: the pencil splits cells along a line, the eraser merges across a border.
|
||||
group(ui, |ui| {
|
||||
use deckcraft_engine::ToolKind;
|
||||
use deckcraft_engine::tools::{DRAW_TABLE, TABLE_ERASER};
|
||||
let cur = app.session.tool.kind.clone();
|
||||
for (icon, label, preset) in [(Icon::Pencil, "Draw Table", DRAW_TABLE), (Icon::Eraser, "Table Eraser", TABLE_ERASER)] {
|
||||
let on = matches!(&cur, ToolKind::Shape { preset: p } if p == preset);
|
||||
if big_button_ex(ui, icon, label, true, false, on).0.clicked() {
|
||||
app.session.set_tool(if on { ToolKind::Select } else { ToolKind::Shape { preset: preset.into() } });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// A Picture Styles gallery tile: a landscape "picture" in the style's shape and frame.
|
||||
@@ -2887,18 +2899,6 @@ fn paint_recolor(p: &egui::Painter, r: Rect, id: &str, sc: &deckcraft_color::Col
|
||||
p.rect_filled(Rect::from_min_size(pos2(r.left() + k as f32 * w, r.top()), vec2(w + 0.5, r.height())), CornerRadius::ZERO, c);
|
||||
}
|
||||
p.rect_stroke(r, CornerRadius::ZERO, Stroke::new(0.5, Color32::from_gray(160)), egui::StrokeKind::Outside);
|
||||
// Draw Borders: the pencil splits cells along a line, the eraser merges across a border.
|
||||
group(ui, |ui| {
|
||||
use deckcraft_engine::ToolKind;
|
||||
use deckcraft_engine::tools::{DRAW_TABLE, TABLE_ERASER};
|
||||
let cur = app.session.tool.kind.clone();
|
||||
for (icon, label, preset) in [(Icon::Pencil, "Draw Table", DRAW_TABLE), (Icon::Eraser, "Table Eraser", TABLE_ERASER)] {
|
||||
let on = matches!(&cur, ToolKind::Shape { preset: p } if p == preset);
|
||||
if big_button_ex(ui, icon, label, true, false, on).0.clicked() {
|
||||
app.session.set_tool(if on { ToolKind::Select } else { ToolKind::Shape { preset: preset.into() } });
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
pub fn paint_table_style(p: &egui::Painter, r: Rect, id: &str, sc: &deckcraft_color::ColorScheme) {
|
||||
|
||||
Reference in New Issue
Block a user