From 303fa75d365ecaa131f6d55c0c9e0f4062382c8a Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Fri, 10 Jan 2020 18:46:28 +0300 Subject: LibGUI: Fix tree view column positioning when some columns are hidden --- Libraries/LibGUI/GTreeView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Libraries') 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 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(); -- cgit v1.2.3