From 5453c539b50cfbea817a0b3979b86731bd6c394f Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Wed, 8 Dec 2021 14:29:51 +0200 Subject: [PATCH] QmlDesigner: Remove flexible width from Component Library items ...so that resizing the view doesn't cause sluggish animation to the items. Also removed an unnecessary top padding from the horizontal lib to avoid a slight vertical jump when switching between the 2 layouts. Change-Id: I0af75db885398dc93fc234d760156a55042f59d0 Reviewed-by: Miikka Heikkinen Reviewed-by: Samuel Ghinet Reviewed-by: Thomas Hartmann Reviewed-by: --- .../qmldesigner/itemLibraryQmlSources/ItemsView.qml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml index 034d460d8fd..f37a0e05d01 100644 --- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml +++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml @@ -266,8 +266,7 @@ Item { Grid { id: itemGrid - property real actualWidth: parent.width - itemGrid.leftPadding -itemGrid.rightPadding - property int flexibleWidth: (itemGrid.actualWidth / columns) - styleConstants.cellWidth + property real actualWidth: parent.width - itemGrid.leftPadding - itemGrid.rightPadding leftPadding: 6 rightPadding: 6 @@ -280,7 +279,7 @@ Item { visible: itemVisible textColor: importUnimported ? StudioTheme.Values.themeUnimportedModuleColor : StudioTheme.Values.themeTextColor - width: styleConstants.cellWidth + itemGrid.flexibleWidth + width: styleConstants.cellWidth height: styleConstants.cellHeight onShowContextMenu: { if (!itemUsable) { @@ -304,7 +303,7 @@ Item { id: horizontalView Row { - padding: 5 + leftPadding: 5 ScrollView { id: horizontalScrollView @@ -421,7 +420,6 @@ Item { Grid { id: hItemGrid property real actualWidth: itemsView.width - 294 - property int flexibleWidth: (hItemGrid.actualWidth / hItemGrid.columns) - styleConstants.cellWidth leftPadding: 9 rightPadding: 9 @@ -435,7 +433,7 @@ Item { visible: itemVisible textColor: itemLibraryModel.importUnimportedSelected ? StudioTheme.Values.themeUnimportedModuleColor : StudioTheme.Values.themeTextColor - width: styleConstants.cellWidth + hItemGrid.flexibleWidth + width: styleConstants.cellWidth height: styleConstants.cellHeight onShowContextMenu: { if (!itemUsable) {