mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
LibGUI: Move ColorPicker's helper classes fully into ColorPicker.cpp
Since these are not used by the outside world, no need to expose them.
This commit is contained in:
parent
8399b7bc11
commit
9430918026
2 changed files with 57 additions and 58 deletions
|
@ -31,52 +31,8 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
|
||||
class ColorButton : public AbstractButton {
|
||||
C_OBJECT(ColorButton)
|
||||
|
||||
public:
|
||||
explicit ColorButton(Color color = {});
|
||||
virtual ~ColorButton() override;
|
||||
|
||||
void set_selected(bool selected);
|
||||
Color color() const { return m_color; }
|
||||
|
||||
Function<void(const Color)> on_click;
|
||||
|
||||
protected:
|
||||
virtual void click() override;
|
||||
virtual void paint_event(PaintEvent&) override;
|
||||
|
||||
private:
|
||||
Color m_color;
|
||||
bool m_selected;
|
||||
};
|
||||
|
||||
|
||||
class CustomColor final : public GUI::Widget {
|
||||
C_OBJECT(CustomColor);
|
||||
|
||||
public:
|
||||
CustomColor();
|
||||
|
||||
Function<void(Color)> on_pick;
|
||||
void clear_last_position();
|
||||
|
||||
private:
|
||||
RefPtr<Gfx::Bitmap> m_custom_colors;
|
||||
bool m_status = false;
|
||||
Gfx::Point m_last_position;
|
||||
|
||||
void fire_event(GUI::MouseEvent& event);
|
||||
|
||||
virtual void mousedown_event(GUI::MouseEvent&) override;
|
||||
virtual void mouseup_event(GUI::MouseEvent&) override;
|
||||
virtual void mousemove_event(GUI::MouseEvent&) override;
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
virtual void resize_event(ResizeEvent&) override;
|
||||
};
|
||||
|
||||
class ColorButton;
|
||||
class CustomColorWidget;
|
||||
|
||||
class ColorPicker final : public Dialog {
|
||||
C_OBJECT(ColorPicker)
|
||||
|
@ -98,8 +54,7 @@ private:
|
|||
Color m_color;
|
||||
|
||||
Vector<ColorButton*> m_color_widgets;
|
||||
RefPtr<Widget> m_manin_container;
|
||||
RefPtr<CustomColor> m_custom_color;
|
||||
RefPtr<CustomColorWidget> m_custom_color;
|
||||
RefPtr<Frame> m_preview_widget;
|
||||
RefPtr<TextBox> m_html_text;
|
||||
RefPtr<SpinBox> m_red_spinbox;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue