diff --git a/dust3d.pro b/dust3d.pro index 44e09637..800fa0b4 100644 --- a/dust3d.pro +++ b/dust3d.pro @@ -4,10 +4,10 @@ DEFINES += NDEBUG RESOURCES += resources.qrc isEmpty(HUMAN_VERSION) { - HUMAN_VERSION = "1.0.0-beta.7" + HUMAN_VERSION = "1.0.0-beta.8" } isEmpty(VERSION) { - VERSION = 1.0.0.7 + VERSION = 1.0.0.8 } REPOSITORY_URL = "https://github.com/huxingyi/dust3d" @@ -16,7 +16,7 @@ REFERENCE_GUIDE_URL = "http://docs.dust3d.org" QMAKE_TARGET_COMPANY = Dust3D QMAKE_TARGET_PRODUCT = Dust3D -QMAKE_TARGET_DESCRIPTION = "Aim to be a quick modeling tool for game development" +QMAKE_TARGET_DESCRIPTION = "Dust3D is a cross-platform open-source 3D modeling software" QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2018 Dust3D Project. All Rights Reserved." DEFINES += "PROJECT_DEFINED_APP_COMPANY=\"\\\"$$QMAKE_TARGET_COMPANY\\\"\"" diff --git a/src/documentwindow.cpp b/src/documentwindow.cpp index 36db3427..245d8933 100644 --- a/src/documentwindow.cpp +++ b/src/documentwindow.cpp @@ -1031,7 +1031,7 @@ void DocumentWindow::initLockButton(QPushButton *button) { QFont font; font.setWeight(QFont::Light); - //font.setPixelSize(Theme::toolIconFontSize); + font.setPixelSize(Theme::toolIconFontSize); font.setBold(false); button->setFont(font); diff --git a/src/main.cpp b/src/main.cpp index 0de75df8..4efe23eb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,6 +46,8 @@ int main(int argc, char ** argv) font.setBold(false); QApplication::setFont(font); + Theme::initAwsomeBaseSizes(); + DocumentWindow::createDocumentWindow(); return app.exec(); diff --git a/src/theme.cpp b/src/theme.cpp index 9cd6d7b2..cdddc774 100644 --- a/src/theme.cpp +++ b/src/theme.cpp @@ -1,3 +1,7 @@ +#include +#include +#include +#include #include "theme.h" // Red @@ -29,16 +33,38 @@ float Theme::edgeAlpha = 1.0; float Theme::fillAlpha = 50.0 / 255; int Theme::skeletonNodeBorderSize = 0; int Theme::skeletonEdgeWidth = 0; -int Theme::toolIconFontSize = 16; -int Theme::toolIconSize = 24; -int Theme::miniIconFontSize = 9; -int Theme::miniIconSize = 15; -int Theme::partPreviewImageSize = (Theme::miniIconSize * 3); -int Theme::materialPreviewImageSize = 75; -int Theme::posePreviewImageSize = 75; -int Theme::motionPreviewImageSize = 75; -int Theme::sidebarPreferredWidth = 200; -int Theme::normalButtonSize = Theme::toolIconSize * 2; +int Theme::toolIconFontSize = 0; +int Theme::toolIconSize = 0; +int Theme::miniIconFontSize = 0; +int Theme::miniIconSize = 0; +int Theme::partPreviewImageSize = 0; +int Theme::materialPreviewImageSize = 0; +int Theme::posePreviewImageSize = 0; +int Theme::motionPreviewImageSize = 0; +int Theme::sidebarPreferredWidth = 0; +int Theme::normalButtonSize = 0; + +void Theme::initAwsomeBaseSizes() +{ + Theme::toolIconFontSize = QApplication::font().pixelSize(); + if (-1 == Theme::toolIconFontSize) { + double dpi = QGuiApplication::primaryScreen()->physicalDotsPerInch(); + Theme::toolIconFontSize = (float)QApplication::font().pointSize() / 72 * dpi; + } + Theme::toolIconFontSize *= 0.7; + + Theme::toolIconSize = (int)(Theme::toolIconFontSize * 1.67); + Theme::miniIconFontSize = (int)(Theme::toolIconFontSize * 0.64); + Theme::miniIconSize = (int)(Theme::miniIconFontSize * 1.67); + Theme::partPreviewImageSize = (Theme::miniIconSize * 3); + Theme::materialPreviewImageSize = 75; + Theme::posePreviewImageSize = 75; + Theme::motionPreviewImageSize = 75; + Theme::sidebarPreferredWidth = 200; + Theme::normalButtonSize = Theme::toolIconSize * 2; + + qDebug() << "Theme::toolIconFontSize:" << Theme::toolIconFontSize; +} QtAwesome *Theme::awesome() { diff --git a/src/theme.h b/src/theme.h index e0867f6c..b8a32433 100644 --- a/src/theme.h +++ b/src/theme.h @@ -50,6 +50,7 @@ public: static void updateAwesomeMiniButton(QPushButton *button, QChar icon, bool highlighted, bool unnormal=false); static void initAwesomeToolButton(QPushButton *button); static void initAwesomeToolButtonWithoutFont(QPushButton *button); + static void initAwsomeBaseSizes(); }; #endif