diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-12-13 16:55:10 +0100 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-12-13 16:55:16 +0100 |
| commit | 41dd84016d5383f2648c25e4c6dd1d6e39418b20 (patch) | |
| tree | 19d6b58f9720e37f76fcb018e26fcef23e28d054 /src | |
| parent | 3c6fed2dd7fc6e1ecd7dc770ec0663928e582195 (diff) | |
#862: Removes default shortcut from Fl_Shortcut_Button
- the current UI for fallback/default/original shortcut was
confusing, so I remove it until we find something better. I
kept the values so we can reinstate a better interface without
changing the API.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Shortcut_Button.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/Fl_Shortcut_Button.cxx b/src/Fl_Shortcut_Button.cxx index 555371e0b..a9002d30f 100644 --- a/src/Fl_Shortcut_Button.cxx +++ b/src/Fl_Shortcut_Button.cxx @@ -75,7 +75,9 @@ Fl_Shortcut Fl_Shortcut_Button::value() { return shortcut_value; } -/** +#if 0 +// Default shortcut settings are disabled until successful review of the UI +/* * Set the default shortcut. If set, and additional 'reverse' button apears that the user can click to reset the shortcut to some default value (including 0). @@ -86,22 +88,29 @@ void Fl_Shortcut_Button::default_value(Fl_Shortcut shortcut) { default_set_ = true; redraw(); } +#endif -/** +#if 0 +// Default shortcut settings are disabled until successful review of the UI +/* * Return the default shortcut. \return shortcut encoded as key and modifier */ Fl_Shortcut Fl_Shortcut_Button::default_value() { return default_shortcut_; } +#endif -/** +#if 0 +// Default shortcut settings are disabled until successful review of the UI +/* * No longer show the button to reverse to a default shortcut. */ void Fl_Shortcut_Button::default_clear() { default_set_ = false; redraw(); } +#endif /** Draw the textual representation of the shortcut button. @@ -134,12 +143,16 @@ void Fl_Shortcut_Button::draw() { const char *text = label(); if (shortcut_value) text = fl_shortcut_label(shortcut_value); +#if 0 if (default_set_) { fl_draw(text, X, Y, W-H, H, align() | FL_ALIGN_INSIDE); fl_draw_symbol("@-29undo", X+W-H, Y, H, H, textcol); } else { fl_draw(text, X, Y, W, H, align() | FL_ALIGN_INSIDE); } +#else + fl_draw(text, X, Y, W, H, align() | FL_ALIGN_INSIDE); +#endif if (Fl::focus() == this) draw_focus(); } @@ -156,6 +169,7 @@ void Fl_Shortcut_Button::do_end_hot_callback() { Handle keystrokes to catch the user's shortcut. */ int Fl_Shortcut_Button::handle(int e) { +#if 0 bool inside_default_button = false; if (default_set_ && ( (e == FL_PUSH) || (e == FL_DRAG) || (e == FL_RELEASE) ) ) { int X = x() + Fl::box_dx(box()); @@ -184,6 +198,7 @@ int Fl_Shortcut_Button::handle(int e) { return 1; } } +#endif switch (e) { case FL_PUSH: if (Fl::visible_focus() && handle(FL_FOCUS)) Fl::focus(this); |
