1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

LibGUI: Add DialogButton convenience class

DialogButton is a small convenience class, that just gives a button to
be used in dialogs for a more consistent look around the system.
This commit is contained in:
FrHun 2022-06-10 22:58:25 +02:00 committed by Linus Groh
parent 1a641f9af7
commit 4c84e64b2a
3 changed files with 14 additions and 0 deletions

View file

@ -16,6 +16,7 @@
#include <LibGfx/StylePainter.h> #include <LibGfx/StylePainter.h>
REGISTER_WIDGET(GUI, Button) REGISTER_WIDGET(GUI, Button)
REGISTER_WIDGET(GUI, DialogButton)
namespace GUI { namespace GUI {

View file

@ -76,4 +76,16 @@ private:
bool m_mimic_pressed { false }; bool m_mimic_pressed { false };
}; };
class DialogButton final : public Button {
C_OBJECT(DialogButton);
public:
virtual ~DialogButton() override {};
explicit DialogButton(String text = {})
: Button(move(text))
{
set_fixed_width(80);
}
};
} }

View file

@ -23,6 +23,7 @@ class CheckBox;
class ComboBox; class ComboBox;
class Command; class Command;
class CommandPalette; class CommandPalette;
class DialogButton;
class DragEvent; class DragEvent;
class DropEvent; class DropEvent;
class EditingEngine; class EditingEngine;