diff options
author | kleines Filmröllchen <filmroellchen@serenityos.org> | 2022-08-28 16:26:23 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-09-03 16:57:37 +0100 |
commit | 8b60305698f1d2fbd7083a9b370ea9af06133f68 (patch) | |
tree | a6f404c657681ca63f3824fcb8ca0a122563ebb7 | |
parent | b2203e6417bc0ceb5cd66f53dbf9772693bf9412 (diff) | |
download | serenity-8b60305698f1d2fbd7083a9b370ea9af06133f68.zip |
PixelPaint: Specify histogram height in GML
The histogram is perfectly fine with being drawn at any size, but the
code currently fixes its height to 65. Once the histogram is in a
subclass and several GML things around it change, the fixed height
breaks, so we move the height specification to GML. Additionally, the
container is specified to shrink as much as possible, alleviating a
hard-coded UI size. The user can now change histogram height in GML,
which is a lot more obvious.
-rw-r--r-- | Userland/Applications/PixelPaint/HistogramWidget.cpp | 5 | ||||
-rw-r--r-- | Userland/Applications/PixelPaint/HistogramWidget.h | 2 | ||||
-rw-r--r-- | Userland/Applications/PixelPaint/PixelPaintWindow.gml | 4 |
3 files changed, 3 insertions, 8 deletions
diff --git a/Userland/Applications/PixelPaint/HistogramWidget.cpp b/Userland/Applications/PixelPaint/HistogramWidget.cpp index d8003a3482..6a9e7de66b 100644 --- a/Userland/Applications/PixelPaint/HistogramWidget.cpp +++ b/Userland/Applications/PixelPaint/HistogramWidget.cpp @@ -16,11 +16,6 @@ REGISTER_WIDGET(PixelPaint, HistogramWidget); namespace PixelPaint { -HistogramWidget::HistogramWidget() -{ - set_height(65); -} - HistogramWidget::~HistogramWidget() { if (m_image) diff --git a/Userland/Applications/PixelPaint/HistogramWidget.h b/Userland/Applications/PixelPaint/HistogramWidget.h index 72d0c1cff5..c50ff90d4f 100644 --- a/Userland/Applications/PixelPaint/HistogramWidget.h +++ b/Userland/Applications/PixelPaint/HistogramWidget.h @@ -24,7 +24,7 @@ public: void set_color_at_mouseposition(Color); private: - HistogramWidget(); + HistogramWidget() = default; virtual void paint_event(GUI::PaintEvent&) override; diff --git a/Userland/Applications/PixelPaint/PixelPaintWindow.gml b/Userland/Applications/PixelPaint/PixelPaintWindow.gml index 30e017f4b1..c4a641899d 100644 --- a/Userland/Applications/PixelPaint/PixelPaintWindow.gml +++ b/Userland/Applications/PixelPaint/PixelPaintWindow.gml @@ -66,14 +66,14 @@ @GUI::GroupBox { title: "Histogram" - max_height: 90 + preferred_height: "shrink" layout: @GUI::VerticalBoxLayout { margins: [6] } @PixelPaint::HistogramWidget { name: "histogram_widget" - max_height: 65 + min_height: 65 } } |