summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/SpinBox.cpp
AgeCommit message (Collapse)Author
2023-01-26LibGfx: Remove `try_` prefix from bitmap creation functionsTim Schumacher
Those don't have any non-try counterpart, so we might as well just omit it.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-19LibGUI: Accept() mouse wheel events in {Spin,Combo}Boxesthankyouverycool
Prevents ScrollableContainerWidgets from moving when changing values in embedded widgets with the mouse wheel.
2022-09-06LibGUI: Update {in,de}crement buttons when setting a new spin box rangenetworkException
2022-09-01LibGUI: Disable increment/decrement buttons on SpinBox based on valueTimothy Slater
When the value for a SpinBox equals the max, disable the increment button. Functionally, clicking the button doesn't do anything because the set_value() clamps the value to min/max and updates the textbox. However it is still nice to indicate to the user that they've reached the max. Same goes for minimum value and the decrement button.
2022-09-01LibGUI: Improve SpinBox usabilityTimothy Slater
Previously the value of the SpinBox is re-evaluated after every change to the TextBox control. This leads to very unintuitive behavior such as the user deleting the contents of the box and it having no visible effect. This happens because the TextBox no longer has a valid number and so gets reset to the current m_value of the SpinBox. By defering the update of to the SpinBox value until focus leaves the control we provide a much more intuitive experience with the text box. We do still validate when a user types something that it parses to an int. If it does not we delete the most recent character. This in effect prevents non-numeric numbers from being entered. Upon losing focus the value will be checked. If empty we set the SpinBox value to the minimum allowed value.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-06-28LibGUI: Use new layout system for basic widgetsFrHun
2022-05-23LibGUI: Add on_return_pressed function to SpinBoxAndrew Smith
2022-03-12Libraries: Use default constructors/destructors in LibGUILenny Maiorani
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules "The compiler is more likely to get the default semantics right and you cannot implement these functions better than the compiler."
2022-03-08LibGUI: Fix crash in GML Playground auto-completing SpinBox propsAndrew Smith
Crash was caused by deferred invocation of a lambda on the SpinBox's TextEditor widget's on_change. The lambda referenced the SpinBox ptr, but in GML Playground the SpinBox was free'd before the deferred lambda could run, causing a use-after-free error. Fixed by using a weak ptr to detect if the SpinBox was free'd.
2022-01-20Userland: Add horizontal mouse scroll supportDmitry Petrov
2021-11-08LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()Andreas Kling
This was used in a lot of places, so this patch makes liberal use of ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
2021-09-22LibGUI: Rename CallOnChange => AllowCallback and implement elsewherethankyouverycool
This is a helpful option to prevent unwanted side effects, distinguish between user and programmatic input, etc. Sliders and SpinBoxes were implementing it idiosyncratically, so let's generalize the API and give Buttons and TextEditors the same ability.
2021-09-01LibGUI:: Style Combo and SpinBox buttons as ThickCapsthankyouverycool
These suffered the same visual defect as scrollbars when styled as normal buttons: against backgrounds with the same color as their highlighting, aspect was lost.
2021-07-21LibGfx: Use "try_" prefix for static factory functionsAndreas Kling
Also mark them as [[nodiscard]].
2021-04-23LibGUI: Allow bypassing hook when setting SpinBox rangethankyouverycool
Pass false to set_range to avoid on_change side-effects.
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-03-12LibGUI: Ignore scroll length multiplier in SpinBoxes & Slidersthankyouverycool
Prevents discrete values from being skipped when using the mouse wheel on SpinBoxes and proportional Sliders. Wheel delta can be accelerated by holding Ctrl.
2021-02-27LibGUI: Remove ControlBoxButton widgetthankyouverycool
ComboBoxes and SpinBoxes were still relying on ascii-to-bitmap icons instead of PNGs. This makes it easier to theme in the future.
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling