aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/tracing/qml/ImageToolButton.qml
blob: 2d0231494bc270dacc45db64c9175877e477de57 (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
30
31
32
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

import QtQuick
import QtQuick.Controls

import QtCreator.Tracing

ToolButton {
    implicitWidth: 30

    property string imageSource

    ToolTip.visible: enabled && hovered
    ToolTip.delay: 1000

    Image {
        source: parent.enabled ? parent.imageSource : parent.imageSource + "/disabled"
        width: 16
        height: 16
        anchors.centerIn: parent
        smooth: false
    }

    background: Rectangle {
        color: (parent.checked || parent.pressed)
               ? Theme.color(Theme.FancyToolButtonSelectedColor)
               : parent.hovered
                 ? Theme.color(Theme.FancyToolButtonHoverColor)
                 : "#00000000"
    }
}