From cc40ade66fccf8d970be34b460805e751a071388 Mon Sep 17 00:00:00 2001 From: reionwong Date: Tue, 17 Aug 2021 09:55:25 +0800 Subject: [PATCH] Set window icon --- main.cpp | 6 +++++- qml/StandardButton.qml | 1 + qml/StandardPad.qml | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 024fc6c..ca4b7d4 100644 --- a/main.cpp +++ b/main.cpp @@ -22,13 +22,17 @@ #include #include #include +#include #include #include "calcengine.h" int main(int argc, char *argv[]) { - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps, true); + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); + QGuiApplication app(argc, argv); + app.setWindowIcon(QIcon::fromTheme("cutefish-calculator")); qmlRegisterType("Cutefish.Calculator", 1, 0, "CalcEngine"); diff --git a/qml/StandardButton.qml b/qml/StandardButton.qml index bc5a788..ab77e20 100644 --- a/qml/StandardButton.qml +++ b/qml/StandardButton.qml @@ -54,6 +54,7 @@ Item { sourceSize: Qt.size(width, height) source: control.icon ? control.icon : "" visible: _icon.status === Image.Ready + smooth: false } Label { diff --git a/qml/StandardPad.qml b/qml/StandardPad.qml index 3f22d22..6d9aaf1 100644 --- a/qml/StandardPad.qml +++ b/qml/StandardPad.qml @@ -29,11 +29,11 @@ Item { StandardButton { text: "4"; onClicked: control.pressed(text) } StandardButton { text: "5"; onClicked: control.pressed(text) } StandardButton { text: "6"; onClicked: control.pressed(text) } - StandardButton { text: "-"; textColor: FishUI.Theme.highlightColor; onClicked: control.pressed(text) } + StandardButton { text: "-"; textColor: FishUI.Theme.highlightColor; onClicked: control.pressed(text) } StandardButton { text: "1"; onClicked: control.pressed(text) } StandardButton { text: "2"; onClicked: control.pressed(text) } StandardButton { text: "3"; onClicked: control.pressed(text) } - StandardButton { text: "+"; textColor: FishUI.Theme.highlightColor; onClicked: control.pressed(text) } + StandardButton { text: "+"; textColor: FishUI.Theme.highlightColor; onClicked: control.pressed(text) } StandardButton { text: "0"; onClicked: control.pressed(text) } StandardButton { text: "."; onClicked: control.pressed(text) } StandardButton { text: "()"; onClicked: control.pressed(text) }