feat: F1-F5 keyboard shortcuts and hex color input in color picker#10816
feat: F1-F5 keyboard shortcuts and hex color input in color picker#10816BenJule wants to merge 2 commits into
Conversation
e18c136 to
add1a40
Compare
|
Apologies — this PR was closed by mistake on 2026-06-07, and that was an error on my side, not a deliberate decision to withdraw the change. It happened as an unintended side effect of a branch cleanup in my fork: deleting the head branch automatically closed this PR. The contribution still stands. I have restored the branch and reopened the PR. Sorry for the noise and any confusion this caused. |
add1a40 to
40e8ea1
Compare
|
Force-pushed: rebased onto current |
|
These are PR for feature request being revieewing |
- F1–F4 switch the main tabs (3D Editor / Preview / Monitor / Project) and F5 reslices, when no modifier is held. - The AMS colour picker gains a hex input field (e.g. FF8800), kept in sync with the currently selected colour. The dark-mode changes that previously rode along on this branch (shared base) are dropped here; they live in their own PR (bambulab#11241).
40e8ea1 to
7040f0b
Compare
|
Heads-up: I force-pushed a cleaned-up version of this branch. It previously carried some dark-mode follow-system changes that had ridden along from the shared base branch — those belong to #11241, so I removed them here. This PR is now focused on just its two features:
Single commit on top of |
|
if (key_code == WXK_F5) { if (can_reslice()) reslice_now(); return; } |
Per review: F1-F4 switch to the corresponding main tab, so binding F5 to reslice instead of a fifth tab was inconsistent. Drop the F5 binding.
|
Good catch - removed the F5 binding. You're right that it was inconsistent: F1-F4 each switch to a main tab, so F5 doing a reslice instead of a fifth tab didn't fit. Now only F1-F4 (tab switches) and the hex color input remain. |
Summary
F1→ 3D Editor tabF2→ Preview tabF3→ Monitor tabF4→ Project tabF5→ Reslice (if a model is loaded)ColorPickerPopup: a#RRGGBBtext field appears below the custom color swatch. Typing a valid 6-digit hex code and pressing Enter applies the color immediately. Clicking any preset or AMS color swatch updates the hex field to reflect the selected color.Closes #313
Closes #1515
Closes #5078
Closes #10726
Details
Keyboard shortcuts (
MainFrame.cpp)Added a block in the existing
wxEVT_CHAR_HOOKhandler that intercepts F1–F5 before the canvas shortcut forwarding block. Only fires when no modifier keys are held, so existing debugger / browser F-key bindings are unaffected.Hex color input (
AMSMaterialsSetting.cpp/.hpp)TextInput* m_hex_inputadded toColorPickerPopup.#label and theTextInput(max 6 chars,wxTE_PROCESS_ENTER) are placed in a horizontal sizer added at the bottom of the popup.wxEVT_TEXT_ENTERparses the hex string, callsset_def_colour(), and firesEVT_SELECTED_COLORto the parent — the same path used by swatch clicks.set_def_colour()now callsChangeValue()on the hex field to keep it in sync whenever a swatch is clicked.Test plan