Skip to content
Snippets Groups Projects
Unverified Commit 312fb786 authored by Kali Kaneko's avatar Kali Kaneko
Browse files

[bug] minor, recurrent gotchas

-QApplication, no QGuiApplication: the later avoids the systray to
display
- Workaround for invisible app icons when vendoring
- Make border visible for snaps
parent 5a8bee2c
Branches
Tags
No related merge requests found
Pipeline #70701 failed
...@@ -87,7 +87,7 @@ function buildQmake { ...@@ -87,7 +87,7 @@ function buildQmake {
echo "[+] Now building Qml app with Qt qmake" echo "[+] Now building Qml app with Qt qmake"
echo "[+] Using qmake in:" $QMAKE echo "[+] Using qmake in:" $QMAKE
mkdir -p $QTBUILD mkdir -p $QTBUILD
$QMAKE -early QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX -o "$QTBUILD/Makefile" CONFIG+=release VENDOR_PATH=${VENDOR_PATH} $PROJECT $QMAKE -early QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX -o "$QTBUILD/Makefile" CONFIG+=release VENDOR_PATH="${VENDOR_PATH}" $PROJECT
#CONFIG=+force_debug_info CONFIG+=debug CONFIG+=debug_and_release #CONFIG=+force_debug_info CONFIG+=debug CONFIG+=debug_and_release
} }
... ...
......
...@@ -49,7 +49,7 @@ T.Button { ...@@ -49,7 +49,7 @@ T.Button {
radius: 4 radius: 4
border.color: "black" border.color: "black"
border.width: 2 border.width: 1
color: !control.enabled ? control.Material.buttonDisabledColor : control.highlighted ? control.Material.highlightedButtonColor : Theme.buttonColor color: !control.enabled ? control.Material.buttonDisabledColor : control.highlighted ? control.Material.highlightedButtonColor : Theme.buttonColor
PaddedRectangle { PaddedRectangle {
...@@ -69,7 +69,7 @@ T.Button { ...@@ -69,7 +69,7 @@ T.Button {
// to set Material.elevation as well // to set Material.elevation as well
layer.enabled: true // control.enabled && control.Material.buttonColor.a > 0 layer.enabled: true // control.enabled && control.Material.buttonColor.a > 0
/* /* this is trouble in the canned Qt version for snaps, so let's pass for now
layer.effect: ElevationEffect { layer.effect: ElevationEffect {
elevation: control.Material.elevation elevation: control.Material.elevation
} }
... ...
......
...@@ -50,7 +50,7 @@ void catchUnixSignals(std::initializer_list<int> quitSignals) { ...@@ -50,7 +50,7 @@ void catchUnixSignals(std::initializer_list<int> quitSignals) {
auto handler = [](int sig) -> void { auto handler = [](int sig) -> void {
printf("\nCatched signal(%d): quitting\n", sig); printf("\nCatched signal(%d): quitting\n", sig);
Quit(); Quit();
QGuiApplication::quit(); QApplication::quit();
}; };
sigset_t blocking_mask; sigset_t blocking_mask;
...@@ -72,7 +72,11 @@ int main(int argc, char **argv) { ...@@ -72,7 +72,11 @@ int main(int argc, char **argv) {
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setApplicationVersion(backend.getVersion()); QApplication::setApplicationVersion(backend.getVersion());
QGuiApplication app(argc, argv); // There's a legend about brave coders than, from time to time, have the urge to change
// the app object to a QGuiApplication. Resist the temptation, oh coder
// from the future, or otherwise ye shall be punished for long hours wondering
// why yer little systray resists to be displayed.
QApplication app(argc, argv);
app.setQuitOnLastWindowClosed(false); app.setQuitOnLastWindowClosed(false);
app.setAttribute(Qt::AA_UseHighDpiPixmaps); app.setAttribute(Qt::AA_UseHighDpiPixmaps);
...@@ -179,7 +183,14 @@ int main(int argc, char **argv) { ...@@ -179,7 +183,14 @@ int main(int argc, char **argv) {
} }
/* set window icon */ /* set window icon */
app.setWindowIcon(QIcon(":/vendor/icon.svg")); /* this one is set in the vendor.qrc resources, that needs to be passed to the project */
/* there's something weird with icons being cached, need to investigate */
if (appName == "CalyxVPN") {
qDebug() << "setting calyx logo";
app.setWindowIcon(QIcon(":/vendor/calyx.svg"));
} else if (appName == "RiseupVPN") {
app.setWindowIcon(QIcon(":/vendor/riseup.svg"));
}
/* load translations */ /* load translations */
QTranslator translator; QTranslator translator;
...@@ -227,7 +238,7 @@ int main(int argc, char **argv) { ...@@ -227,7 +238,7 @@ int main(int argc, char **argv) {
/* connect quitDone signal, exit app */ /* connect quitDone signal, exit app */
QObject::connect(&backend, &Backend::quitDone, []() { QObject::connect(&backend, &Backend::quitDone, []() {
QGuiApplication::quit(); QApplication::quit();
}); });
/* register statusChanged callback with CGO */ /* register statusChanged callback with CGO */
... ...
......
<RCC> <RCC>
<qresource prefix="/vendor/"> <qresource prefix="/vendor/">
<file alias="icon.svg">assets/icon.svg</file> <file alias="provider.svg">assets/icon.svg</file>
<file alias="riseup.svg">riseup/assets/icon.svg</file>
<file alias="calyx.svg">calyx/assets/icon.svg</file>
</qresource> </qresource>
</RCC> </RCC>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment