mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 04:55:15 +00:00
LibGUI: Fix tree view column positioning when some columns are hidden
This commit is contained in:
parent
de69f84868
commit
303fa75d36
Notes:
sideshowbarker
2024-07-19 10:13:46 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/303fa75d365 Pull-request: https://github.com/SerenityOS/serenity/pull/1050
1 changed files with 4 additions and 2 deletions
|
@ -100,7 +100,8 @@ void GTreeView::traverse_in_paint_order(Callback callback) const
|
|||
int tree_column_x_offset = 0;
|
||||
|
||||
for (int i = 0; i < tree_column; ++i) {
|
||||
tree_column_x_offset += column_width(i);
|
||||
if (!is_column_hidden(i))
|
||||
tree_column_x_offset += column_width(i);
|
||||
}
|
||||
|
||||
Function<IterationDecision(const GModelIndex&)> traverse_index = [&](const GModelIndex& index) {
|
||||
|
@ -162,7 +163,8 @@ void GTreeView::paint_event(GPaintEvent& event)
|
|||
int tree_column = model.tree_column();
|
||||
int tree_column_x_offset = 0;
|
||||
for (int i = 0; i < tree_column; ++i) {
|
||||
tree_column_x_offset += column_width(i);
|
||||
if (!is_column_hidden(i))
|
||||
tree_column_x_offset += column_width(i);
|
||||
}
|
||||
int y_offset = header_height();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue