mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +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 alias="nocloud.svg">icons/nocloud.svg</file>
|
||||||
<file>SsrfSwitch.qml</file>
|
<file>SsrfSwitch.qml</file>
|
||||||
<file>SsrfCheckBox.qml</file>
|
<file>SsrfCheckBox.qml</file>
|
||||||
|
<file>SsrfButton.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>qtquickcontrols2.conf</file>
|
<file>qtquickcontrols2.conf</file>
|
||||||
|
|
Loading…
Add table
Reference in a new issue