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:
parent
1a641f9af7
commit
4c84e64b2a
Notes:
sideshowbarker
2024-07-17 10:19:40 +09:00
Author: https://github.com/frhun Commit: https://github.com/SerenityOS/serenity/commit/4c84e64b2a Pull-request: https://github.com/SerenityOS/serenity/pull/14254 Reviewed-by: https://github.com/linusg
3 changed files with 14 additions and 0 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <LibGfx/StylePainter.h>
|
||||
|
||||
REGISTER_WIDGET(GUI, Button)
|
||||
REGISTER_WIDGET(GUI, DialogButton)
|
||||
|
||||
namespace GUI {
|
||||
|
||||
|
|
|
@ -76,4 +76,16 @@ private:
|
|||
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);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ class CheckBox;
|
|||
class ComboBox;
|
||||
class Command;
|
||||
class CommandPalette;
|
||||
class DialogButton;
|
||||
class DragEvent;
|
||||
class DropEvent;
|
||||
class EditingEngine;
|
||||
|
|
Loading…
Add table
Reference in a new issue