add translations for EmojiDrawer and move Statusbar back to cwtchui

This commit is contained in:
erinn 2020-05-20 11:50:45 -07:00
parent 133a7697f1
commit db305895e7
12 changed files with 489 additions and 186 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
\.idea
*.qmlc

View File

@ -1,186 +0,0 @@
import QtQuick 2.7
import QtQuick.Controls 2.4
import "." as Widgets
import "theme"
// Statusbar is a app wide 10-25 tall bar that should be place at the bottom of the app that gives network health information
// it changes color and text/icon message based on network health. when netowrk is not healthy it is always in fullsized mode
// when network is health it reduces to a minimal color strip unless mouse overed / clicked to reveal the text/icons
Rectangle {
id: statusbar
property int status: statusDisconnectedInternet
readonly property int statusDisconnectedInternet: 0
readonly property int statusDisconnectedTor: 1
readonly property int statusConnecting: 2
readonly property int statusOnline: 3
readonly property int openHeight: 25
readonly property int hideHeight: 10
property bool isHover: false
height: openHeight
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
Text {
id: statusMessage
opacity: 0
anchors.right: networkStatus.left
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 5 * gcd.themeScale
font.pixelSize: Theme.statusTextSize * gcd.themeScale
}
Icon {
id: networkStatus
opacity: 0
anchors.right: connectionStatus.left
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 5 * gcd.themeScale
height: 18
width: 18
}
Icon {
id: connectionStatus
opacity: 0
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
anchors.rightMargin: 10 * gcd.themeScale
height: 18 * gcd.themeScale
width: 18 * gcd.themeScale
}
function changeStatus() {
if (status == statusDisconnectedInternet) {
statusbar.color = Theme.statusbarDisconnectedInternetColor
statusMessage.color = Theme.statusbarDisconnectedInternetFontColor
networkStatus.iconColor = Theme.statusbarDisconnectedInternetFontColor
networkStatus.source = gcd.assetPath + "core/signal_cellular_off-24px.svg"
connectionStatus.iconColor = Theme.statusbarDisconnectedInternetFontColor
connectionStatus.source = gcd.assetPath + "core/syncing-03.svg"
//: Disconnected from the internet, check your connection
statusMessage.text = qsTr("network-status-disconnected")
show()
} else if (status == statusDisconnectedTor) {
statusbar.color = Theme.statusbarDisconnectedTorColor
statusMessage.color = Theme.statusbarDisconnectedTorFontColor
networkStatus.iconColor = Theme.statusbarDisconnectedTorFontColor
networkStatus.source = gcd.assetPath + "core/signal_cellular_connected_no_internet_4_bar-24px.svg"
connectionStatus.iconColor = Theme.statusbarDisconnectedTorFontColor
connectionStatus.source = gcd.assetPath + "core/syncing-03.svg"
//: Attempting to connect to Tor network
statusMessage.text = qsTr("network-status-attempting-tor")
show()
} else if (status == statusConnecting) {
statusbar.color = Theme.statusbarConnectingColor
statusMessage.color = Theme.statusbarConnectingFontColor
networkStatus.iconColor = Theme.statusbarConnectingFontColor
networkStatus.source = gcd.assetPath + "core/signal_cellular_connected_no_internet_4_bar-24px.svg"
connectionStatus.iconColor = Theme.statusbarConnectingFontColor
connectionStatus.source = gcd.assetPath + "core/syncing-02.svg"
//: Connecting...
statusMessage.text = qsTr("network-status-connecting")
show()
} else {
statusbar.color = Theme.statusbarOnlineColor
statusMessage.color = Theme.statusbarOnlineFontColor
networkStatus.iconColor = Theme.statusbarOnlineFontColor
networkStatus.source = gcd.assetPath + "core/signal_cellular_4_bar-24px.svg"
connectionStatus.iconColor = Theme.statusbarOnlineFontColor
connectionStatus.source = gcd.assetPath + "core/syncing-01.svg"
//: Online
statusMessage.text = qsTr("network-status-online")
hide()
}
}
MouseArea {
id: ma
anchors.fill: parent
hoverEnabled: true
SequentialAnimation {
id: showAnim
PropertyAnimation { id: openStatus; target: statusbar; property: "height"; to: openHeight}
ParallelAnimation {
PropertyAnimation { id: showStatus; target: statusMessage; property: "opacity"; to: 1}
PropertyAnimation { id: showNetIcon; target: networkStatus; property: "opacity"; to: 1}
PropertyAnimation { id: showConnIcon; target: connectionStatus; property: "opacity"; to: 1}
}
}
SequentialAnimation {
id: hideAnim
ParallelAnimation {
PropertyAnimation { id: hideStatus; target: statusMessage; property: "opacity"; to: 0}
PropertyAnimation { id: hideNetIcon; target: networkStatus; property: "opacity"; to: 0}
PropertyAnimation { id: hideConnIcon; target: connectionStatus; property: "opacity"; to: 0}
}
PropertyAnimation { id: closeStatus; target: statusbar; property: "height"; to: hideHeight; duration: 200 }
}
onEntered: {
isHover = true
show()
}
onExited: {
isHover = false
hide()
}
onPressed: {
isHover = true
show()
}
onReleased: {
isHover = false
hide()
}
}
function resetHeight() {
if (isHover || status != statusOnline) {
height = openHeight
} else {
height = hideHeight
}
}
function show() {
if (isHover || status != statusOnline) {
hideAnim.stop()
showAnim.start()
}
}
function hide() {
if (!isHover && status == statusOnline) {
showAnim.stop()
hideAnim.start()
}
}
onStatusChanged: { changeStatus() }
Component.onCompleted: { resetHeight() }
Connections {
target: gcd
onTorStatus: function(code) {
status = code
}
}
}

