- added new delegate types which match the look and feel of the app much better than the old ones
This commit is contained in:
parent
cf085b54e8
commit
70d413df82
3 changed files with 66 additions and 1 deletions
30
qml/components/SmoothItemDelegate.qml
Normal file
30
qml/components/SmoothItemDelegate.qml
Normal file
|
@ -0,0 +1,30 @@
|
|||
import QtQuick 2.0
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
ItemDelegate {
|
||||
id: control
|
||||
text: ""
|
||||
font.pixelSize: options_stack.text_pixelSize
|
||||
property color textColor: appTheme.style.textColor
|
||||
|
||||
contentItem: Text {
|
||||
text: parent.text
|
||||
color: control.textColor
|
||||
font.pixelSize: parent.font.pixelSize
|
||||
}
|
||||
|
||||
width: parent.width
|
||||
|
||||
background: Rectangle {
|
||||
opacity: enabled ? 1 : 0.3
|
||||
color: control.down ? appTheme.style.delegatePressedColor : appTheme.style.delegateBackgroundColor
|
||||
|
||||
radius: height * 0.3
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
34
qml/components/SmoothSwitchDelegate.qml
Normal file
34
qml/components/SmoothSwitchDelegate.qml
Normal file
|
@ -0,0 +1,34 @@
|
|||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
SwitchDelegate {
|
||||
id: control
|
||||
text: qsTr("dark mode")
|
||||
|
||||
contentItem: Text {
|
||||
text: parent.text
|
||||
color: appTheme.style.textColor
|
||||
font.pixelSize: options_stack.text_pixelSize
|
||||
}
|
||||
|
||||
|
||||
width: parent.width
|
||||
height: parent.delegateHeight
|
||||
|
||||
font.pixelSize: options_stack.text_pixelSize
|
||||
|
||||
indicator: SimpleIndicator{}
|
||||
|
||||
background: Rectangle {
|
||||
opacity: enabled ? 1 : 0.3
|
||||
color: control.down ? appTheme.style.delegatePressedColor : appTheme.style.delegateBackgroundColor
|
||||
|
||||
radius: height * 0.3
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 200
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,9 +8,10 @@
|
|||
<file>components/ConnectionDelegate.qml</file>
|
||||
<file>components/FadeAnimation.qml</file>
|
||||
<file>components/ConnectionIcon.qml</file>
|
||||
<file>SpeedTimer.qml</file>
|
||||
<file>components/NextPageDelegate.qml</file>
|
||||
<file>ErrorDialog.qml</file>
|
||||
<file>components/FancyButton.qml</file>
|
||||
<file>components/SmoothItemDelegate.qml</file>
|
||||
<file>components/SmoothSwitchDelegate.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Reference in a new issue