Added scrollbars for lists and text fields. Added saving to the path settings for configuration files and the current language. Various UI improvements
This commit is contained in:
@@ -53,7 +53,8 @@ ItemDelegate {
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: control.pressed ? Palette.pressedButtonColor :
|
||||
control.hovered ? Palette.hoveredButtonColor : Palette.buttonColor
|
||||
color: control.pressed || control.highlighted ?
|
||||
Palette.pressedButtonColor : control.hovered ?
|
||||
Palette.hoveredButtonColor : Palette.buttonColor
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,22 +5,36 @@ import Utils 1.0
|
||||
|
||||
ScrollBar {
|
||||
id: control
|
||||
size: 0.3
|
||||
position: 0.2
|
||||
active: true
|
||||
orientation: Qt.Vertical
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 2
|
||||
visible: control.policy !== ScrollBar.AlwaysOff
|
||||
minimumSize: orientation == Qt.Horizontal ? height / width : width / height
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: 12
|
||||
implicitHeight: 100
|
||||
radius: width / 2
|
||||
color: Palette.alternativeBackgroundColor
|
||||
// Hide the ScrollBar when it's not needed.
|
||||
opacity: control.policy === ScrollBar.AlwaysOn || (control.active && control.size < 1.0) ? 0.75 : 0
|
||||
implicitWidth: control.interactive ? 6 : 2
|
||||
implicitHeight: control.interactive ? 6 : 2
|
||||
|
||||
// Animate the changes in opacity (default duration is 250 ms).
|
||||
Behavior on opacity {
|
||||
NumberAnimation {}
|
||||
radius: width / 2
|
||||
color: control.pressed ? Palette.alternativeBackgroundColor : Qt.lighter(Palette.alternativeBackgroundColor, 1.1)
|
||||
opacity: 0.0
|
||||
|
||||
states: State {
|
||||
name: "active"
|
||||
when: control.policy === ScrollBar.AlwaysOn || (control.active && control.size < 1.0)
|
||||
PropertyChanges { target: control.contentItem; opacity: 0.75 }
|
||||
}
|
||||
|
||||
transitions: Transition {
|
||||
from: "active"
|
||||
SequentialAnimation {
|
||||
PauseAnimation { duration: 450 }
|
||||
NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
40
qml/Controls/ScrollIndicator.qml
Normal file
40
qml/Controls/ScrollIndicator.qml
Normal file
@@ -0,0 +1,40 @@
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
|
||||
import Utils 1.0
|
||||
|
||||
ScrollIndicator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 2
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: 2
|
||||
implicitHeight: 2
|
||||
|
||||
color: Palette.alternativeBackgroundColor
|
||||
visible: control.size < 1.0
|
||||
opacity: 0.0
|
||||
|
||||
states: State {
|
||||
name: "active"
|
||||
when: control.active
|
||||
PropertyChanges { target: control.contentItem; opacity: 0.75 }
|
||||
}
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "active"
|
||||
SequentialAnimation {
|
||||
PauseAnimation { duration: 450 }
|
||||
NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -22,3 +22,4 @@ DialogHeader 1.0 DialogHeader.qml
|
||||
DialogBackground 1.0 DialogBackground.qml
|
||||
BusyIndicator 1.0 BusyIndicator.qml
|
||||
MenuItemDelegate 1.0 MenuItemDelegate.qml
|
||||
ScrollIndicator 1.0 ScrollIndicator.qml
|
||||
|
||||
Reference in New Issue
Block a user