mirror of https://github.com/buggins/dlangui.git
parent
c284461b50
commit
568b87cc5f
|
@ -929,15 +929,23 @@ class SDLPlatform : Platform {
|
||||||
override Window createWindow(dstring windowCaption, Window parent, uint flags = WindowFlag.Resizable, uint width = 0, uint height = 0) {
|
override Window createWindow(dstring windowCaption, Window parent, uint flags = WindowFlag.Resizable, uint width = 0, uint height = 0) {
|
||||||
setDefaultLanguageAndThemeIfNecessary();
|
setDefaultLanguageAndThemeIfNecessary();
|
||||||
int oldDPI = SCREEN_DPI;
|
int oldDPI = SCREEN_DPI;
|
||||||
SDLWindow res = new SDLWindow(this, windowCaption, parent, flags, width, height);
|
int newwidth = width;
|
||||||
_windowMap[res.windowId] = res;
|
int newheight = height;
|
||||||
version(Windows) {
|
version(Windows) {
|
||||||
width = pointsToPixels(width);
|
newwidth = pointsToPixels(width);
|
||||||
height = pointsToPixels(height);
|
newheight = pointsToPixels(height);
|
||||||
res.doResize(width, height);
|
|
||||||
}
|
}
|
||||||
if (oldDPI != SCREEN_DPI)
|
SDLWindow res = new SDLWindow(this, windowCaption, parent, flags, newwidth, newheight);
|
||||||
|
_windowMap[res.windowId] = res;
|
||||||
|
if (oldDPI != SCREEN_DPI) {
|
||||||
|
version(Windows) {
|
||||||
|
newwidth = pointsToPixels(width);
|
||||||
|
newheight = pointsToPixels(height);
|
||||||
|
if (newwidth != width || newheight != height)
|
||||||
|
SDL_SetWindowSize(res._win, newwidth, newheight);
|
||||||
|
}
|
||||||
onThemeChanged();
|
onThemeChanged();
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue