mirror of https://github.com/buggins/dlangui.git
osx hdpi fixes
This commit is contained in:
parent
3f8494c710
commit
5b97f99882
|
@ -52,13 +52,13 @@ struct Accelerator {
|
|||
version (OSX) {
|
||||
static if (true) {
|
||||
if (keyFlags & KeyFlag.Control)
|
||||
buf ~= "Ctrl+";
|
||||
buf ~= "⌃ "; //"Ctrl+";
|
||||
if (keyFlags & KeyFlag.Shift)
|
||||
buf ~= "Shift+";
|
||||
buf ~= "⇧ "; //"Shift+";
|
||||
if (keyFlags & KeyFlag.Option)
|
||||
buf ~= "Opt+";
|
||||
buf ~= "⌥ "; //"Opt+";
|
||||
if (keyFlags & KeyFlag.Command)
|
||||
buf ~= "Cmd+";
|
||||
buf ~= "⌘ "; //"Cmd+";
|
||||
} else {
|
||||
if (keyFlags & KeyFlag.Control)
|
||||
buf ~= "⌃";
|
||||
|
|
|
@ -348,7 +348,7 @@ private __gshared int PRIVATE_SCREEN_DPI_OVERRIDE = 0;
|
|||
return PRIVATE_SCREEN_DPI_OVERRIDE ? PRIVATE_SCREEN_DPI_OVERRIDE : PRIVATE_SCREEN_DPI;
|
||||
}
|
||||
|
||||
/// get screen DPI detection override value, if non 0 - this value is used instead of DPI detected by platform, if 0, value detected by platform will be used)
|
||||
/// get screen DPI detection override value, if non 0 - this value is used instead of DPI detected by platform, if 0, value detected by platform will be used
|
||||
@property int overrideScreenDPI() {
|
||||
return PRIVATE_SCREEN_DPI_OVERRIDE;
|
||||
}
|
||||
|
|
|
@ -1618,8 +1618,11 @@ bool sdlUpdateScreenDpi(int displayIndex = 0) {
|
|||
if (numDisplays < displayIndex + 1)
|
||||
return false;
|
||||
float hdpi = 0;
|
||||
if (SDL_GetDisplayDPI(displayIndex, null, &hdpi, null))
|
||||
float ddpi = 0;
|
||||
float vdpi = 0;
|
||||
if (SDL_GetDisplayDPI(displayIndex, &ddpi, &hdpi, &vdpi))
|
||||
return false;
|
||||
Log.d("SDL_GetDisplayDPI(", displayIndex, ") : ddpi=", ddpi, " hdpi=", hdpi, " vdpi=", vdpi);
|
||||
int idpi = cast(int)hdpi;
|
||||
if (idpi < 32 || idpi > 2000)
|
||||
return false;
|
||||
|
@ -1690,9 +1693,10 @@ int sdlmain(string[] args) {
|
|||
|
||||
Platform.setInstance(sdl);
|
||||
|
||||
sdlUpdateScreenDpi(0);
|
||||
|
||||
currentTheme = createDefaultTheme();
|
||||
|
||||
sdlUpdateScreenDpi(0);
|
||||
|
||||
Platform.instance.uiTheme = "theme_default";
|
||||
|
||||
|
|
Loading…
Reference in New Issue