feat(gui): compact icon toolbar + SD-card media button
Reworks the fleet-view toolbar into icon buttons and adds a direct Installation-Media entry point: - New wx-rs bridge fn `wxbr_svg_button` (patch 0010): render a recoloured SVG into a clickable wxBitmapButton. Rust wrapper `Widget::svg_button`. - Settings -> gear icon; its dropdown already carries Logs (ID_LOGS_OPEN), so the standalone Log toolbar button is removed (the inline log view + toggle are kept but no longer surfaced as a button). - Bug report -> bug icon. - New unified "Data" icon (database) with a dropdown: Presets, Filter, Columns, Export (the four former standalone buttons; items dispatched via on_menu_item). - New "SD card" icon opens the Installation Media dialog without right-clicking a miner (ID_MEDIA_TOOLBAR -> build_install_media_dialog; defaults to the zynq-7010 board when nothing is selected). - Four new Font-Awesome-style icons (gear/bug/database/sd-card), recoloured to the theme foreground via svg_recolored; tooltips name each button. Native + Windows clippy clean, fmt clean, GUI self-test passes; icons verified to rasterise correctly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B1W6qKwKxq3oUPDKWicM6i
This commit is contained in:
@@ -2140,6 +2140,18 @@ void* wxbr_svg_icon(void* parent, const char* svg, int w, int h) {
|
||||
return (void*)new wxStaticBitmap((wxWindow*)parent, wxID_ANY, bundle);
|
||||
}
|
||||
|
||||
// Like wxbr_svg_icon, but a clickable button: render the (already-recoloured)
|
||||
// SVG into a w x h DIP bitmap bundle and wrap it in a wxBitmapButton that emits
|
||||
// WxEV_BUTTON_CLICKED with `id`. Used for the toolbar's icon buttons.
|
||||
void* wxbr_svg_button(void* parent, const char* svg, int id, int w, int h) {
|
||||
wxBitmapBundle bundle = wxBitmapBundle::FromSVG(svg, wxSize(w, h));
|
||||
wxBitmapButton* btn = new wxBitmapButton((wxWindow*)parent, id, bundle);
|
||||
btn->Bind(wxEVT_BUTTON, [id](wxCommandEvent&) {
|
||||
if (g_widget_event) g_widget_event(WxEV_BUTTON_CLICKED, id, 0);
|
||||
});
|
||||
return (void*)btn;
|
||||
}
|
||||
|
||||
// Register a raw SVG (with its viewBox width/height for aspect) for a table-cell
|
||||
// shape sentinel, so the SegmentRenderer can draw it recoloured to the cell's
|
||||
// segment colour (round 12 #9 access padlocks, #11 status KPI icons). Replaces
|
||||
|
||||
Reference in New Issue
Block a user