summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2020-01-10 18:46:28 +0300
committerAndreas Kling <awesomekling@gmail.com>2020-01-10 17:45:59 +0100
commit303fa75d365ecaa131f6d55c0c9e0f4062382c8a (patch)
tree3977da552fe1cb065bdd6fc36c3f8bb5ad912026 /Libraries
parentde69f84868bb18c63be23f1187bb470826a10d19 (diff)
downloadserenity-303fa75d365ecaa131f6d55c0c9e0f4062382c8a.zip
LibGUI: Fix tree view column positioning when some columns are hidden
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/GTreeView.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Libraries/LibGUI/GTreeView.cpp b/Libraries/LibGUI/GTreeView.cpp
index 0310509dc5..f358916683 100644
--- a/Libraries/LibGUI/GTreeView.cpp
+++ b/Libraries/LibGUI/GTreeView.cpp
@@ -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();