QmlDesigner: Cleanup HelperWidgets ScrollBars

Change-Id: Ifc49b0a8c629cb6ed65851a782fe1280079b4a5e
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Fabian Kosmale
2023-04-18 10:44:44 +02:00
committed by Henning Gründl
parent a6a8a094c5
commit 04ebd7b9c3
2 changed files with 8 additions and 9 deletions

View File

@@ -1,9 +1,9 @@
// Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick 2.15 import QtQuick
import QtQuick.Controls.Basic 2.15 import QtQuick.Controls.Basic
import StudioTheme 1.0 as StudioTheme import StudioTheme as StudioTheme
ScrollBar { ScrollBar {
id: scrollBar id: scrollBar
@@ -13,9 +13,10 @@ ScrollBar {
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding) implicitContentHeight + topPadding + bottomPadding)
property bool scrollBarVisible: parent.childrenRect.width > parent.width property bool scrollBarVisible: parent.childrenRect.width > parent.width
minimumSize: orientation == Qt.Horizontal ? height / width : width / height
orientation: Qt.Horizontal orientation: Qt.Horizontal
policy: scrollBar.scrollBarVisible ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff policy: scrollBar.scrollBarVisible ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
x: 0 x: 0
@@ -24,8 +25,6 @@ ScrollBar {
- (parent.bothVisible ? parent.verticalThickness : 0) - (parent.bothVisible ? parent.verticalThickness : 0)
padding: 0 padding: 0
minimumSize: orientation == Qt.Horizontal ? height / width : width / height
background: Rectangle { background: Rectangle {
color: StudioTheme.Values.themeScrollBarTrack color: StudioTheme.Values.themeScrollBarTrack
} }

View File

@@ -1,9 +1,9 @@
// Copyright (C) 2020 The Qt Company Ltd. // Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
import QtQuick 2.15 import QtQuick
import QtQuick.Controls.Basic 2.15 import QtQuick.Controls.Basic
import StudioTheme 1.0 as StudioTheme import StudioTheme as StudioTheme
ScrollBar { ScrollBar {
id: scrollBar id: scrollBar