mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibGUI: Save some more state from AbstractButton
The more stuff we save in save_to() overrides, the more interesting it becomes inspecting GUI programs. :^)
This commit is contained in:
parent
86812af077
commit
0cafbbf09c
Notes:
sideshowbarker
2024-07-19 08:54:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/0cafbbf09c3
2 changed files with 12 additions and 0 deletions
|
@ -24,6 +24,7 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <AK/JsonObject.h>
|
||||
#include <LibCore/Timer.h>
|
||||
#include <LibGUI/AbstractButton.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
|
@ -196,4 +197,13 @@ void AbstractButton::change_event(Event& event)
|
|||
Widget::change_event(event);
|
||||
}
|
||||
|
||||
void AbstractButton::save_to(JsonObject& json)
|
||||
{
|
||||
json.set("text", m_text);
|
||||
json.set("checked", m_checked);
|
||||
json.set("checkable", m_checkable);
|
||||
json.set("exclusive", m_exclusive);
|
||||
Widget::save_to(json);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -70,6 +70,8 @@ protected:
|
|||
virtual void leave_event(Core::Event&) override;
|
||||
virtual void change_event(Event&) override;
|
||||
|
||||
virtual void save_to(JsonObject&) override;
|
||||
|
||||
void paint_text(Painter&, const Gfx::Rect&, const Gfx::Font&, Gfx::TextAlignment);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Reference in a new issue