mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +00:00
PixelPaint: Extract common scope code into a generic ScopeWidget
When we add more scopes, this will facilitate code sharing.
This commit is contained in:
parent
8b60305698
commit
fe88fd22fa
5 changed files with 86 additions and 45 deletions
|
@ -7,21 +7,17 @@
|
|||
#pragma once
|
||||
|
||||
#include "Image.h"
|
||||
#include <LibGUI/AbstractScrollableWidget.h>
|
||||
#include "ScopeWidget.h"
|
||||
|
||||
namespace PixelPaint {
|
||||
|
||||
class HistogramWidget final
|
||||
: public GUI::Frame
|
||||
, ImageClient {
|
||||
: public ScopeWidget {
|
||||
C_OBJECT(HistogramWidget);
|
||||
|
||||
public:
|
||||
virtual ~HistogramWidget() override;
|
||||
|
||||
void set_image(Image*);
|
||||
void image_changed();
|
||||
void set_color_at_mouseposition(Color);
|
||||
virtual ~HistogramWidget() = default;
|
||||
virtual void image_changed() override;
|
||||
|
||||
private:
|
||||
HistogramWidget() = default;
|
||||
|
@ -29,9 +25,6 @@ private:
|
|||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
|
||||
ErrorOr<void> rebuild_histogram_data();
|
||||
int m_widget_height = 0;
|
||||
Color m_color_at_mouseposition = Color::Transparent;
|
||||
RefPtr<Image> m_image;
|
||||
|
||||
struct HistogramData {
|
||||
Vector<int> red;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue