diff --git a/crates/alkane-gui/assets/icons/bug.svg b/crates/alkane-gui/assets/icons/bug.svg
new file mode 100644
index 00000000..42755354
--- /dev/null
+++ b/crates/alkane-gui/assets/icons/bug.svg
@@ -0,0 +1 @@
+
diff --git a/crates/alkane-gui/assets/icons/database.svg b/crates/alkane-gui/assets/icons/database.svg
new file mode 100644
index 00000000..ca7ad923
--- /dev/null
+++ b/crates/alkane-gui/assets/icons/database.svg
@@ -0,0 +1 @@
+
diff --git a/crates/alkane-gui/assets/icons/gear.svg b/crates/alkane-gui/assets/icons/gear.svg
new file mode 100644
index 00000000..f4d8406b
--- /dev/null
+++ b/crates/alkane-gui/assets/icons/gear.svg
@@ -0,0 +1 @@
+
diff --git a/crates/alkane-gui/assets/icons/sd-card.svg b/crates/alkane-gui/assets/icons/sd-card.svg
new file mode 100644
index 00000000..eaca698b
--- /dev/null
+++ b/crates/alkane-gui/assets/icons/sd-card.svg
@@ -0,0 +1 @@
+
diff --git a/crates/alkane-gui/src/ui.rs b/crates/alkane-gui/src/ui.rs
index f643bc00..4de02b2d 100644
--- a/crates/alkane-gui/src/ui.rs
+++ b/crates/alkane-gui/src/ui.rs
@@ -28,6 +28,11 @@ pub const ID_EXPORT: i32 = 109;
pub const ID_SETTINGS: i32 = 110;
// Bug report / feature request dialog (toolbar, between Export and Settings).
pub const ID_BUG_REPORT: i32 = 111;
+// Unified "Data" toolbar icon button: a dropdown of Presets/Filter/Columns/Export.
+pub const ID_DATA: i32 = 112;
+// "Installation Media" toolbar icon button: opens the SD-card build dialog
+// without needing to right-click a miner.
+pub const ID_MEDIA_TOOLBAR: i32 = 113;
const ID_REPORT_SEND: i32 = 240;
const ID_REPORT_CLOSE: i32 = 241;
const ID_REPORT_OPEN: i32 = 242;
@@ -683,6 +688,12 @@ const SVG_BOLT_FULL: &str = include_str!("../assets/icons/bolt-solid-full.svg");
const SVG_BRAIN_FULL: &str = include_str!("../assets/icons/brain-solid-full.svg");
const SVG_FAN_FULL: &str = include_str!("../assets/icons/fan-solid-full.svg");
const SVG_CHIP_FULL: &str = include_str!("../assets/icons/microchip-solid-full.svg");
+// Toolbar icon buttons (round 19): gear (Settings), bug (report), database
+// (Data dropdown), sd-card (Installation Media).
+const SVG_GEAR: &str = include_str!("../assets/icons/gear.svg");
+const SVG_BUG: &str = include_str!("../assets/icons/bug.svg");
+const SVG_DATA: &str = include_str!("../assets/icons/database.svg");
+const SVG_SDCARD: &str = include_str!("../assets/icons/sd-card.svg");
/// KPI card minimum widths. The count cards (Total/Hashing/...) are narrow; the
/// two wide cards (SHA-256 Hashrate, Est. power) need more room so their
@@ -1269,21 +1280,36 @@ pub fn build(frame: Widget) -> App {
// when the language changes (round 15 #13).
let mut l10n_labels: Vec<(Widget, &'static str)> = Vec::new();
l10n_labels.push((ranges_btn, "Scan ranges"));
- let mut tbtn = |label: &'static str, id: i32| -> Widget {
- let b = Widget::button(panel, &crate::i18n::t(label), id);
+ // Compact icon toolbar (round 19): a unified "Data" dropdown (presets /
+ // filter / columns / export), an Installation-Media (SD card) button, Bug
+ // report, and Settings. Logs moved into the Settings dropdown
+ // (ID_LOGS_OPEN), so the old standalone Log button is gone. Icon buttons
+ // carry no text label, so they are not tracked for localization; their
+ // tooltips name them.
+ let icon_fg = if wx_rs::is_dark() {
+ (0xDD, 0xDD, 0xDD)
+ } else {
+ (0x33, 0x33, 0x33)
+ };
+ let icon_btn = |svg: &str, id: i32, tip: &str| -> Widget {
+ let b = Widget::svg_button(panel, &svg_recolored(svg, icon_fg), id, 22, 22);
+ b.set_tool_tip(&crate::i18n::t(tip));
ctl.add(b, 0, sf::ALIGN_CENTRE_VERTICAL | sf::BORDER_ALL, 4);
- l10n_labels.push((b, label));
b
};
- let _presets_btn = tbtn("Presets", ID_PRESETS);
- let _filter_btn = tbtn("Filter", ID_FILTER);
- let _columns_btn = tbtn("Columns", ID_COLUMNS);
- let _export_btn = tbtn("Export", ID_EXPORT);
- let _report_btn = tbtn("Bug report", ID_BUG_REPORT);
- // The old Credentials button is now a Settings menu (round 15 #13).
- let _creds_btn = tbtn("Settings", ID_SETTINGS);
- // Toggle between the fleet table and the live activity log.
- let log_toggle_btn = tbtn("Log", ID_LOG_TOGGLE);
+ let _data_btn = icon_btn(SVG_DATA, ID_DATA, "Data: presets, filter, columns, export");
+ let _media_btn = icon_btn(
+ SVG_SDCARD,
+ ID_MEDIA_TOOLBAR,
+ "Create installation media (SD card)",
+ );
+ let _report_btn = icon_btn(SVG_BUG, ID_BUG_REPORT, "Report a bug or request a feature");
+ let _settings_btn = icon_btn(SVG_GEAR, ID_SETTINGS, "Settings, language, and logs");
+ // The inline table/log view toggle is kept (toggle_log_view / log_view) but
+ // no longer surfaced as a toolbar button; logs are reached from Settings.
+ // Created hidden so the field and toggle_log_view stay valid.
+ let log_toggle_btn = Widget::button(panel, "Log", ID_LOG_TOGGLE);
+ log_toggle_btn.show(false);
root.add_sizer(ctl, 0, sf::EXPAND | sf::BORDER_LEFT | sf::BORDER_RIGHT, 4);
// Track the KPI captions for live re-localization (index 5, the hashrate
// caption, is dynamic per-algorithm so it is refreshed by refresh_kpis).
@@ -3766,6 +3792,12 @@ impl App {
// Settings menu items (round 15 #13).
ID_SCAN_CREDS => return Some(self.build_firmware_creds_dialog()),
ID_LOGS_OPEN => return Some(self.build_logs_dialog()),
+ // "Data" dropdown items (round 19): the former standalone toolbar
+ // buttons, now entries in one icon button's menu.
+ ID_PRESETS => return Some(self.build_presets_dialog()),
+ ID_FILTER => return Some(self.build_filter_dialog()),
+ ID_COLUMNS => return Some(self.build_columns_dialog()),
+ ID_EXPORT => return self.open_export_dialog(),
ID_HDR_SORT_ASC | ID_HDR_SORT_DESC | ID_HDR_SORT_REL_ASC | ID_HDR_SORT_REL_DESC
| ID_HDR_HIDE | ID_HDR_AUTOSIZE | ID_HDR_AUTOSIZE_ALL | ID_HDR_COLUMNS => {
return self.on_header_menu(id)
@@ -5680,6 +5712,20 @@ impl App {
/// Build + queue the Settings popup menu (round 15 #13): Credentials, a
/// Language submenu, and the Logs page.
+ /// The unified "Data" toolbar dropdown: presets, filter, columns, export.
+ /// The items reuse the existing action ids and are dispatched by
+ /// `on_menu_item` (same as any popped menu).
+ fn open_data_menu(&mut self) {
+ let t = crate::i18n::t;
+ let menu = Widget::menu_new();
+ menu.menu_append(ID_PRESETS, &t("Presets..."));
+ menu.menu_append(ID_FILTER, &t("Filter..."));
+ menu.menu_append(ID_COLUMNS, &t("Columns..."));
+ menu.menu_append_separator();
+ menu.menu_append(ID_EXPORT, &t("Export..."));
+ self.pending_popup = Some((Widget::main_frame(), menu));
+ }
+
fn open_settings_menu(&mut self) {
let menu = Widget::menu_new();
menu.menu_append(ID_SCAN_CREDS, &crate::i18n::t("Credentials"));
@@ -6468,6 +6514,8 @@ impl App {
ID_EXPORT_ALL => self.export_check_all(true),
ID_EXPORT_NONE => self.export_check_all(false),
ID_SETTINGS => self.open_settings_menu(),
+ ID_DATA => self.open_data_menu(),
+ ID_MEDIA_TOOLBAR => return self.build_install_media_dialog(),
ID_LOG_TOGGLE => self.toggle_log_view(),
ID_BUG_REPORT => return Some(self.build_report_dialog()),
ID_REPORT_SEND => self.send_report(),
diff --git a/thirdparty/wx-rs/patches/0010-svg-button.patch b/thirdparty/wx-rs/patches/0010-svg-button.patch
new file mode 100644
index 00000000..b6a08d4c
--- /dev/null
+++ b/thirdparty/wx-rs/patches/0010-svg-button.patch
@@ -0,0 +1,56 @@
+Subject: [PATCH 0010] svg_button: clickable SVG icon button for the toolbar
+
+--- a/cpp_src/widgets_bridge.cpp
++++ b/cpp_src/widgets_bridge.cpp
+@@ -2140,6 +2140,18 @@
+ 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
+--- a/src/widgets.rs
++++ b/src/widgets.rs
+@@ -121,6 +121,13 @@
+ pub fn wxbr_choice_set_selection(win: *mut c_void, i: c_int);
+ pub fn wxbr_media_button(parent: *mut c_void, id: c_int, kind: c_int, r: c_int, g: c_int, b: c_int) -> *mut c_void;
+ pub fn wxbr_svg_icon(parent: *mut c_void, svg: *const c_char, w: c_int, h: c_int) -> *mut c_void;
++ pub fn wxbr_svg_button(
++ parent: *mut c_void,
++ svg: *const c_char,
++ id: c_int,
++ w: c_int,
++ h: c_int,
++ ) -> *mut c_void;
+ pub fn wxbr_register_shape_svg(sentinel: c_int, svg: *const c_char, vbw: c_int, vbh: c_int);
+ pub fn wxbr_set_light_pulse(on: c_int);
+ pub fn wxbr_bind_sys_colour(win: *mut c_void);
+@@ -949,6 +956,16 @@
+ Widget(unsafe { notsafe::wxbr_svg_icon(parent.0, c.as_ptr(), w as c_int, h as c_int) })
+ }
+
++ /// A clickable icon button: render the (already-recoloured) SVG into a
++ /// `w`x`h` DIP bitmap button that emits a button click with `id`. Recolour
++ /// the SVG first (explicit fill, not `currentColor`).
++ pub fn svg_button(parent: Widget, svg: &str, id: i32, w: i32, h: i32) -> Widget {
++ let c = CString::new(svg).unwrap_or_default();
++ Widget(unsafe {
++ notsafe::wxbr_svg_button(parent.0, c.as_ptr(), id as c_int, w as c_int, h as c_int)
++ })
++ }
++
+ /// Listen for OS light/dark theme changes on this window (emits `SysColour`).
+ pub fn bind_sys_colour(&self) {
+ unsafe { notsafe::wxbr_bind_sys_colour(self.0) }
diff --git a/thirdparty/wx-rs/wx-rs-0.2.0-patched/cpp_src/widgets_bridge.cpp b/thirdparty/wx-rs/wx-rs-0.2.0-patched/cpp_src/widgets_bridge.cpp
index 02818d53..897f51ae 100644
--- a/thirdparty/wx-rs/wx-rs-0.2.0-patched/cpp_src/widgets_bridge.cpp
+++ b/thirdparty/wx-rs/wx-rs-0.2.0-patched/cpp_src/widgets_bridge.cpp
@@ -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
diff --git a/thirdparty/wx-rs/wx-rs-0.2.0-patched/src/widgets.rs b/thirdparty/wx-rs/wx-rs-0.2.0-patched/src/widgets.rs
index 2b89079e..e672f87d 100644
--- a/thirdparty/wx-rs/wx-rs-0.2.0-patched/src/widgets.rs
+++ b/thirdparty/wx-rs/wx-rs-0.2.0-patched/src/widgets.rs
@@ -121,6 +121,13 @@ mod notsafe {
pub fn wxbr_choice_set_selection(win: *mut c_void, i: c_int);
pub fn wxbr_media_button(parent: *mut c_void, id: c_int, kind: c_int, r: c_int, g: c_int, b: c_int) -> *mut c_void;
pub fn wxbr_svg_icon(parent: *mut c_void, svg: *const c_char, w: c_int, h: c_int) -> *mut c_void;
+ pub fn wxbr_svg_button(
+ parent: *mut c_void,
+ svg: *const c_char,
+ id: c_int,
+ w: c_int,
+ h: c_int,
+ ) -> *mut c_void;
pub fn wxbr_register_shape_svg(sentinel: c_int, svg: *const c_char, vbw: c_int, vbh: c_int);
pub fn wxbr_set_light_pulse(on: c_int);
pub fn wxbr_bind_sys_colour(win: *mut c_void);
@@ -949,6 +956,16 @@ impl Widget {
Widget(unsafe { notsafe::wxbr_svg_icon(parent.0, c.as_ptr(), w as c_int, h as c_int) })
}
+ /// A clickable icon button: render the (already-recoloured) SVG into a
+ /// `w`x`h` DIP bitmap button that emits a button click with `id`. Recolour
+ /// the SVG first (explicit fill, not `currentColor`).
+ pub fn svg_button(parent: Widget, svg: &str, id: i32, w: i32, h: i32) -> Widget {
+ let c = CString::new(svg).unwrap_or_default();
+ Widget(unsafe {
+ notsafe::wxbr_svg_button(parent.0, c.as_ptr(), id as c_int, w as c_int, h as c_int)
+ })
+ }
+
/// Listen for OS light/dark theme changes on this window (emits `SysColour`).
pub fn bind_sys_colour(&self) {
unsafe { notsafe::wxbr_bind_sys_colour(self.0) }