From a37d02844398697db1552c30162983f2da31ca09 Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Tue, 29 Aug 2023 13:32:17 +0300 Subject: [PATCH] QmlDesigner: Add an optional close button to the Section Change-Id: Ia74fc19a10a40290626c20e57150c444d394523d Reviewed-by: Miikka Heikkinen Reviewed-by: Qt CI Patch Build Bot Reviewed-by: Reviewed-by: Thomas Hartmann --- .../imports/HelperWidgets/Section.qml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml index 1cee92847fc..dd7b750ffaa 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml @@ -18,6 +18,8 @@ Item { property alias showTopSeparator: topSeparator.visible property alias showArrow: arrow.visible property alias showLeftBorder: leftBorder.visible + property alias showCloseButton: closeButton.visible + property alias closeButtonToolTip: closeButton.tooltip property alias spacing: column.spacing property int leftPadding: StudioTheme.Values.sectionLeftPadding @@ -79,6 +81,7 @@ Item { signal toggleExpand() signal expand() signal collapse() + signal closeButtonClicked() DropArea { id: dropArea @@ -157,6 +160,20 @@ Item { } } } + + IconButton { + id: closeButton + + icon: StudioTheme.Constants.close_small + buttonSize: 22 + iconScale: containsMouse ? 1.2 : 1 + transparentBg: true + anchors.right: parent.right + anchors.rightMargin: 10 + visible: false + + onClicked: root.closeButtonClicked() + } } Rectangle {