mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 09:36:08 +00:00
LibGUI: Add DynamicWidgetContainter
Add a new widget "DynamicWidgetContainer" that is used to group it's child widgets within an collapsable and detachable container. The DynmnicWidgetContainer is able to persist it's view state if a config domain has been provided. Having that set will allow the widget to restore it's view state automatically.
This commit is contained in:
parent
38974b4128
commit
b65e711929
Notes:
sideshowbarker
2024-07-17 01:11:48 +09:00
Author: https://github.com/Torstennator
Commit: b65e711929
Pull-request: https://github.com/SerenityOS/serenity/pull/21511
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/cubiclove
Reviewed-by: https://github.com/kleinesfilmroellchen
10 changed files with 777 additions and 0 deletions
29
Userland/Libraries/LibGUI/LabelWithEventDispatcher.h
Normal file
29
Userland/Libraries/LibGUI/LabelWithEventDispatcher.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Torsten Engelmann <engelTorsten@gmx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGUI/Frame.h>
|
||||
#include <LibGUI/Label.h>
|
||||
#include <LibGUI/Window.h>
|
||||
|
||||
namespace GUI {
|
||||
class LabelWithEventDispatcher : public GUI::Label {
|
||||
C_OBJECT(LabelWithEventDispatcher);
|
||||
|
||||
public:
|
||||
void update_cursor(Gfx::StandardCursor);
|
||||
Function<void(MouseEvent&)> on_double_click;
|
||||
Function<void(MouseEvent&)> on_mouseup_event;
|
||||
Function<void(MouseEvent&)> on_mousemove_event;
|
||||
virtual ~LabelWithEventDispatcher() override = default;
|
||||
|
||||
protected:
|
||||
void doubleclick_event(MouseEvent&) override;
|
||||
virtual void mouseup_event(MouseEvent&) override;
|
||||
virtual void mousemove_event(MouseEvent&) override;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue