Merge pull request 'Adding Font Assets' (#279) from sarah-ui into master
the build was successful Details

This commit is contained in:
Dan Ballard 2020-04-27 14:31:20 -07:00
commit 1319674940
20 changed files with 64 additions and 6 deletions

27
qml/fonts/Fonts.qml Normal file
View File

@ -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"
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

1
qml/fonts/qmldir Normal file
View File

@ -0,0 +1 @@
singleton Fonts Fonts.qml

View File

@ -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 <IMG> 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)
}
}
}

View File

@ -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
}

View File

@ -38,5 +38,5 @@ Item {
readonly property int sidePaneMinSize: 700
readonly property int doublePaneMinSize: 1000
property ThemeType theme: CwtchLight { }
property ThemeType theme: CwtchDark { }
}

View File

@ -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

View File

@ -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 {

View File

@ -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

View File

@ -73,6 +73,7 @@ Item {
anchors.right: parent.right
width: parent.width
id: profile
color: Theme.backgroundMainColor
Portrait {
id: portrait

View File

@ -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
}