Fix icons display

This commit is contained in:
reionwong 2021-08-08 09:29:04 +08:00
parent 74b1a2efb4
commit 3c2c3b5051
6 changed files with 30 additions and 6 deletions

View file

@ -48,6 +48,7 @@ Item {
width: control.height * 0.64 width: control.height * 0.64
height: width height: width
sourceSize: Qt.size(width, height) sourceSize: Qt.size(width, height)
smooth: false
} }
MouseArea { MouseArea {

View file

@ -69,9 +69,9 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 200 Layout.preferredHeight: 200
model: ListModel {} model: ListModel {}
clip: true spacing: FishUI.Units.smallSpacing * 1.5
spacing: FishUI.Units.largeSpacing
ScrollBar.vertical: ScrollBar {} ScrollBar.vertical: ScrollBar {}
clip: true
Label { Label {
anchors.centerIn: parent anchors.centerIn: parent
@ -82,7 +82,7 @@ Item {
delegate: Item { delegate: Item {
id: item id: item
width: ListView.view.width width: ListView.view.width
height: 45 height: 30 + FishUI.Units.largeSpacing
scale: mouseArea.pressed ? 0.95 : 1.0 scale: mouseArea.pressed ? 0.95 : 1.0
Behavior on scale { Behavior on scale {
@ -116,12 +116,12 @@ Item {
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
anchors.margins: FishUI.Units.smallSpacing anchors.margins: FishUI.Units.smallSpacing
spacing: FishUI.Units.largeSpacing spacing: FishUI.Units.smallSpacing
Image { Image {
id: icon id: icon
source: "image://icontheme/" + model.icon source: "image://icontheme/" + model.icon
width: item.height * 0.7 width: 30
height: width height: width
sourceSize: Qt.size(width, height) sourceSize: Qt.size(width, height)
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft

View file

@ -94,6 +94,7 @@ Item {
sourceSize: Qt.size(width, height) sourceSize: Qt.size(width, height)
source: "image://icontheme/" + model.iconName source: "image://icontheme/" + model.iconName
visible: !_image.visible visible: !_image.visible
smooth: false
ColorOverlay { ColorOverlay {
anchors.fill: _icon anchors.fill: _icon
@ -127,6 +128,7 @@ Item {
source: model.thumbnail ? model.thumbnail : "" source: model.thumbnail ? model.thumbnail : ""
asynchronous: true asynchronous: true
cache: false cache: false
smooth: false
// Because of the effect of OpacityMask. // Because of the effect of OpacityMask.
ColorOverlay { ColorOverlay {

View file

@ -86,6 +86,7 @@ Item {
source: "image://icontheme/" + model.iconName source: "image://icontheme/" + model.iconName
visible: !_image.visible visible: !_image.visible
asynchronous: true asynchronous: true
smooth: false
} }
Image { Image {

View file

@ -34,8 +34,10 @@ FishUI.DesktopMenu {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: FishUI.Units.largeSpacing anchors.leftMargin: FishUI.Units.largeSpacing
source: FishUI.Theme.darkMode ? "qrc:/images/dark/grid.svg" : "qrc:/images/light/grid.svg" source: FishUI.Theme.darkMode ? "qrc:/images/dark/grid.svg" : "qrc:/images/light/grid.svg"
sourceSize: Qt.size(width, height)
width: 22 width: 22
height: width height: width
smooth: false
} }
Text { Text {
@ -51,9 +53,11 @@ FishUI.DesktopMenu {
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 anchors.rightMargin: FishUI.Units.largeSpacing * 1.5
source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg" source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg"
sourceSize: Qt.size(width, height)
width: 22 width: 22
height: width height: width
visible: settings.viewMethod === 1 visible: settings.viewMethod === 1
smooth: false
} }
onTriggered: settings.viewMethod = 1 onTriggered: settings.viewMethod = 1
@ -68,8 +72,10 @@ FishUI.DesktopMenu {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: FishUI.Units.largeSpacing anchors.leftMargin: FishUI.Units.largeSpacing
source: FishUI.Theme.darkMode ? "qrc:/images/dark/list.svg" : "qrc:/images/light/list.svg" source: FishUI.Theme.darkMode ? "qrc:/images/dark/list.svg" : "qrc:/images/light/list.svg"
sourceSize: Qt.size(width, height)
width: 22 width: 22
height: width height: width
smooth: false
} }
Text { Text {
@ -85,9 +91,11 @@ FishUI.DesktopMenu {
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 anchors.rightMargin: FishUI.Units.largeSpacing * 1.5
source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg" source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg"
sourceSize: Qt.size(width, height)
width: 22 width: 22
height: width height: width
visible: settings.viewMethod === 0 visible: settings.viewMethod === 0
smooth: false
} }
onTriggered: settings.viewMethod = 0 onTriggered: settings.viewMethod = 0
@ -104,8 +112,10 @@ FishUI.DesktopMenu {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: FishUI.Units.largeSpacing anchors.leftMargin: FishUI.Units.largeSpacing
source: FishUI.Theme.darkMode ? "qrc:/images/dark/order_by_name.svg" : "qrc:/images/light/order_by_name.svg" source: FishUI.Theme.darkMode ? "qrc:/images/dark/order_by_name.svg" : "qrc:/images/light/order_by_name.svg"
sourceSize: Qt.size(width, height)
width: 22 width: 22
height: width height: width
smooth: false
} }
Text { Text {
@ -121,9 +131,11 @@ FishUI.DesktopMenu {
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 anchors.rightMargin: FishUI.Units.largeSpacing * 1.5
source: FishUI.Theme.darkMode ? "qrc:/images/dark/up.svg" : "qrc:/images/light/up.svg" source: FishUI.Theme.darkMode ? "qrc:/images/dark/up.svg" : "qrc:/images/light/up.svg"
sourceSize: Qt.size(width, height)
height: width height: width
width: 22 width: 22
visible: settings.orderBy === 0 visible: settings.orderBy === 0
smooth: false
} }
onTriggered: settings.orderBy = 0 onTriggered: settings.orderBy = 0
@ -138,8 +150,10 @@ FishUI.DesktopMenu {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: FishUI.Units.largeSpacing anchors.leftMargin: FishUI.Units.largeSpacing
source: FishUI.Theme.darkMode ? "qrc:/images/dark/date.svg" : "qrc:/images/light/date.svg" source: FishUI.Theme.darkMode ? "qrc:/images/dark/date.svg" : "qrc:/images/light/date.svg"
sourceSize: Qt.size(width, height)
width: 22 width: 22
height: width height: width
smooth: false
} }
Text { Text {
@ -155,9 +169,11 @@ FishUI.DesktopMenu {
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 anchors.rightMargin: FishUI.Units.largeSpacing * 1.5
source: FishUI.Theme.darkMode ? "qrc:/images/dark/up.svg" : "qrc:/images/light/up.svg" source: FishUI.Theme.darkMode ? "qrc:/images/dark/up.svg" : "qrc:/images/light/up.svg"
sourceSize: Qt.size(width, height)
width: 22 width: 22
height: width height: width
visible: settings.orderBy === 1 visible: settings.orderBy === 1
smooth: false
} }
onTriggered: settings.orderBy = 1 onTriggered: settings.orderBy = 1
@ -172,8 +188,10 @@ FishUI.DesktopMenu {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: FishUI.Units.largeSpacing anchors.leftMargin: FishUI.Units.largeSpacing
source: FishUI.Theme.darkMode ? "qrc:/images/dark/size.svg" : "qrc:/images/light/size.svg" source: FishUI.Theme.darkMode ? "qrc:/images/dark/size.svg" : "qrc:/images/light/size.svg"
sourceSize: Qt.size(width, height)
width: 22 width: 22
height: width height: width
smooth: false
} }
Text { Text {
@ -189,9 +207,11 @@ FishUI.DesktopMenu {
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 anchors.rightMargin: FishUI.Units.largeSpacing * 1.5
source: FishUI.Theme.darkMode ? "qrc:/images/dark/up.svg" : "qrc:/images/light/up.svg" source: FishUI.Theme.darkMode ? "qrc:/images/dark/up.svg" : "qrc:/images/light/up.svg"
sourceSize: Qt.size(width, height)
width: 22 width: 22
height: width height: width
visible: settings.orderBy === 2 visible: settings.orderBy === 2
smooth: false
} }
onTriggered: settings.orderBy = 2 onTriggered: settings.orderBy = 2

View file

@ -104,7 +104,7 @@ ListView {
// source: model.iconPath ? model.iconPath : "image://icontheme/" + model.iconName // source: model.iconPath ? model.iconPath : "image://icontheme/" + model.iconName
source: "qrc:/images/" + (FishUI.Theme.darkMode || _item.checked ? "dark/" : "light/") + model.iconPath source: "qrc:/images/" + (FishUI.Theme.darkMode || _item.checked ? "dark/" : "light/") + model.iconPath
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
smooth: true smooth: false
} }
Label { Label {