mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-08 12:19:37 +03:00
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.
This commit is contained in:
parent
b2203e6417
commit
8b60305698
Notes:
sideshowbarker
2024-07-17 07:32:32 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/8b60305698 Pull-request: https://github.com/SerenityOS/serenity/pull/14895 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/MacDue Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/trflynn89
@ -16,11 +16,6 @@ REGISTER_WIDGET(PixelPaint, HistogramWidget);
|
||||
|
||||
namespace PixelPaint {
|
||||
|
||||
HistogramWidget::HistogramWidget()
|
||||
{
|
||||
set_height(65);
|
||||
}
|
||||
|
||||
HistogramWidget::~HistogramWidget()
|
||||
{
|
||||
if (m_image)
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
void set_color_at_mouseposition(Color);
|
||||
|
||||
private:
|
||||
HistogramWidget();
|
||||
HistogramWidget() = default;
|
||||
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user