Commit c96601f6 authored by Nate Graham's avatar Nate Graham 🔩

Improve hairlines for factional scaling

By porting to Kirigami.Separator and defining a new property (`hairline`)
which rounds down the device pixel ratio to an integer, we can improve
the look of single-pixel lines for people using fractional scale factors.
parent 95c78c36
......@@ -5,6 +5,7 @@
*/
import QtQuick 2.7
import org.kde.kirigami 2.0 as Kirigami
Item {
property string defaultAlbumImage: 'image://icon/media-optical-audio'
......@@ -26,6 +27,8 @@ Item {
property string errorIcon: 'image://icon/error'
property string folderIcon: 'image://icon/document-open-folder'
property int hairline: Math.floor(Kirigami.Units.devicePixelRatio)
property int playListAlbumArtSize: 60
property int coverImageSize: 180
......
......@@ -154,16 +154,12 @@ FocusScope {
}
// Horizontal line separating title and subtitle from metadata
Rectangle {
Kirigami.Separator {
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.largeSpacing* 5
Layout.rightMargin: Kirigami.Units.largeSpacing * 5
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing
height: 1
color: myPalette.mid
}
// Metadata
......@@ -185,17 +181,13 @@ FocusScope {
}
// Horizontal line separating metadata from lyrics
Rectangle {
Kirigami.Separator {
Layout.fillWidth: true
Layout.leftMargin: Kirigami.Units.largeSpacing * 5
Layout.rightMargin: Kirigami.Units.largeSpacing * 5
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.bottomMargin: Kirigami.Units.largeSpacing
height: 1
color: myPalette.mid
visible: metaDataModel.lyrics !== ""
}
......
......@@ -246,10 +246,8 @@ ApplicationWindow {
}
}
Rectangle {
Kirigami.Separator {
Layout.fillWidth: true
height: 1
color: myPalette.mid
}
ContentView {
......
......@@ -29,11 +29,9 @@ ColumnLayout {
// Separator line above the header
Rectangle {
Kirigami.Separator {
visible: type == "footer" && type != "other"
Layout.fillWidth: true
height: 1
color: myPalette.mid
}
// Background rectangle + content layout
......@@ -67,10 +65,8 @@ ColumnLayout {
}
// Separator line under the header
Rectangle {
Kirigami.Separator {
visible: type == "header" && type != "other"
Layout.fillWidth: true
height: 1
color: myPalette.mid
}
}
......@@ -204,7 +204,7 @@ FocusScope {
implicitHeight: 18
radius: 9
color: myPalette.base
border.width: 1
border.width: elisaTheme.hairline
border.color: musicProgress.pressed ? myPalette.text : myPalette.dark
}
......@@ -309,7 +309,7 @@ FocusScope {
implicitHeight: 18
radius: 9
color: myPalette.base
border.width: 1
border.width: elisaTheme.hairline
border.color: volumeSlider.pressed ? myPalette.text : (muted ? myPalette.mid : myPalette.dark)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment