This commit is contained in:
Ian Chua
2026-07-14 13:10:42 +08:00
parent 86a4cec753
commit fbed6f7dc6
23 changed files with 340 additions and 586 deletions

View File

@@ -32,8 +32,7 @@
#define wxMSW false
#endif
// Orca's styled button (Widgets/Button.hpp), used by PluginConfigField. Declared at global scope,
// which is where the widget lives.
// Orca's styled button (Widgets/Button.hpp), used by PluginConfigField. It lives at global scope.
class Button;
namespace Slic3r { namespace GUI {
@@ -487,9 +486,8 @@ public:
void enable() override;
void disable() override;
// Window-field: the dynamic rows live inside a single container panel (assigned to the base
// `window` in BUILD), so the field exposes one window instead of a bare sizer. This lets focus/
// scroll, full-width sizing and teardown operate on the whole field.
// The rows live in one container panel (the base `window`), so the field exposes a window instead
// of a bare sizer and focus, sizing and teardown apply to the whole field.
wxWindow* getWindow() override { return window; }
void msw_rescale() override;
@@ -521,11 +519,10 @@ private:
std::function<std::string()> m_selector;
};
// A settings row whose value is a raw JSON document that nobody should type by hand: the row shows a
// button, the button opens PluginsConfigDialog, and the document it hands back becomes the field's
// value. Routing the edit through the ordinary Field value/on_change_field path is what earns the row
// the same dirty state and revert arrow as every other setting — the dialog itself never touches the
// preset.
// A settings row whose value is a raw JSON document nobody types by hand: the button opens
// PluginsConfigDialog and the document it hands back becomes the field's value. The edit goes through
// the ordinary Field value/on_change_field path, so the row gets the same dirty state and revert arrow
// as any other setting — the dialog never touches the preset.
class PluginConfigField : public Field {
using Field::Field;
public:
@@ -535,9 +532,8 @@ public:
void BUILD() override;
// Which preset's capabilities the dialog lists. Supplied by the option group, which already
// carries its Tab's type; an int for the same reason OptionsGroup::m_config_type is one — it
// keeps Preset.hpp out of this header.
// Which preset's capabilities the dialog lists; set by the option group. An int for the same
// reason OptionsGroup::m_config_type is one: it keeps Preset.hpp out of this header.
void set_preset_type(int type) { m_preset_type = type; }
void set_value(const boost::any& value, bool change_event = false) override;
@@ -546,8 +542,8 @@ public:
void enable() override;
void disable() override;
// Window-field: the button is the whole field, so it is the window the option group sizes and
// positions (the ColourPicker idiom). A container panel would be sized but never laid out.
// The button is the whole field, so it is the window the option group sizes and positions (the
// ColourPicker idiom). A container panel would be sized but never laid out, collapsing the row.
wxWindow* getWindow() override { return window; }
void msw_rescale() override;