mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-02 08:49:20 -05:00
163ac4dcef
- Fixes for all files - constexpr cleanup - Cosmetic changes - Remove punctuation from the end of messages
38 lines
1.1 KiB
Lua
38 lines
1.1 KiB
Lua
asset.onInitialize(function ()
|
|
local scale = openspace.dpiScaling()
|
|
openspace.printInfo("Setting the DPI scaling factor to " .. tostring(scale))
|
|
|
|
|
|
if openspace.modules.isLoaded("CefWebGui") then
|
|
openspace.setPropertyValueSingle(
|
|
"Modules.CefWebGui.GuiScale",
|
|
openspace.getPropertyValue("Modules.CefWebGui.GuiScale") * scale
|
|
)
|
|
end
|
|
|
|
local dashboards = openspace.getProperty("Dashboard.*.FontSize");
|
|
for _, v in ipairs(dashboards) do
|
|
openspace.setPropertyValueSingle(
|
|
v,
|
|
openspace.getPropertyValue(v) * scale
|
|
)
|
|
end
|
|
|
|
local offset = openspace.getPropertyValue("Dashboard.StartPositionOffset")
|
|
openspace.setPropertyValueSingle(
|
|
"Dashboard.StartPositionOffset",
|
|
{ offset[1] * scale, offset[2] * scale }
|
|
)
|
|
end)
|
|
|
|
asset.meta = {
|
|
Name = "DPI Scaling",
|
|
Version = "1.0",
|
|
Description = [[Retrieves the DPI scaling from the operating system and applies it to a
|
|
few selected places to make them scale better on "large resolution but small size"
|
|
monitors]],
|
|
Author = "OpenSpace Team",
|
|
URL = "http://openspaceproject.com",
|
|
License = "MIT license"
|
|
}
|