diff options
author | fvogel <fvogelnew1@free.fr> | 2019-10-27 11:03:04 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2019-10-27 11:03:04 (GMT) |
commit | bca8adc60104d63e7d58c2ba7b257378e83c3a10 (patch) | |
tree | 9bd2f826e5d8febd4b6ce10e2aac676c0cf56338 /generic | |
parent | 8939b39b95cc8320f202ec15a413c786ea692ff9 (diff) | |
download | tk-bca8adc60104d63e7d58c2ba7b257378e83c3a10.zip tk-bca8adc60104d63e7d58c2ba7b257378e83c3a10.tar.gz tk-bca8adc60104d63e7d58c2ba7b257378e83c3a10.tar.bz2 |
Backout [82b1d286] and [0e9cbdba] that fixed [cc6c711c1e] and [ce470f20fd] since they created issues reported in [caacf1f082]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/ttk/ttkTreeview.c | 53 |
1 files changed, 11 insertions, 42 deletions
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index fcd807c..492961d 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -282,7 +282,7 @@ static Tk_OptionSpec ColumnOptionSpecs[] = { 0,0,0 }, {TK_OPTION_BOOLEAN, "-stretch", "stretch", "Stretch", "1", -1, Tk_Offset(TreeColumn,stretch), - 0,0,GEOMETRY_CHANGED }, + 0,0,0 }, {TK_OPTION_ANCHOR, "-anchor", "anchor", "Anchor", "w", Tk_Offset(TreeColumn,anchorObj), -1, /* <<NOTE-ANCHOR>> */ 0,0,0 }, @@ -1232,13 +1232,13 @@ static int ConfigureColumn( if (mask & GEOMETRY_CHANGED) { if (!Tk_IsMapped(tv->core.tkwin)) { TtkResizeWidget(&tv->core); - } else { - RecomputeSlack(tv); - ResizeColumns(tv, TreeWidth(tv)); - } + } + RecomputeSlack(tv); } TtkRedisplayWidget(&tv->core); + /* ASSERT: SLACKINVARIANT */ + Tk_FreeSavedOptions(&savedOptions); return TCL_OK; @@ -1615,10 +1615,13 @@ static void TreeviewDoLayout(void *clientData) Treeview *tv = clientData; int visibleRows; + /* ASSERT: SLACKINVARIANT */ + Ttk_PlaceLayout(tv->core.layout,tv->core.state,Ttk_WinBox(tv->core.tkwin)); tv->tree.treeArea = Ttk_ClientRegion(tv->core.layout, "treearea"); ResizeColumns(tv, tv->tree.treeArea.width); + /* ASSERT: SLACKINVARIANT */ TtkScrolled(tv->tree.xscrollHandle, tv->tree.xscroll.first, @@ -2888,28 +2891,9 @@ static int TreeviewDragCommand( TreeColumn *c = tv->tree.displayColumns[i]; int right = left + c->width; if (c == column) { - /* 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]; - if (cr->stretch) { - newxRightLimit -= cr->minWidth; - } else { - newxRightLimit -= cr->width; - } - ++j; - } - if (newx <= newxRightLimit) { - DragColumn(tv, i, newx - right); - TtkRedisplayWidget(&tv->core); - } + DragColumn(tv, i, newx - right); + /* ASSERT: SLACKINVARIANT */ + TtkRedisplayWidget(&tv->core); return TCL_OK; } left = right; @@ -2921,20 +2905,6 @@ static int TreeviewDragCommand( return TCL_ERROR; } -static int TreeviewDropCommand( - void *recordPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) -{ - Treeview *tv = recordPtr; - - if (objc != 2) { - Tcl_WrongNumArgs(interp, 1, objv, "drop"); - return TCL_ERROR; - } - ResizeColumns(tv, TreeWidth(tv)); - TtkRedisplayWidget(&tv->core); - return TCL_OK; -} - /*------------------------------------------------------------------------ * +++ Widget commands -- focus and selection */ @@ -3284,7 +3254,6 @@ static const Ttk_Ensemble TreeviewCommands[] = { { "delete", TreeviewDeleteCommand,0 }, { "detach", TreeviewDetachCommand,0 }, { "drag", TreeviewDragCommand,0 }, - { "drop", TreeviewDropCommand,0 }, { "exists", TreeviewExistsCommand,0 }, { "focus", TreeviewFocusCommand,0 }, { "heading", TreeviewHeadingCommand,0 }, |