diff --git a/gui/components/Footer.qml b/gui/components/Footer.qml index 71477b4c0f964b59b0b4a108d872e00db20a4d22..11f511421418a9dcc1e31ec8271a805417b1702e 100644 --- a/gui/components/Footer.qml +++ b/gui/components/Footer.qml @@ -11,7 +11,7 @@ ToolBar { Material.background: Theme.bgColor Material.foreground: "black" Material.elevation: 0 - visible: stackView.depth > 1 && ctx !== undefined ? false : true + visible: isFooterVisible() Item { @@ -186,4 +186,12 @@ ToolBar { return false } } + + function isFooterVisible() { + console.debug(stackView.depth) + if (stackView.depth > 1) { + return false + } + return true + } } diff --git a/gui/components/Locations.qml b/gui/components/Locations.qml index a93700ab2bf0da1f8da2e41831471313a2003f1c..097f9fe0696eb971431e1c2e0029bfca26965617 100644 --- a/gui/components/Locations.qml +++ b/gui/components/Locations.qml @@ -60,6 +60,7 @@ ThemedPage { id: recommendedLabel //: Location Selection: label for radio button that selects automatically text: qsTr("Recommended") + font.weight: Font.Bold font.bold: true } WrappedRadioButton { @@ -203,7 +204,7 @@ ThemedPage { } }, State { - when: ctx && ctx.status == "on" + when: ctx != undefined && ctx.status == "on" PropertyChanges { target: manualLabel text: manualSelectionLabel diff --git a/gui/components/MainView.qml b/gui/components/MainView.qml index 95bb2128322ef5887479b733399765c50aad1d5c..c103565d3d2597ea9f599eb3480ebea35db9aaea 100644 --- a/gui/components/MainView.qml +++ b/gui/components/MainView.qml @@ -130,7 +130,7 @@ Page { } font.pixelSize: 14 textFormat: Text.RichText - text: getLink(ctx.donateURL) + text: getLink(ctx) onLinkActivated: Qt.openUrlExternally(ctx.donateURL) } @@ -150,7 +150,11 @@ Page { onYes: Qt.openUrlExternally(ctx.donateURL) } - function getLink(url) { + function getLink(ctx) { + if (!ctx) { + return "" + } + let url = ctx.donateURL return "<style>a:link {color:'" + Theme.blue + "'; }</style><a href='#'>" + url + "</a>" } diff --git a/gui/components/Splash.qml b/gui/components/Splash.qml index 625ab1880866648d6ccba31b4a9152ad6ef8691d..cf75108a43150337a96b38105286088426c248d9 100644 --- a/gui/components/Splash.qml +++ b/gui/components/Splash.qml @@ -57,7 +57,7 @@ Page { if (root.error != "") { return } - if (ctx && ctx.isReady) { + if (ctx && ctx.isReady || qmlDebug) { splashTimer.stop() loader.source = "MainView.qml" } else { diff --git a/gui/components/VPNState.qml b/gui/components/VPNState.qml index 189fd0b0aab25a82bc4d10c452e077d34b4f57f1..64a109a7fc59136d3ad1a77cff38b95b2180dd89 100644 --- a/gui/components/VPNState.qml +++ b/gui/components/VPNState.qml @@ -20,7 +20,7 @@ StateGroup { name: initializing }, State { - when: ctx && ctx.status == "off" && startingUI == true + when: ctx != undefined && ctx.status == "off" && startingUI == true PropertyChanges { target: connectionState text: qsTr("Connecting") diff --git a/gui/gui.qrc b/gui/gui.qrc index 5aeb85b9cc4c23c5346d5b3f83e23d0ba8e907a6..31082eebcfbdc3dda6281211a92d47911ffe05b9 100644 --- a/gui/gui.qrc +++ b/gui/gui.qrc @@ -62,6 +62,7 @@ <file alias="poppins-bold.ttf">resources/fonts/Poppins-Light.ttf</file> <file alias="monserrat-bold.ttf">resources/fonts/Montserrat-SemiBold.ttf</file> <file alias="roboto.ttf">resources/fonts/Roboto-Regular.ttf</file> + <file alias="roboto-bold.ttf">resources/fonts/Roboto-Bold.ttf</file> <!-- begin, to remove --> <file>qml/VpnState.qml</file> diff --git a/gui/main.cpp b/gui/main.cpp index be1be0aadc4efdce425e2e136e3f8de6db2017d8..581aeddca5617f20622918151375c6b8b608d90d 100644 --- a/gui/main.cpp +++ b/gui/main.cpp @@ -1,5 +1,6 @@ #include <csignal> #include <unistd.h> +#include <QtGui/qfontdatabase.h> #include <QApplication> #include <QTimer> #include <QTranslator> @@ -55,6 +56,12 @@ int main(int argc, char **argv) { Backend backend; + const int fontId = QFontDatabase::addApplicationFont(":/resources/fonts/Roboto-Regular.ttf"); + if (fontId == -1) + qWarning() << "Failed to add Roboto as app font"; + else + qDebug() << QFontDatabase::applicationFontFamilies(fontId); + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setApplicationVersion(backend.getVersion()); QApplication app(argc, argv); diff --git a/gui/main.qml b/gui/main.qml index c063739774171129745079d1c8d052d754538e2a..7469620f63f6093d6c8320febb488075123652cb 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -68,7 +68,18 @@ ApplicationWindow { source: "qrc:/monserrat-bold.ttf" } - font.family: lightFont.name + FontLoader { + id: robotoFont + source: "qrc:/roboto.ttf" + } + + FontLoader { + id: robotoBoldFont + source: "qrc:/roboto-bold.ttf" + } + + font.family: robotoFont.name + font.weight: Font.Light Loader { id: loader diff --git a/gui/qtquickcontrols2.conf b/gui/qtquickcontrols2.conf index 1e387cc686d7ccfca23d8b04794c20bfb112285d..de2b30f18b3fb1c1649a43cadf7b017b83ccab42 100644 --- a/gui/qtquickcontrols2.conf +++ b/gui/qtquickcontrols2.conf @@ -1,6 +1,12 @@ +[Default] +Font\Family=Poppins + [Controls] Style=Material [Material] Theme=Light Variant=Dense + +[Material\Font] +Family=Poppins diff --git a/gui/resources/fonts/Roboto-Bold.ttf b/gui/resources/fonts/Roboto-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..3742457900d51ae5c34ed53657ed8a72f17f19c6 Binary files /dev/null and b/gui/resources/fonts/Roboto-Bold.ttf differ