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
Notes: sideshowbarker 2024-07-17 10:19:40 +09:00
3 changed files with 14 additions and 0 deletions

View File

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

View File

@ -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);
}
};
}

View File

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