mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:07:46 +00:00
LibGUI: Replace a magic number with ColumnsView::column_separator_width
This commit is contained in:
parent
7919fb8cae
commit
3b18858bb1
2 changed files with 4 additions and 3 deletions
|
@ -184,7 +184,7 @@ void ColumnsView::paint_event(PaintEvent& event)
|
||||||
if (height() > separator_height)
|
if (height() > separator_height)
|
||||||
separator_height = height();
|
separator_height = height();
|
||||||
painter.draw_line({ column_x + column.width, 0 }, { column_x + column.width, separator_height }, palette().button());
|
painter.draw_line({ column_x + column.width, 0 }, { column_x + column.width, separator_height }, palette().button());
|
||||||
column_x += column.width + 1;
|
column_x += column.width + column_separator_width();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ void ColumnsView::update_column_sizes()
|
||||||
if (row_width > column.width)
|
if (row_width > column.width)
|
||||||
column.width = row_width;
|
column.width = row_width;
|
||||||
}
|
}
|
||||||
total_width += column.width + 1;
|
total_width += column.width + column_separator_width();
|
||||||
}
|
}
|
||||||
|
|
||||||
set_content_size({ total_width, total_height });
|
set_content_size({ total_width, total_height });
|
||||||
|
@ -251,7 +251,7 @@ Optional<ColumnsView::Column> ColumnsView::column_at_event_position(Gfx::IntPoin
|
||||||
if (position.x() < column_x)
|
if (position.x() < column_x)
|
||||||
break;
|
break;
|
||||||
if (position.x() > column_x + column.width) {
|
if (position.x() > column_x + column.width) {
|
||||||
column_x += column.width;
|
column_x += column.width + column_separator_width();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ private:
|
||||||
int icon_size() const { return 16; }
|
int icon_size() const { return 16; }
|
||||||
int icon_spacing() const { return 2; }
|
int icon_spacing() const { return 2; }
|
||||||
int text_padding() const { return 2; }
|
int text_padding() const { return 2; }
|
||||||
|
int column_separator_width() const { return 1; }
|
||||||
|
|
||||||
virtual void model_did_update(unsigned flags) override;
|
virtual void model_did_update(unsigned flags) override;
|
||||||
virtual void second_paint_event(PaintEvent&) override;
|
virtual void second_paint_event(PaintEvent&) override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue