diff --git a/plugins/builtin/include/content/views/view_settings.hpp b/plugins/builtin/include/content/views/view_settings.hpp index b99bec0dd..a7095786a 100644 --- a/plugins/builtin/include/content/views/view_settings.hpp +++ b/plugins/builtin/include/content/views/view_settings.hpp @@ -10,6 +10,7 @@ namespace hex::plugin::builtin { ~ViewSettings() override; void drawContent() override; + void drawAlwaysVisibleContent() override; [[nodiscard]] bool shouldDraw() const override { return true; } [[nodiscard]] bool hasViewMenuItemEntry() const override { return false; } diff --git a/plugins/builtin/source/content/init_tasks.cpp b/plugins/builtin/source/content/init_tasks.cpp index 8f3443c02..84337ac60 100644 --- a/plugins/builtin/source/content/init_tasks.cpp +++ b/plugins/builtin/source/content/init_tasks.cpp @@ -107,13 +107,13 @@ namespace hex::plugin::builtin { } bool configureUIScale() { - int interfaceScaleSetting = int(ContentRegistry::Settings::read("hex.builtin.setting.interface", "hex.builtin.setting.interface.scaling_factor", 0.0F).get() * 10.0F); + int interfaceScaleSetting = int(ContentRegistry::Settings::read("hex.builtin.setting.interface", "hex.builtin.setting.interface.scaling_factor", 1.0F).get() * 10.0F); float interfaceScaling; if (interfaceScaleSetting == 0) interfaceScaling = ImHexApi::System::getNativeScale(); else - interfaceScaling = int(interfaceScaleSetting / 10.0F); + interfaceScaling = interfaceScaleSetting / 10.0F; ImHexApi::System::impl::setGlobalScale(interfaceScaling); @@ -121,7 +121,10 @@ namespace hex::plugin::builtin { } bool loadFontsImpl(bool loadUnicode) { - const float defaultFontSize = ImHexApi::Fonts::DefaultFontSize * std::round(ImHexApi::System::getGlobalScale()); + float defaultFontSize = ImHexApi::Fonts::DefaultFontSize * ImHexApi::System::getGlobalScale(); + + if (defaultFontSize == 0.0F) + defaultFontSize = ImHexApi::Fonts::DefaultFontSize; // Reset used font size back to the default size ImHexApi::Fonts::impl::setFontSize(defaultFontSize); @@ -348,8 +351,8 @@ namespace hex::plugin::builtin { } void addInitTasks() { + ImHexApi::System::addStartupTask("Configuring UI scale", true, configureUIScale); ImHexApi::System::addStartupTask("Loading fonts", true, loadFonts); ImHexApi::System::addStartupTask("Checking for updates", true, checkForUpdates); - ImHexApi::System::addStartupTask("Configuring UI scale", true, configureUIScale); } } \ No newline at end of file diff --git a/plugins/builtin/source/content/views/view_settings.cpp b/plugins/builtin/source/content/views/view_settings.cpp index 8c47e4a24..6438af085 100644 --- a/plugins/builtin/source/content/views/view_settings.cpp +++ b/plugins/builtin/source/content/views/view_settings.cpp @@ -103,7 +103,9 @@ namespace hex::plugin::builtin { ImGui::EndTabBar(); } + } + void ViewSettings::drawAlwaysVisibleContent() { // If a restart is required, ask the user if they want to restart if (!this->getWindowOpenState() && this->m_restartRequested) { PopupQuestion::open("hex.builtin.view.settings.restart_question"_lang, @@ -115,4 +117,5 @@ namespace hex::plugin::builtin { } } + }