aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/fusion/SplitView.qml
blob: e3a07ae05b650d4ab1b0dae73477648af5bafc2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default

import QtQuick
import QtQuick.Templates as T
import QtQuick.Controls.impl
import QtQuick.Controls.Fusion

T.SplitView {
    id: control
    implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
                            implicitContentWidth + leftPadding + rightPadding)
    implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
                             implicitContentHeight + topPadding + bottomPadding)

    handle: Rectangle {
        implicitWidth: control.orientation === Qt.Horizontal ? 2 : control.width
        implicitHeight: control.orientation === Qt.Horizontal ? control.height : 2
        color: {
            if (Fusion.highContrast)
                return T.SplitHandle.pressed ? Fusion.highlightedOutline(control.palette)
                                             : (enabled && T.SplitHandle.hovered ? control.palette.button : Fusion.outline(control.palette));
            else
                return T.SplitHandle.pressed ? control.palette.dark
                                             : (enabled && T.SplitHandle.hovered ? control.palette.midlight : control.palette.mid)
        }
    }
}