add ui and viewport scale option, fix combobox items height from parent

This commit is contained in:
2019-08-04 12:00:49 +02:00
parent a1436eec4a
commit cc087746bd
10 changed files with 107 additions and 39 deletions

View File

@@ -839,11 +839,16 @@ int main(int argc, char** argv)
RegisterClass(&wc);
auto monitor = MonitorFromWindow(0, MONITOR_DEFAULTTOPRIMARY);
auto x = unsigned{96};
auto y = unsigned{96};
auto x = unsigned{ 96 };
auto y = unsigned{ 96 };
if (GetDpiForMonitor_fn)
GetDpiForMonitor_fn(monitor, MDT_EFFECTIVE_DPI, &x, &y);
App::I->zoom *= (float)x / 96.f;
App::I->display_density = (float)x / 96.f;
if (Settings::has("ui-scale"))
App::I->zoom = Settings::value<Serializer::Float>("ui-scale");
else
App::I->zoom = (float)x / 96.f;
int show_cmd = SW_NORMAL;
Settings::value<Serializer::Integer>("window-show-cmd", show_cmd);