ui: Increase window size when a bigger font is being used
This commit is contained in:
parent
0c0caf6942
commit
aa01d58b33
@ -210,6 +210,7 @@ namespace hex {
|
|||||||
|
|
||||||
std::map<std::string, std::string> &getInitArguments();
|
std::map<std::string, std::string> &getInitArguments();
|
||||||
|
|
||||||
|
constexpr static float DefaultFontSize = 13.0;
|
||||||
const std::fs::path &getCustomFontPath();
|
const std::fs::path &getCustomFontPath();
|
||||||
float getFontSize();
|
float getFontSize();
|
||||||
|
|
||||||
|
@ -455,7 +455,8 @@ namespace hex {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (view->isAvailable()) {
|
if (view->isAvailable()) {
|
||||||
ImGui::SetNextWindowSizeConstraints(scaled(view->getMinSize()), scaled(view->getMaxSize()));
|
float fontScaling = std::max(1.0F, ImHexApi::System::getFontSize() / ImHexApi::System::DefaultFontSize);
|
||||||
|
ImGui::SetNextWindowSizeConstraints(view->getMinSize() * fontScaling, view->getMaxSize() * fontScaling);
|
||||||
view->drawContent();
|
view->drawContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -484,7 +484,7 @@ namespace hex::plugin::builtin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If a custom font has been loaded now, also load the font size
|
// If a custom font has been loaded now, also load the font size
|
||||||
float fontSize = 13.0F * ImHexApi::System::getGlobalScale();
|
float fontSize = ImHexApi::System::DefaultFontSize * ImHexApi::System::getGlobalScale();
|
||||||
if (!fontFile.empty()) {
|
if (!fontFile.empty()) {
|
||||||
ImHexApi::System::impl::setCustomFontPath(fontFile);
|
ImHexApi::System::impl::setCustomFontPath(fontFile);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user