Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct display on square screens and adapt images to new guidelines in numerals-duo-synth-neon-green #54

Merged
merged 5 commits into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import QtQuick 2.9
Item {
property string currentColor: "black"
property string userColor: ""
property string imgPath: "../watchface-img/"
property string imgPath: "../watchface-img/analog-classy-roman-"
property var numeral: ["\u216B", "\u2160", "\u2161", "\u2162", "\u2163", "\u2164", "\u2165", "\u2166", "\u2167", "\u2168", "\u2169", "\u216A"]

Image {
z: 0
id: background
property var toggle: 1
source: !displayAmbient ? imgPath + "background-classy-roman-white.svg" :
imgPath + "background-classy-roman.svg"
source: !displayAmbient ? imgPath + "background-white.svg" :
imgPath + "background.svg"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: parent.width
Expand All @@ -50,7 +50,7 @@ Item {
states: State { name: "black"
PropertyChanges {
target: background
source: imgPath + "background-classy-roman.svg"
source: imgPath + "background.svg"
}
}
transitions: Transition {
Expand All @@ -68,7 +68,7 @@ Item {
imgPath + "asteroid_logo_wb.png"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -parent.height * 0.37
anchors.verticalCenterOffset: -parent.height * .37
width: parent.width / 4.4
height: parent.height / 4.4
state: currentColor
Expand All @@ -89,14 +89,14 @@ Item {
Text {
z: 1
id: asteroidSlogan
font.pixelSize: parent.height * 0.042
font.pixelSize: parent.height * .042
font.family: "Raleway"
color: "black"
opacity: 0.8
opacity: .8
horizontalAlignment: Text.AlignHCenter
anchors {
top: parent.top
topMargin: parent.height * 0.24
topMargin: parent.height * .24
horizontalCenter: parent.horizontalCenter
}
text: "<b>AsteroidOS</b><br>Hack Your Wrist"
Expand All @@ -117,16 +117,16 @@ Item {
Text {
z: 1
id: dayDisplay
font.pixelSize: parent.height * 0.08
font.pixelSize: parent.height * .08
font.family: "Roboto"
font.styleName: "Bold"
color: "black"
opacity: 0.8
opacity: .8
horizontalAlignment: Text.AlignHCenter
anchors {
verticalCenter: parent.verticalCenter
horizontalCenter: parent.horizontalCenter
horizontalCenterOffset: parent.width * 0.215
horizontalCenterOffset: parent.width * .215
}
text: wallClock.time.toLocaleString(Qt.locale(), "d").toUpperCase()
state: currentColor
Expand All @@ -147,16 +147,16 @@ Item {
Text {
z: 1
id: dowDisplay
font.pixelSize: parent.height * 0.08
font.pixelSize: parent.height * .08
font.family: "Roboto"
font.styleName: "Bold"
color: "black"
opacity: 0.8
opacity: .8
horizontalAlignment: Text.AlignHCenter
anchors {
verticalCenter: parent.verticalCenter
horizontalCenter: parent.horizontalCenter
horizontalCenterOffset: -parent.width * 0.215
horizontalCenterOffset: -parent.width * .215
}
text: wallClock.time.toLocaleString(Qt.locale(), "ddd").toUpperCase().slice(0, 2)
state: currentColor
Expand All @@ -177,15 +177,15 @@ Item {
Text {
z: 1
id: monthDisplay
font.pixelSize: parent.height * 0.042
font.pixelSize: parent.height * .042
font.family: "Raleway"
color: "black"
opacity: 0.8
opacity: .8
horizontalAlignment: Text.AlignHCenter
anchors {
horizontalCenter: parent.horizontalCenter
verticalCenter: parent.verticalCenter
verticalCenterOffset: parent.width * 0.22
verticalCenterOffset: parent.width * .22
}
text: wallClock.time.toLocaleString(Qt.locale(), "<b>MMMM</b><br>yyyy")
state: currentColor
Expand All @@ -212,18 +212,18 @@ Item {
property var rotM: (index - 15) / 60
property var centerX: parent.width / 2 - width / 2
property var centerY: parent.height / 2 - height / 2
x: centerX + Math.cos(rotM * 2 * Math.PI) * parent.width * 0.47
y: centerY + Math.sin(rotM * 2 * Math.PI) * parent.width * 0.47
x: centerX + Math.cos(rotM * 2 * Math.PI) * parent.width * .47
y: centerY + Math.sin(rotM * 2 * Math.PI) * parent.width * .47
color: "black"
width: if (index % 5 == 0)
parent.width * 0.02
parent.width * .02
else
parent.width * 0.003
parent.width * .003
height: if (index % 5 == 0)
parent.width * 0.02
parent.width * .02
else
parent.width * 0.02
opacity: 0.6
parent.width * .02
opacity: .6
transform: Rotation {
origin.x: width / 2
origin.y: height / 2
Expand Down Expand Up @@ -254,25 +254,25 @@ Item {
Text {
id: hourText
z: 2
property var heightFontOffest: -parent.height * 0.002
property var heightFontOffest: -parent.height * .002
font.pixelSize: if (index == 0)
parent.height * 0.113
parent.height * .113
else
parent.height * 0.10
parent.height * .10
antialiasing: true
font.family: "Roboto Condensed"
font.styleName: "Bold"
property var rotM: ((index * 5 ) - 15) / 60
property var centerX: parent.width / 2 - width / 2
property var centerY: parent.height / 2 - height / 2
x: if (index == 0)
centerX + Math.cos(rotM * 2 * Math.PI) * (parent.width * 0.356)
centerX + Math.cos(rotM * 2 * Math.PI) * (parent.width * .356)
else
centerX + Math.cos(rotM * 2 * Math.PI) * (parent.width * 0.41)
centerX + Math.cos(rotM * 2 * Math.PI) * (parent.width * .41)
y: if (index == 0)
centerY + Math.sin(rotM * 2 * Math.PI) * (parent.width * 0.356) + heightFontOffest
centerY + Math.sin(rotM * 2 * Math.PI) * (parent.width * .356) + heightFontOffest
else
centerY + Math.sin(rotM * 2 * Math.PI) * (parent.width * 0.41) + heightFontOffest
centerY + Math.sin(rotM * 2 * Math.PI) * (parent.width * .41) + heightFontOffest
color: "black"
text: numeral[index]
transform: Rotation {
Expand All @@ -299,22 +299,22 @@ Item {
Image {
id: hourSVG
z: 3
source: imgPath + "hour-classy-roman-v3.svg"
source: imgPath + "hour.svg"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: parent.width
height: parent.height
transform: Rotation {
origin.x: parent.width / 2
origin.y: parent.height / 2
angle: (wallClock.time.getHours() * 30) + (wallClock.time.getMinutes() * 0.5)
angle: (wallClock.time.getHours() * 30) + (wallClock.time.getMinutes() * .5)
}
}

Image {
id: minuteSVG
z: 4
source: imgPath + "minute-classy-roman-v3.svg"
source: imgPath + "minute.svg"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: parent.width
Expand All @@ -330,7 +330,7 @@ Item {
id: secondSVG
z: 4
visible: !displayAmbient
source: imgPath + "second-classy-roman.svg"
source: imgPath + "second.svg"
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: parent.width
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ import QtGraphicalEffects 1.15

Item {

property string imgPath: "../watchface-img/analog-neon-diver-"

Image {
z: 0
id: backplate
source: "../watchface-img/backplate-neon.svg"
source: imgPath + "backplate.svg"
antialiasing: true
anchors.centerIn: parent
width: parent.width
Expand All @@ -48,8 +50,8 @@ Item {
z: 0
id: modeDisplay
source: hourSVG.toggle24h ?
"../watchface-img/backplate-neon-24hindicator.svg" :
"../watchface-img/backplate-neon-12hindicator.svg"
imgPath + "backplate-24hindicator.svg" :
imgPath + "backplate-12hindicator.svg"
antialiasing: true
anchors.centerIn: parent
width: parent.width
Expand Down Expand Up @@ -179,8 +181,8 @@ Item {
z: 2
property bool toggle24h: false
source: hourSVG.toggle24h ?
"../watchface-img/hour-neon-diver-24h.svg" :
"../watchface-img/hour-neon-diver-12h.svg"
imgPath + "hour-24h.svg" :
imgPath + "hour-12h.svg"
antialiasing: true
anchors.centerIn: parent
width: parent.width
Expand Down Expand Up @@ -220,7 +222,7 @@ Item {
Image {
id: minuteSVG
z: 3
source: "../watchface-img/minute-neon-diver.svg"
source: imgPath + "minute.svg"
antialiasing: true
anchors.centerIn: parent
width: parent.width
Expand Down Expand Up @@ -252,7 +254,7 @@ Item {
z: 4
antialiasing: true
visible: !displayAmbient
source: "../watchface-img/second-neon-diver.svg"
source: imgPath + "second.svg"
anchors.centerIn: parent
width: parent.width
height: parent.height
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ Item {
Canvas {
z: 4
id: secondCanvas

visible: !displayAmbient
property var second: 0
anchors.fill: parent
smooth: true
Expand Down Expand Up @@ -211,7 +213,6 @@ Item {
ctx.arc(parent.width/2, parent.height/2, parent.height*0.006, 0, 2*Math.PI, false)
ctx.fill()
ctx.closePath()

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Item {
verticalCenterOffset: parent.height * 0.15
}
opacity: displayAmbient ? 0.6 : 1.0
source: "../watchface-img/nixie.png"
source: "../watchface-img/nixie-delight-nixie.png"
}

Text {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import org.asteroid.controls 1.0

Item {
property int length: width > height ? height : width
property string imgPath: "../watchfaces-img/numerals-duo-neon-green-"

id: root

Expand Down Expand Up @@ -61,7 +62,7 @@ Item {
x: parseInt(parent.width*0.135)
y: parseInt(parent.height*0.045)
sourceSize: Qt.size(parent.width/2 - parent.width*0.15, parent.height/2 - parent.height*0.15)
source: "../watchfaces-img/neon" + wallClock.time.toLocaleString(Qt.locale(), "HH").slice(0, 1) + ".png"
source: imgPath + wallClock.time.toLocaleString(Qt.locale(), "HH").slice(0, 1) + ".png"
}
Image {
id: topRight
Expand All @@ -71,7 +72,7 @@ Item {
x: parseInt(parent.width/2 + parent.width*0.03)
y: parseInt(parent.height*0.045)
sourceSize: Qt.size(parent.width/2 - parent.width*0.15, parent.height/2 - parent.height*0.15)
source: "../watchfaces-img/neon" + wallClock.time.toLocaleString(Qt.locale(), "HH").slice(1, 2) + ".png"
source: imgPath + wallClock.time.toLocaleString(Qt.locale(), "HH").slice(1, 2) + ".png"
}
Image {
id: bottomLeft
Expand All @@ -81,7 +82,7 @@ Item {
x: parseInt(parent.width*0.135)
y: parseInt(parent.height/2 + parent.height*0.025)
sourceSize: Qt.size(parent.width/2 - parent.width*0.15, parent.height/2 - parent.height*0.15)
source: "../watchfaces-img/neon" + wallClock.time.toLocaleString(Qt.locale(), "mm").slice(0, 1) + ".png"
source: imgPath + wallClock.time.toLocaleString(Qt.locale(), "mm").slice(0, 1) + ".png"
}
Image {
id: bottomRight
Expand All @@ -91,7 +92,7 @@ Item {
x: parseInt(parent.width/2 + parent.width*0.03)
y: parseInt(parent.height/2 + parent.height*0.025)
sourceSize: Qt.size(parent.width/2 - parent.width*0.15, parent.height/2 - parent.height*0.15)
source: "../watchfaces-img/neon" + wallClock.time.toLocaleString(Qt.locale(), "mm").slice(1, 2) + ".png"
source: imgPath + wallClock.time.toLocaleString(Qt.locale(), "mm").slice(1, 2) + ".png"
}

OpacityMask {
Expand Down
Loading