diff --git a/qml/fonts/Fonts.qml b/qml/fonts/Fonts.qml new file mode 100644 index 00000000..5afd4e18 --- /dev/null +++ b/qml/fonts/Fonts.qml @@ -0,0 +1,27 @@ +pragma Singleton + + import QtQuick 2.5 + +QtObject { + + property FontLoader applicationFontBold: FontLoader { + id: opensansBold + source: "qrc:/qml/fonts/opensans/OpenSans-Bold.ttf" + } + + property FontLoader applicationFontExtrBold: FontLoader { + id: opensansExtraBold + source: "qrc:/qml/fonts/opensans/OpenSans-ExtraBold.ttf" + } + + property FontLoader applicationFontRegular: FontLoader { + id: opensansRegular + source: "qrc:/qml/fonts/opensans/OpenSans-Regular.ttf" + } + + property FontLoader applicationFontLight: FontLoader { + id: opensansLight + source: "qrc:/qml/fonts/opensans/OpenSans-Light.ttf" + } + +} \ No newline at end of file diff --git a/qml/fonts/opensans/OpenSans-Bold.ttf b/qml/fonts/opensans/OpenSans-Bold.ttf new file mode 100644 index 00000000..efdd5e84 Binary files /dev/null and b/qml/fonts/opensans/OpenSans-Bold.ttf differ diff --git a/qml/fonts/opensans/OpenSans-BoldItalic.ttf b/qml/fonts/opensans/OpenSans-BoldItalic.ttf new file mode 100644 index 00000000..9bf9b4e9 Binary files /dev/null and b/qml/fonts/opensans/OpenSans-BoldItalic.ttf differ diff --git a/qml/fonts/opensans/OpenSans-ExtraBold.ttf b/qml/fonts/opensans/OpenSans-ExtraBold.ttf new file mode 100644 index 00000000..67fcf0fb Binary files /dev/null and b/qml/fonts/opensans/OpenSans-ExtraBold.ttf differ diff --git a/qml/fonts/opensans/OpenSans-ExtraBoldItalic.ttf b/qml/fonts/opensans/OpenSans-ExtraBoldItalic.ttf new file mode 100644 index 00000000..08672280 Binary files /dev/null and b/qml/fonts/opensans/OpenSans-ExtraBoldItalic.ttf differ diff --git a/qml/fonts/opensans/OpenSans-Italic.ttf b/qml/fonts/opensans/OpenSans-Italic.ttf new file mode 100644 index 00000000..11785670 Binary files /dev/null and b/qml/fonts/opensans/OpenSans-Italic.ttf differ diff --git a/qml/fonts/opensans/OpenSans-Light.ttf b/qml/fonts/opensans/OpenSans-Light.ttf new file mode 100644 index 00000000..6580d3a1 Binary files /dev/null and b/qml/fonts/opensans/OpenSans-Light.ttf differ diff --git a/qml/fonts/opensans/OpenSans-LightItalic.ttf b/qml/fonts/opensans/OpenSans-LightItalic.ttf new file mode 100644 index 00000000..1e0c3319 Binary files /dev/null and b/qml/fonts/opensans/OpenSans-LightItalic.ttf differ diff --git a/qml/fonts/opensans/OpenSans-Regular.ttf b/qml/fonts/opensans/OpenSans-Regular.ttf new file mode 100644 index 00000000..29bfd35a Binary files /dev/null and b/qml/fonts/opensans/OpenSans-Regular.ttf differ diff --git a/qml/fonts/opensans/OpenSans-SemiBold.ttf b/qml/fonts/opensans/OpenSans-SemiBold.ttf new file mode 100644 index 00000000..54e7059c Binary files /dev/null and b/qml/fonts/opensans/OpenSans-SemiBold.ttf differ diff --git a/qml/fonts/opensans/OpenSans-SemiBoldItalic.ttf b/qml/fonts/opensans/OpenSans-SemiBoldItalic.ttf new file mode 100644 index 00000000..aebcf142 Binary files /dev/null and b/qml/fonts/opensans/OpenSans-SemiBoldItalic.ttf differ diff --git a/qml/fonts/qmldir b/qml/fonts/qmldir new file mode 100644 index 00000000..8c898cef --- /dev/null +++ b/qml/fonts/qmldir @@ -0,0 +1 @@ +singleton Fonts Fonts.qml \ No newline at end of file diff --git a/qml/main.qml b/qml/main.qml index 64bdb244..447ba0c2 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -5,6 +5,7 @@ import QtQuick.Controls.Material 2.0 import QtQuick.Layouts 1.3 import QtQuick.Window 2.11 +import "fonts" import "fonts/Twemoji.js" as T import "fonts/MutantStandard.js" as Mutant import "overlays" @@ -14,20 +15,23 @@ import "theme" import "utils.js" as Utils + ApplicationWindow { id: windowItem width: 1200 height: 800 visible: true title: "cwtch" + "" + font.family: Fonts.applicationFontRegular.name + font.styleName: "Light" readonly property real ratio: height / width - readonly property string cwtch_background_color: '#EEEEFF' - readonly property string cwtch_color: '#B09CBC' - readonly property string cwtch_dark_color: '#4B3557' + readonly property string cwtch_background_color: '#FF0000' + readonly property string cwtch_color: '#00FF00' + readonly property string cwtch_dark_color: '#0000FF' FontAwesome { // PRETTY BUTTON ICONS id: awesome @@ -38,6 +42,8 @@ ApplicationWindow { source: "qrc:/qml/fonts/AdobeBlank.ttf" } + + function parse(text, size, isntEditable) { // REPLACE EMOJI WITH TAGS T.twemoji.base = gcd.assetPath + "twemoji/" T.twemoji.ext = ".png" @@ -115,7 +121,7 @@ ApplicationWindow { Rectangle { // Profile login/management pane anchors.fill: parent - color: "#EEEEFF" + color: Theme.backgroundMainColor ProfileAddEditPane{ @@ -252,6 +258,8 @@ ApplicationWindow { if (Qt.application.state == 4) { // Active gcd.onActivate() + console.log(Fonts.applicationFontRegular.name) + console.log(Fonts.applicationFontBold.name) } } } diff --git a/qml/panes/PeerSettingsPane.qml b/qml/panes/PeerSettingsPane.qml index 64a33b70..5551ce33 100644 --- a/qml/panes/PeerSettingsPane.qml +++ b/qml/panes/PeerSettingsPane.qml @@ -38,11 +38,14 @@ ColumnLayout { // peerSettingsPane id: tehcol width: root.width leftPadding: 10 + padding:10 spacing: 5 Widgets.EllipsisLabel { color: Theme.mainTextColor text: qsTr("address-label") + font.styleName: "ExtraBold" + font.pointSize: 15 * gcd.themeScale } Widgets.ButtonTextField { @@ -62,6 +65,8 @@ ColumnLayout { // peerSettingsPane Widgets.EllipsisLabel { color: Theme.mainTextColor text: qsTr("display-name-label") + font.styleName: "ExtraBold" + font.pointSize: 15 * gcd.themeScale } diff --git a/qml/theme/Theme.qml b/qml/theme/Theme.qml index 859d0de4..9da73664 100644 --- a/qml/theme/Theme.qml +++ b/qml/theme/Theme.qml @@ -38,5 +38,5 @@ Item { readonly property int sidePaneMinSize: 700 readonly property int doublePaneMinSize: 1000 - property ThemeType theme: CwtchLight { } + property ThemeType theme: CwtchDark { } } \ No newline at end of file diff --git a/qml/widgets/Button.qml b/qml/widgets/Button.qml index 4090c8ad..32011ce3 100644 --- a/qml/widgets/Button.qml +++ b/qml/widgets/Button.qml @@ -44,6 +44,8 @@ Rectangle { Label { id: buttonText + font.family: Fonts.applicationFontRegular.name + font.styleName: "ExtraBold" font.pixelSize: button.height / 2 color: Theme.defaultButtonTextColor anchors.left: ico.right diff --git a/qml/widgets/ContactList.qml b/qml/widgets/ContactList.qml index 67244d5c..b8103a5e 100644 --- a/qml/widgets/ContactList.qml +++ b/qml/widgets/ContactList.qml @@ -3,6 +3,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.4 import QtQuick.Controls.Material 2.0 import QtQuick.Layouts 1.3 +import "../theme" ColumnLayout { id: root @@ -38,7 +39,17 @@ ColumnLayout { ScrollBar.vertical: ScrollBar { - policy: ScrollBar.AlwaysOn + policy: ScrollBar.AsNeeded + background: Rectangle { + implicitWidth: 6 + + color: Theme.backgroundMainColor + } + contentItem: Rectangle { + implicitWidth: 6 + implicitHeight:1 + color: Theme.backgroundPaneColor + } } ColumnLayout { diff --git a/qml/widgets/EllipsisLabel.qml b/qml/widgets/EllipsisLabel.qml index 71e6f09e..9f6fd8c3 100644 --- a/qml/widgets/EllipsisLabel.qml +++ b/qml/widgets/EllipsisLabel.qml @@ -16,6 +16,7 @@ Item { property alias pixelSize: label.font.pixelSize property alias weight: label.font.weight property alias strikeout: label.font.strikeout + property alias font: label.font height: textMetric.height width: textMetric.width + 10 diff --git a/qml/widgets/MyProfile.qml b/qml/widgets/MyProfile.qml index 0fea4fc9..bbfb44fc 100644 --- a/qml/widgets/MyProfile.qml +++ b/qml/widgets/MyProfile.qml @@ -73,6 +73,7 @@ Item { anchors.right: parent.right width: parent.width id: profile + color: Theme.backgroundMainColor Portrait { id: portrait diff --git a/qml/widgets/StackToolbar.qml b/qml/widgets/StackToolbar.qml index eb47127e..82d063c8 100644 --- a/qml/widgets/StackToolbar.qml +++ b/qml/widgets/StackToolbar.qml @@ -42,6 +42,8 @@ Rectangle { // OVERHEAD BAR ON STACK PANE ScalingLabel { // TEXT id: lbl text: "open privacy exec" + font.family: Fonts.applicationFontRegular.name + font.styleName: "ExtraBold" anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter }