mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05: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
3 changed files with 3 additions and 8 deletions
|
@ -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…
Add table
Reference in a new issue