Update UI

This commit is contained in:
kateleet 2021-12-16 23:26:56 +08:00
parent 7551ff92b9
commit 2dc6ba4612
2 changed files with 37 additions and 18 deletions

View file

@ -32,9 +32,19 @@ Item {
signal itemClicked(string path)
signal editorAccepted(string path)
Rectangle {
anchors.fill: parent
color: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.secondBackgroundColor, 1.3)
: FishUI.Theme.secondBackgroundColor
radius: FishUI.Theme.smallRadius
z: -1
}
ListView {
id: _pathView
anchors.fill: parent
anchors.topMargin: 2
anchors.bottomMargin: 2
model: _pathBarModel
orientation: Qt.Horizontal
layoutDirection: Qt.LeftToRight
@ -49,14 +59,6 @@ Item {
_pathView.positionViewAtEnd()
}
Rectangle {
anchors.fill: parent
color: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.secondBackgroundColor, 1.3)
: FishUI.Theme.secondBackgroundColor
radius: FishUI.Theme.smallRadius
z: -1
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton
@ -64,10 +66,19 @@ Item {
z: -1
}
highlight: Rectangle {
radius: FishUI.Theme.mediumRadius
color: Qt.rgba(FishUI.Theme.textColor.r,
FishUI.Theme.textColor.g,
FishUI.Theme.textColor.b, 0.1)
smooth: true
}
delegate: MouseArea {
id: _item
height: ListView.view.height
height: ListView.view.height - ListView.view.topMargin - ListView.view.bottomMargin
width: _name.width + FishUI.Units.largeSpacing
hoverEnabled: true
z: -1
property bool selected: index === _pathView.count - 1
@ -76,17 +87,22 @@ Item {
Rectangle {
anchors.fill: parent
anchors.topMargin: 2
anchors.bottomMargin: 2
color: FishUI.Theme.highlightColor
radius: FishUI.Theme.smallRadius
visible: selected
radius: FishUI.Theme.mediumRadius
color: _item.pressed ? Qt.rgba(FishUI.Theme.textColor.r,
FishUI.Theme.textColor.g,
FishUI.Theme.textColor.b, FishUI.Theme.darkMode ? 0.05 : 0.1) :
_item.containsMouse ? Qt.rgba(FishUI.Theme.textColor.r,
FishUI.Theme.textColor.g,
FishUI.Theme.textColor.b, FishUI.Theme.darkMode ? 0.1 : 0.05) :
"transparent"
smooth: true
}
Label {
id: _name
text: model.name
color: selected ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor
color: FishUI.Theme.textColor
anchors.centerIn: parent
}
}

View file

@ -58,7 +58,10 @@ ListView {
highlight: Rectangle {
radius: FishUI.Theme.mediumRadius
color: FishUI.Theme.highlightColor
color: Qt.rgba(FishUI.Theme.textColor.r,
FishUI.Theme.textColor.g,
FishUI.Theme.textColor.b, 0.1)
smooth: true
}
section.property: "category"
@ -182,7 +185,7 @@ ListView {
width: height
sourceSize: Qt.size(22, 22)
// source: "image://icontheme/" + model.iconName
source: "qrc:/images/" + (FishUI.Theme.darkMode || _item.checked ? "dark/" : "light/") + model.iconPath
source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark/" : "light/") + model.iconPath
Layout.alignment: Qt.AlignVCenter
smooth: false
antialiasing: true
@ -191,7 +194,7 @@ ListView {
Label {
id: _label
text: model.name
color: checked ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor
color: FishUI.Theme.textColor
elide: Text.ElideRight
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter