QML UI: add our own styled button

Add out own styled button as resource.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
Joakim Bygdell 2017-07-24 21:29:30 +02:00 committed by Dirk Hohndel
parent ae33422ede
commit 4bcbe8e3a0
2 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,20 @@
// SPDX-License-Identifier: GPL-2.0
import QtQuick 2.3
import QtQuick.Controls 2.2
import org.kde.kirigami 2.0 as Kirigami
Button {
id: root
background: Rectangle {
id: buttonBackground
color: root.enabled? (root.pressed ? subsurfaceTheme.darkerPrimaryColor : subsurfaceTheme.primaryColor) : "gray"
antialiasing: true
radius: Kirigami.Units.smallSpacing * 2
height: buttonText.height * 2
}
contentItem: Text {
text: root.text
anchors.centerIn: buttonBackground
color: root.pressed ? subsurfaceTheme.darkerPrimaryTextColor :subsurfaceTheme.primaryTextColor
}
}

View file

@ -24,6 +24,7 @@
<file alias="nocloud.svg">icons/nocloud.svg</file>
<file>SsrfSwitch.qml</file>
<file>SsrfCheckBox.qml</file>
<file>SsrfButton.qml</file>
</qresource>
<qresource prefix="/">
<file>qtquickcontrols2.conf</file>