diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-12-08 19:51:42 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-12-08 19:54:35 +0100 |
commit | 68e9db0776225168bbb52d164b05b784466a28d8 (patch) | |
tree | 525687324ff88b17522bfec5691799d5677dd497 /gui/main.qml | |
parent | 371ee5167ce5e6fccc5a2a159343658f01ba74f7 (diff) |
[ui] theming stub
Diffstat (limited to 'gui/main.qml')
-rw-r--r-- | gui/main.qml | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/gui/main.qml b/gui/main.qml index 1424cc6..00a84fc 100644 --- a/gui/main.qml +++ b/gui/main.qml @@ -1,11 +1,3 @@ - - -/* - TODO (ui rewrite) - See https://0xacab.org/leap/bitmask-vpn/-/issues/523 - - [ ] control actions from systray - - [ ] add gateway to systray -*/ import QtQuick 2.0 import QtQuick.Controls 2.4 import QtQuick.Dialogs 1.2 @@ -21,6 +13,7 @@ ApplicationWindow { property int appHeight: 460 property int appWidth: 280 + property alias customTheme: themeLoader.item width: appWidth minimumWidth: appWidth @@ -84,6 +77,12 @@ ApplicationWindow { anchors.fill: parent } + Loader { + id: themeLoader + source: loadTheme() + } + + Systray { id: systray } @@ -114,24 +113,6 @@ ApplicationWindow { if (isAutoLocation()) { root.selectedGateway = "auto" } - - // TODO check donation - //if (needsDonate && !shownDonate) { - // donate.visible = true; - // shownDonate = true; - // // move this to onClick of "close" for widget - // backend.donateSeen(); - //} - - /* - TODO libraries need login - if (ctx.loginDialog == 'true') { - login.visible = true - } - if (ctx.loginOk == 'true') { - loginOk.visible = true - } - */ } } @@ -173,6 +154,21 @@ ApplicationWindow { requestActivate() } + function loadTheme() { + let arr = flavor.split("/") + var providerFlavor = arr[arr.length-1] + console.debug("flavor: " + providerFlavor) + if (providerFlavor == "riseup-vpn") { + return "themes/Riseup.qml" + } else if (providerFlavor== "calyx-vpn") { + return "themes/Calyx.qml" + } else { + // we should do a Default theme, with a fallback + // mechanism + return "Riseup.qml" + } + } + onSceneGraphError: function (error, msg) { console.debug("ERROR while initializing scene") console.debug(msg) |