mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
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:
parent
ae33422ede
commit
4bcbe8e3a0
2 changed files with 21 additions and 0 deletions
20
mobile-widgets/qml/SsrfButton.qml
Normal file
20
mobile-widgets/qml/SsrfButton.qml
Normal 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
|
||||
}
|
||||
}
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue