Implement the theme switching, dark background color tweaked.
tools: ToolBarLayout {
id: toolBar
- ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop(); }
+ ToolIcon {
+ iconId: "icon-m-toolbar-back" + (theme.inverted ? "-white": "")
+ onClicked: pageStack.pop()
+ }
}
PageHeader {
id: header
"Quando Parte" + "</a></h2>" +"<p style='font-size:small;'>version ") +
settings.versionString +
qsTr("</p>" +
- "<p>Copyright (c) 2010, 2011, 2012</p>" +
+ "<p>Copyright (c) 2010, 2011, 2012, 2013</p>" +
"<p>Luciano Montanaro " +
"(<a href='mailto:mikelima@cirulla.net'>mikelima@cirulla.net</a>)</p>" +
"<p>Licensed under the GNU Public License v2 or above</p>" +
id: stationListPage
tools: ToolBarLayout {
id: toolBar
- ToolIcon { iconId: "icon-m-toolbar-search"; onClicked: searchField.open = !searchField.open; }
- ToolIcon { iconId: "icon-m-toolbar-view-menu"; onClicked: menu.open() }
+ ToolIcon {
+ iconId: "icon-m-toolbar-search" + (theme.inverted ? "-white": "")
+ onClicked: searchField.open = !searchField.open
+ }
+ ToolIcon {
+ iconId: "icon-m-toolbar-view-menu" + (theme.inverted ? "-white": "")
+ onClicked: menu.open()
+ }
}
Menu {
id: menu
right: parent.right
rightMargin: UiConstants.DefaultMargin
}
+ checked: settings.autoUpdate
onCheckedChanged: settings.autoUpdate = checked
}
}
right: parent.right
rightMargin: UiConstants.DefaultMargin
}
- onCheckedChanged: settings.useDarkTheme = checked
+ checked: settings.darkThemePreferred
+ onCheckedChanged: {
+ settings.darkThemePreferred = checked
+ theme.inverted = checked
+ }
}
}
MenuItem {
anchors.fill: parent
// Fill page borders
visible: mouseArea.pressed
- source: "image://theme/meegotouch-list-fullwidth-background-pressed"
+ source: "image://theme/meegotouch-list-fullwidth-" + (theme.inverted ? "inverted-" : "") + "background-pressed"
}
Row {
anchors.fill: parent
left: parent.left
right: parent.right
}
- source: "image://theme/meegotouch-separator-background-horizontal"
+ source: "image://theme/meegotouch-separator-" + (theme.inverted ? "inverted-" : "") + "background-horizontal"
}
MouseArea {
id: mouseArea
tools: ToolBarLayout {
id: toolBar
- ToolIcon { iconId: "icon-m-toolbar-back"; onClicked: pageStack.pop() }
- ToolIcon { iconId: "icon-m-toolbar-refresh"; onClicked: updateStation() }
- ToolIcon { iconId: "icon-m-toolbar-view-menu"; onClicked: menu.open() }
+ ToolIcon {
+ iconId: "icon-m-toolbar-back" + (theme.inverted ? "-white": "")
+ onClicked: pageStack.pop()
+ }
+ ToolIcon {
+ iconId: "icon-m-toolbar-refresh" + (theme.inverted ? "-white": "")
+ onClicked: updateStation() }
+ ToolIcon {
+ iconId: "icon-m-toolbar-view-menu" + (theme.inverted ? "-white": "")
+ onClicked: menu.open()
+ }
}
PageHeader {
id: header
anchors.fill: parent
// Fill page borders
visible: mouseArea.pressed
- source: "image://theme/meegotouch-list-background-pressed-center"
+ source: "image://theme/meegotouch-list-fullwidth-" + (theme.inverted ? "inverted-" : "") + "background-pressed"
}
Item {
id: bodyRow
left: parent.left
right: parent.right
}
- source: "image://theme/meegotouch-separator-background-horizontal"
+ source: "image://theme/meegotouch-separator-"+ (theme.inverted ? "inverted-" : "") + "background-horizontal"
}
MouseArea {
id: mouseArea
if (actual === "--") {
return qsTr("Platform %1").arg(expected)
} else if (actual === expected || expected === "--") {
- return qsTr("Platform <span style='font-weight:bold;color:#080'>%2</span>").arg(actual)
+ return qsTr("Platform <span style='font-weight:bold;color:%2'>%1</span>").arg(actual).arg(theme.inverted ? "#0f0" : "#080")
} else {
return qsTr("Platform " +
"<span style='text-decoration:line-through'>%1</span> " +
- "<span style='font-weight:bold;color:#800'>%2</span>").arg(expected).arg(actual)
+ "<span style='font-weight:bold;color:%3'>%2</span>").arg(expected).arg(actual).arg(theme.inverted ? "#f00" : "#800")
}
}
}
id: window
showToolBar: true
showStatusBar: screen.currentOrientation === Screen.Landscape ? false : true
+/*
+ platformStyle: PageStackWindowStyle {
+ background: "image://theme/meegotouch-applicationpage" +
+ (screen.currentOrientation === Screen.Landscape ? "" : "-portrait") +
+ "-background" +
+ (theme.inverted ? "-inverted" : "")
+ }
+*/
initialPage: StationListPage {
}
+
AlignedTimer {
id: updateTimer
minimumInterval: 120
}
Component.onCompleted: {
if (settings.checkingInterval > 0) updateTimer.start()
+ theme.inverted = settings.darkThemePreferred
+ theme.colorScheme = 3
}
}