summaryrefslogtreecommitdiffstats
path: root/generic/ttk/ttkTreeview.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2019-05-09 09:12:58 (GMT)
committerfvogel <fvogelnew1@free.fr>2019-05-09 09:12:58 (GMT)
commita6d8b926167e1d1b3e68c57a10d5898ae4839af3 (patch)
tree92ff996d21996c94a748ad4eb737b8856027081c /generic/ttk/ttkTreeview.c
parenta0d58f325fba501fcb57d9d64592a668409e66fa (diff)
downloadtk-a6d8b926167e1d1b3e68c57a10d5898ae4839af3.zip
tk-a6d8b926167e1d1b3e68c57a10d5898ae4839af3.tar.gz
tk-a6d8b926167e1d1b3e68c57a10d5898ae4839af3.tar.bz2
Fix bug when dragging a column separator: when columns at the right of the separator are not stretchable, use their width instead of their minwidth to compute the maximum x drag position. This prevents the user from resizing columns such that the treeview would no longer fit in its allotted width.
Diffstat (limited to 'generic/ttk/ttkTreeview.c')
-rw-r--r--generic/ttk/ttkTreeview.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index f08ed38..5e52f01 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -2884,13 +2884,19 @@ static int TreeviewDragCommand(
/* The limit not to exceed at the right is given by the tree width
minus the sum of the min widths of the columns at the right of
the one being resized (and don't forget possible x scrolling!).
+ For stretchable columns, this min width really is the minWidth,
+ for non-stretchable columns, this is the column width.
*/
int newxRightLimit = tv->tree.treeArea.x - tv->tree.xscroll.first
+ tv->tree.treeArea.width;
int j = i + 1;
while (j < tv->tree.nDisplayColumns) {
TreeColumn *cr = tv->tree.displayColumns[j];
- newxRightLimit -= cr->minWidth;
+ if (cr->stretch) {
+ newxRightLimit -= cr->minWidth;
+ } else {
+ newxRightLimit -= cr->width;
+ }
++j;
}
if (newx <= newxRightLimit) {