BIN
i18n/translation_de.qm Normal file

Binary file not shown.

103
i18n/translation_de.ts Normal file
View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE">
<context>
<name>EmojiDrawer</name>
<message>
<location filename="../EmojiDrawer.qml" line="64"/>
<source>search</source>
<extracomment>Search...</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="76"/>
<source>emojicat-expressions</source>
<extracomment>Expressions</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="84"/>
<source>emojicat-activities</source>
<extracomment>Activities</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="92"/>
<source>emojicat-food</source>
<extracomment>Food, drink &amp; herbs</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="100"/>
<source>emojicat-gender</source>
<extracomment>Gender, relationships &amp; sexuality</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="108"/>
<source>emojicat-nature</source>
<extracomment>Nature and effects</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="116"/>
<source>emojicat-objects</source>
<extracomment>Objects</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="124"/>
<source>emojicat-people</source>
<extracomment>People and animals</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="132"/>
<source>emojicat-symbols</source>
<extracomment>Symbols</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="140"/>
<source>emojicat-travel</source>
<extracomment>Travel &amp; places</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="148"/>
<source>emojicat-misc</source>
<extracomment>Miscellaneous</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="190"/>
<source>cycle-cats-android</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="190"/>
<source>cycle-cats-desktop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="225"/>
<source>cycle-morphs-android</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="225"/>
<source>cycle-morphs-desktop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="258"/>
<source>cycle-colours-android</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="258"/>
<source>cycle-colours-desktop</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

BIN
i18n/translation_en.qm Normal file

Binary file not shown.

109
i18n/translation_en.ts Normal file
View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>EmojiDrawer</name>
<message>
<location filename="../EmojiDrawer.qml" line="190"/>
<source>cycle-cats-android</source>
<translation>Click to cycle category.
Long-press to reset.</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="190"/>
<source>cycle-cats-desktop</source>
<translation>Click to cycle category.
Right-click to reset.</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="225"/>
<source>cycle-morphs-android</source>
<translation>Click to cycle morphs.
Long-press to reset.</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="225"/>
<source>cycle-morphs-desktop</source>
<translation>Click to cycle morphs.
Right-click to reset.</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="258"/>
<source>cycle-colours-android</source>
<translation>Click to cycle colours.
Long-press to reset.</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="258"/>
<source>cycle-colours-desktop</source>
<translation>Click to cycle colours.
Right-click to reset.</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="64"/>
<source>search</source>
<extracomment>Search...</extracomment>
<translation>Search...</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="76"/>
<source>emojicat-expressions</source>
<extracomment>Expressions</extracomment>
<translation>Expressions</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="84"/>
<source>emojicat-activities</source>
<extracomment>Activities</extracomment>
<translation>Activities</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="92"/>
<source>emojicat-food</source>
<extracomment>Food, drink &amp; herbs</extracomment>
<translation>Food, drink &amp; herbs</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="100"/>
<source>emojicat-gender</source>
<extracomment>Gender, relationships &amp; sexuality</extracomment>
<translation>Gender, relationships &amp; sexuality</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="108"/>
<source>emojicat-nature</source>
<extracomment>Nature and effects</extracomment>
<translation>Nature and effects</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="116"/>
<source>emojicat-objects</source>
<extracomment>Objects</extracomment>
<translation>Objects</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="124"/>
<source>emojicat-people</source>
<extracomment>People and animals</extracomment>
<translation>People and animals</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="132"/>
<source>emojicat-symbols</source>
<extracomment>Symbols</extracomment>
<translation>Symbols</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="140"/>
<source>emojicat-travel</source>
<extracomment>Travel &amp; places</extracomment>
<translation>Travel &amp; places</translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="148"/>
<source>emojicat-misc</source>
<extracomment>Miscellaneous</extracomment>
<translation>Miscellaneous</translation>
</message>
</context>
</TS>

BIN
i18n/translation_fr.qm Normal file

Binary file not shown.

