summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/AbstractButton.cpp
AgeCommit message (Collapse)Author
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling
2021-01-01LibGUI: Transfer focus when checking exclusive button programmaticallyAndreas Kling
When calling set_checked(true) on an exclusive button, we will now transfer focus to the newly checked button if one of its now-unchecked siblings had focus before. This makes windows that place initial focus somewhere in a group of radio buttons look nicer when they show up, since focus will be on whichever radio button was pre-checked, which may not be the first one in the group.
2021-01-01LibGUI: Simplify RadioButton by using AbstractButton exclusive modeAndreas Kling
Making an AbstractButton exclusive means that we enforce that only one of the exclusive buttons within the same parent widget can be checked at a time. RadioButton was doing exactly the same thing, except in a custom way. So just remove the custom code and make it exclusive. :^)
2020-12-28LibGUI: Tweak AbstractButton and subclass constructorsAndreas Kling
Taking a "const StringView&" for the initial text does not achieve anything useful. Just take a "String" and move it into storage.
2020-10-30LibGUI: Fix null parent deref in AbstractButton::set_checked()Andreas Kling
If a button is orphaned, there are no siblings anyway, so there's no need to try to update them.
2020-10-30LibGUI: Add Widget focus policiesAndreas Kling
Every widget now has a GUI::FocusPolicy that determines how it can receive focus: - NoFocus: The widget is not focusable (default) - TabFocus: The widget can be focused using the tab key. - ClickFocus: The widget can be focused by clicking on it. - StrongFocus: Both of the above. For widgets that have a focus proxy, getting/setting the focus policy will affect the proxy instead.
2020-10-26LibGUI: Allow activating a focused button by pressing the space key :^)Andreas Kling
This applies to normal push buttons, checkboxes, and radio buttons. It feels very natural. Even moreso than activating with return..
2020-10-26LibGUI+LibGfx: Improve focus rect appearanceAndreas Kling
Draw a dotted focus rect to make it stand out more. Also make it much larger on regular text-only GUI::Buttons.
2020-10-08LibGUI: Set initial AbstractButton background/foreground color rolesAndreas Kling
Widgets should respect the background/foreground roles in a way that makes sense for the widget.
2020-09-15LibCore: Make Core::Object properties more dynamicAndreas Kling
Instead of everyone overriding save_to() and set_property() and doing a pretty asymmetric job of implementing the various properties, let's add a bit of structure here. Object properties are now represented by a Core::Property. Properties are registered with a getter and setter (optional) in constructors. I've added some convenience macros for creating and registering properties, but this does still feel a bit bulky. We'll have to iterate on this and see where it goes.
2020-06-10LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSizeAndreas Kling
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much better visual clue about what type of metric is being used.
2020-05-19LibGUI: Remove some ancient unused debug logging in AbstractButtonAndreas Kling
2020-05-12LibGUI: Include keyboard modifier state with button on_click callsAndreas Kling
This will allow you us to implement special behavior when Ctrl+clicking a button.
2020-04-29LibGUI: Remove unnecessary is_enabled() checks in mouse event handlersAndreas Kling
We never deliver mouse events to disabled widgets, so there's no need to check is_enabled() in these event handlers.
2020-03-05LibGUI: Implement set_property() on Widget and AbstractButtonAndreas Kling
This makes it possible for an RPC client to modify some interesting widget properties.
2020-03-03LibGUI: Save some more state from AbstractButtonAndreas Kling
The more stuff we save in save_to() overrides, the more interesting it becomes inspecting GUI programs. :^)
2020-02-23LibGUI: Remove parent parameter to GUI::Widget constructorAndreas Kling
2020-02-23LibGUI: Use Core::Object::add() a whole bunchAndreas Kling
2020-02-20LibGfx+LibGUI: Allow theming the focus outline of AbstractButtonTibor Nagy
2020-02-16LibGUI: Add forwarding headerAndreas Kling
This patch adds <LibGUI/Forward.h> and uses it a bunch. It also dragged various header dependency reduction changes into it.
2020-02-06LibGUI: Remove leading G from filenamesAndreas Kling