From ad08c6cb20cf2ec0fd974fb4a3d7119fdff63cd1 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Wed, 7 Aug 2013 20:27:12 -0400 Subject: [PATCH] ecere/gui/ListBox: (#958) Fixed Global Settings Resizing edit box lagging behind --- ecere/src/gui/controls/ListBox.ec | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ecere/src/gui/controls/ListBox.ec b/ecere/src/gui/controls/ListBox.ec index e38d98a..7bffe24 100644 --- a/ecere/src/gui/controls/ListBox.ec +++ b/ecere/src/gui/controls/ListBox.ec @@ -2022,6 +2022,38 @@ private: } } + void RepositionFieldEditor() + { + if(editData && editData.visible) + { + int height = rowHeight - (style.alwaysEdit ? 1 : 0); + int x = 0; + int y = currentRow.index * rowHeight + (style.header ? rowHeight : 0); + int width; + DataField field; + + if(style.collapse && !(style.treeBranch)) + x += 15; + for(field = fields.first; field; field = field.next) + { + width = (!field.next && style.fillLastField && (!hasHorzScroll || clientSize.w - field.x > field.width + EXTRA_SPACE)) ? + clientSize.w - field.x : (field.width + EXTRA_SPACE); + if(field == currentField) break; + x += width; + } + if(!style.alwaysEdit) + { + editData.position = { x, y - editData.clientStart.y }; + editData.size = { width, height + editData.clientStart.y * 2 }; + } + else + { + editData.position = { x, y }; + editData.size = { width, height }; + } + } + } + void PopupEditBox(DataField whichField, bool repositionOnly) { if((!editData || !editData.visible || currentField != whichField) && currentRow) @@ -2682,6 +2714,8 @@ private: { HideEditBox(true, false, true); } + else if(editData && editData.visible) + RepositionFieldEditor(); } void AdaptToFieldWidth(DataField field, bool doScroll) -- 1.8.3.1