Add a dark mode, fixes #7
This commit is contained in:
parent
cca7f55760
commit
9a0e2e523a
7 changed files with 54 additions and 10 deletions
|
@ -4,6 +4,7 @@ import QtQuick.Controls 1.3
|
|||
Item {
|
||||
property int textFontSize: 14
|
||||
property int smallfontSize: 11
|
||||
property bool nightmode
|
||||
|
||||
Component.onCompleted: fixFontSize()
|
||||
onTextFontSizeChanged: fixFontSize()
|
||||
|
@ -16,17 +17,15 @@ Item {
|
|||
height: column.height + 20
|
||||
width: parent.parent.parent.width
|
||||
|
||||
Rectangle {
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
|
||||
Rectangle {
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 15
|
||||
anchors.rightMargin: 15
|
||||
anchors.topMargin: 10
|
||||
anchors.bottomMargin: 10
|
||||
color: "transparent"
|
||||
|
||||
Column {
|
||||
id: column
|
||||
|
@ -38,7 +37,7 @@ Item {
|
|||
text: feedTitle
|
||||
font.pointSize: smallfontSize
|
||||
textFormat: Text.PlainText
|
||||
color: "gray"
|
||||
color: nightmode ? "#888" : "gray"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
@ -46,14 +45,14 @@ Item {
|
|||
text: date.toLocaleString(Qt.locale(), Locale.ShortFormat)
|
||||
font.pointSize: smallfontSize
|
||||
textFormat: Text.PlainText
|
||||
color: "gray"
|
||||
color: nightmode ? "#888" : "gray"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
}
|
||||
Label {
|
||||
text: title
|
||||
color: read ? "gray" : "black"
|
||||
color: nightmode ? (read ? "#888" : "#aaa") : (read ? "gray" : "black")
|
||||
font.pointSize: textFontSize
|
||||
textFormat: Text.RichText
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
|
@ -64,7 +63,7 @@ Item {
|
|||
text: excerpt
|
||||
font.pointSize: smallfontSize
|
||||
textFormat: Text.RichText
|
||||
color: "gray"
|
||||
color: nightmode ? "#888" : "gray"
|
||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||
renderType: Text.NativeRendering
|
||||
width: parent.width
|
||||
|
@ -76,7 +75,7 @@ Item {
|
|||
anchors.top: parent.bottom
|
||||
width: parent.width
|
||||
height: 1
|
||||
color: "lightgray"
|
||||
color: nightmode ? "#222" : "lightgray"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue