Add right-click menu to reorder or unpin favs

Right-clicking a fav tile now opens a small
context menu with Move left, Move right, and
Unpin, instead of relying on drag-only reorder.

- speeddial.js: oncontextmenu handler, the
  menu build/position/dismiss logic, and an
  Escape-key close.
- style.css: .ctx-menu/.ctx-item styling.
- ActionRegistry: reorder_favourites persists
  the new bar order to AppConfig.
- SpeedDialDialog: routes the new
  reorder_favourites command from the page.
This commit is contained in:
Andrew
2026-07-10 17:18:00 +08:00
parent 7c9fa801fb
commit 35d189f1c7
5 changed files with 110 additions and 0 deletions

View File

@@ -189,6 +189,12 @@ private:
send_actions();
}
else if (cmd == "toggle_favourite") wxGetApp().action_registry().set_favourite(p.value("id", ""), p.value("fav", false));
else if (cmd == "reorder_favourites") {
std::vector<std::string> ids;
if (p.contains("ids") && p["ids"].is_array())
for (auto& e : p["ids"]) if (e.is_string()) ids.push_back(e.get<std::string>());
wxGetApp().action_registry().reorder_favourites(ids);
}
else if (cmd == "run_action") run_action(p.value("id", ""), p.value("title", ""));
else if (cmd == "resize") resize_to_content(json_int_or(p, "height", 0));
else if (cmd == "close_page") Dismiss();