103
i18n/translation_fr.ts Normal file
View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fr_FR">
<context>
<name>EmojiDrawer</name>
<message>
<location filename="../EmojiDrawer.qml" line="64"/>
<source>search</source>
<extracomment>Search...</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="76"/>
<source>emojicat-expressions</source>
<extracomment>Expressions</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="84"/>
<source>emojicat-activities</source>
<extracomment>Activities</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="92"/>
<source>emojicat-food</source>
<extracomment>Food, drink &amp; herbs</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="100"/>
<source>emojicat-gender</source>
<extracomment>Gender, relationships &amp; sexuality</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="108"/>
<source>emojicat-nature</source>
<extracomment>Nature and effects</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="116"/>
<source>emojicat-objects</source>
<extracomment>Objects</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="124"/>
<source>emojicat-people</source>
<extracomment>People and animals</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="132"/>
<source>emojicat-symbols</source>
<extracomment>Symbols</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="140"/>
<source>emojicat-travel</source>
<extracomment>Travel &amp; places</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="148"/>
<source>emojicat-misc</source>
<extracomment>Miscellaneous</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="190"/>
<source>cycle-cats-android</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="190"/>
<source>cycle-cats-desktop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="225"/>
<source>cycle-morphs-android</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="225"/>
<source>cycle-morphs-desktop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="258"/>
<source>cycle-colours-android</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="258"/>
<source>cycle-colours-desktop</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

BIN
i18n/translation_pt.qm Normal file

Binary file not shown.

103
i18n/translation_pt.ts Normal file
View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pt_BR">
<context>
<name>EmojiDrawer</name>
<message>
<location filename="../EmojiDrawer.qml" line="64"/>
<source>search</source>
<extracomment>Search...</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="76"/>
<source>emojicat-expressions</source>
<extracomment>Expressions</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="84"/>
<source>emojicat-activities</source>
<extracomment>Activities</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="92"/>
<source>emojicat-food</source>
<extracomment>Food, drink &amp; herbs</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="100"/>
<source>emojicat-gender</source>
<extracomment>Gender, relationships &amp; sexuality</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="108"/>
<source>emojicat-nature</source>
<extracomment>Nature and effects</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="116"/>
<source>emojicat-objects</source>
<extracomment>Objects</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="124"/>
<source>emojicat-people</source>
<extracomment>People and animals</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="132"/>
<source>emojicat-symbols</source>
<extracomment>Symbols</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="140"/>
<source>emojicat-travel</source>
<extracomment>Travel &amp; places</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="148"/>
<source>emojicat-misc</source>
<extracomment>Miscellaneous</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="190"/>
<source>cycle-cats-android</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="190"/>
<source>cycle-cats-desktop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="225"/>
<source>cycle-morphs-android</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="225"/>
<source>cycle-morphs-desktop</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="258"/>
<source>cycle-colours-android</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../EmojiDrawer.qml" line="258"/>
<source>cycle-colours-desktop</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

35
opaque.pro Normal file
View File

@ -0,0 +1,35 @@
QT += quick
#CONFIG += largefile
# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
#SOURCES += \
# main.go
RESOURCES += qml.qrc
TRANSLATIONS = i18n/translation_en.ts \
i18n/translation_de.ts \
i18n/translation_pt.ts \
i18n/translation_fr.ts
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

35
qml.qrc Normal file
View File

@ -0,0 +1,35 @@
<RCC>
<qresource prefix="/">
<file>./HLine.qml</file>
<file>./styles/CwtchTextFieldStyle.qml</file>
<file>./styles/CwtchComboBoxStyle.qml</file>
<file>./styles/CwtchTextAreaStyle.qml</file>
<file>./styles/CwtchExpandingButton.qml</file>
<file>./styles/CwtchProgress.qml</file>
<file>./ButtonTextField.qml</file>
<file>./IconTextField.qml</file>
<file>./EllipsisLabel.qml</file>
<file>./Badge.qml</file>
<file>./controls/Loader.qml</file>
<file>./controls/ImageButton.qml</file>
<file>./controls/FlagButton.qml</file>
<file>./controls/Variables.qml</file>
<file>./FontAwesome.qml</file>
<file>./Icon.qml</file>
<file>./TextField.qml</file>
<file>./PortraitRow.qml</file>
<file>./ScalingLabel.qml</file>
<file>./UnderlineTextField.qml</file>
<file>./EmojiDrawer.qml</file>
<file>./ToggleSwitch.qml</file>
<file>./Button.qml</file>
<file>./theme/ThemeType.qml</file>
<file>./theme/Theme.qml</file>
<file>./theme/CwtchDark.qml</file>
<file>./theme/CwtchLight.qml</file>
<file>./Portrait.qml</file>
<file>./Toolbar.qml</file>
<file>./fonts/Fonts.qml</file>
<file>./RadioButton.qml</file>
</qresource>
</RCC>