Skip to content

Commit

Permalink
updater2: Change the look to match Gireen's awesome concept.
Browse files Browse the repository at this point in the history
  • Loading branch information
DolceTriade committed Jun 5, 2017
1 parent 655e7f3 commit b82379a
Show file tree
Hide file tree
Showing 13 changed files with 133 additions and 69 deletions.
11 changes: 7 additions & 4 deletions DownloadInfo.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ Item {
height: Math.min(parent.height * 0.1, 40)
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottomMargin: 75
anchors.bottomMargin: 20
Card {
width: parent.width - (downloadAction.width / 2)
width: parent.width - downloadAction.width
height: parent.height
Material.elevation: 2
Material.theme: Material.Dark
Material.background: "black"
Item {
width: parent.width
height: parent.height
Expand All @@ -27,6 +29,7 @@ Item {
to: 1.0
indeterminate: false
value: downloader.completedSize / downloader.totalSize
Material.accent: Material.Teal
}
Row {
id: downloadInfo
Expand Down Expand Up @@ -86,11 +89,11 @@ Item {
ActionButton {
id: downloadAction
iconName: "file/file_download"
scale: 0.83
scale: 0.7
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
Material.background: Material.Green
Material.elevation: 1
Material.background: Material.Teal
onClicked: {
if (downloader.state === QmlDownloader.COMPLETED) {
root.hide();
Expand Down
41 changes: 23 additions & 18 deletions News.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import QtQuick.Controls.Material 2.0
import Fluid.Controls 1.0
import Fluid.Material 1.0

Card {
id: newsContainer
width: Math.min(parent.width * 0.5, 400)
height: width * 1.1
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.margins: parent.width * 0.1
Item {
width: parent.width
anchors {
horizontalCenter: parent.horizontalCenter
top: header.bottom
bottom: downloadInfo.top
topMargin: 10
bottomMargin: 10
}

function stripHttpsIfWin(url) {

Expand Down Expand Up @@ -44,10 +46,13 @@ Card {
}
SwipeView {
id: swipe
height: parent.height * 0.9
width: parent.width
clip: true
anchors.horizontalCenter: parent.horizontalCenter
anchors {
top: parent.top
bottom: parent.bottom
left: leftButton.right
right: rightButton.left
}
Component.onCompleted: fetchNews()
}
PageIndicator {
Expand All @@ -58,20 +63,20 @@ Card {
anchors.horizontalCenter: parent.horizontalCenter
}
ActionButton {
anchors.left: swipe.left
id: leftButton
anchors.left: parent.left
anchors.verticalCenter: swipe.verticalCenter
anchors.leftMargin: -width / 2
Material.background: Material.Blue
scale: 0.5
Material.background: Material.Teal
scale: 0.75
iconName: "navigation/chevron_left"
onClicked: swipe.decrementCurrentIndex()
}
ActionButton {
anchors.right: swipe.right
id: rightButton
anchors.right: parent.right
anchors.verticalCenter: swipe.verticalCenter
anchors.rightMargin: -width / 2
Material.background: Material.Blue
scale: 0.5
Material.background: Material.Teal
scale: 0.75
iconName: "navigation/chevron_right"
onClicked: swipe.incrementCurrentIndex()
}
Expand Down
65 changes: 31 additions & 34 deletions NewsCard.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,49 @@ import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0
import Fluid.Controls 1.0
import Fluid.Effects 1.0
import QtQuick.Layouts 1.3

Flickable {
id: item
property url source : ""
property string cardTitle : ""
property string summary : ""
property string url: ""
Card {
id: card
width: parent.width
height: parent.height

Image {
id: picture
anchors {
left: parent.left
top: parent.top
right: parent.right
margins: 20
}
Image {
id: picture
anchors {
left: parent.left
top: parent.top
margins: 20
verticalCenter: parent.verticalCenter
}

height: parent.height * 0.5
source: item.source
BusyIndicator {
anchors.centerIn: parent
visible: picture.status !== Image.Ready
}
width: parent.width * 0.45
source: item.source
fillMode: Image.PreserveAspectFit
BusyIndicator {
anchors.centerIn: parent
visible: picture.status !== Image.Ready
}
}

Card {
anchors {
right: parent.right
verticalCenter: parent.verticalCenter
}
width: picture.paintedWidth
height: picture.paintedHeight
Layout.maximumHeight: picture.paintedHeight
Material.theme: Material.Dark
Material.background: "black"
visible: picture.status === Image.Ready

Column {
id: column
anchors {
left: parent.left
top: picture.bottom
right: parent.right
margins: Units.smallSpacing * 2
}
width: parent.width
height: parent.height
spacing: Units.smallSpacing * 2

TitleLabel {
Expand All @@ -54,7 +60,7 @@ Flickable {
text: item.summary
textFormat: Text.RichText
onLinkActivated: {
Qt.openUrlExternally(link)
Qt.openUrlExternally(link);
}
MouseArea {
anchors.fill: parent
Expand All @@ -63,14 +69,5 @@ Flickable {
}
}
}
Button {
text: "Read More"
onClicked: Qt.openUrlExternally(item.url)
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: Qt.PointingHandCursor
}
}
}
}
71 changes: 62 additions & 9 deletions main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import Fluid.Material 1.0 as FluidMaterial
ApplicationWindow {
id: root
visible: true
width: 1280
height: 720
minimumWidth: 1280
minimumHeight: 720
width: 1024
height: 768
title: qsTr("Unvanquished Updater")
Material.theme: Material.Light
Material.primary: Material.DarkBlue
Expand All @@ -28,21 +26,73 @@ ApplicationWindow {
Image {
width: parent.width
height: parent.height
source: "qrc:/resources/menu.png"
source: "qrc:/resources/background.png"
}

Rectangle {
anchors.bottom: header.top
width: header.width
height: 3
color: "#2F1E1E"
}

Image {
id: header
width: parent.width
height: logo.height * 2
anchors {
top: parent.top
topMargin: parent.height * 0.1
}
source: "qrc:/resources/header.png"
}
Rectangle {
anchors.top: header.bottom
width: header.width
height: 3
color: "#2F1E1E"
}

Image {
id: tyrant
anchors {
right: parent.right
verticalCenter: header.verticalCenter
verticalCenterOffset: height * 0.20
}
width: parent.width * 0.25
fillMode: Image.PreserveAspectFit
source: "qrc:/resources/tyrant.png"
}
Image {
id: logo
anchors {
left: parent.left
verticalCenter: header.verticalCenter
leftMargin: 25
}
width: parent.width * 0.65

fillMode: Image.PreserveAspectFit
source: "qrc:/resources/logo.png"
}

FluidMaterial.ActionButton {
id: settingsAction
scale: 0.55
anchors.top: parent.top
anchors.right: parent.right
iconName: "action/settings"
Material.elevation: 1
Material.background: Material.Blue
Material.background: Material.Teal
onClicked: settingsBottomSheet.open()
}

News {}
DownloadInfo {}
News {
id: newsContainer
}
DownloadInfo {
id: downloadInfo
}
FluidMaterial.BottomSheet {
id: settingsBottomSheet
width: parent.width
Expand All @@ -62,5 +112,8 @@ ApplicationWindow {
FluidControls.InfoBar {
id: infoBar
duration: 3000
onClicked: {
this.hide();
}
}
}
6 changes: 4 additions & 2 deletions qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<qresource prefix="/">
<file>main.qml</file>
<file>qtquickcontrols2.conf</file>
<file>resources/menu.png</file>
<file>resources/menu720p.png</file>
<file>resources/Roboto-Regular.ttf</file>
<file>resources/updater.png</file>
<file>News.qml</file>
Expand All @@ -14,5 +12,9 @@
<file>Settings.qml</file>
<file>utils.js</file>
<file>resources/unvanquished.png</file>
<file>resources/background.png</file>
<file>resources/header.png</file>
<file>resources/logo.png</file>
<file>resources/tyrant.png</file>
</qresource>
</RCC>
Binary file added resources/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed resources/menu.png
Binary file not shown.
Binary file removed resources/menu720p.png
Binary file not shown.
Binary file added resources/tyrant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion splash.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ApplicationWindow {

iconName: "action/settings"
Material.elevation: 0
Material.background: Material.Blue
Material.background: Material.Teal
onClicked: {
showUpdater();
timer.stop();
Expand Down
6 changes: 5 additions & 1 deletion updater2.pro
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,8 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin

DISTFILES += \
resources/unvanquished.desktop \
resources/unvanquished.png
resources/unvanquished.png \
resources/background.png \
resources/header.png \
resources/logo.png \
resources/tyrant.png

0 comments on commit b82379a

Please sign in to comment.