popup cleanup

This commit is contained in:
Tanasart 2024-09-11 18:01:21 +07:00
parent 56e4982590
commit 3e4b61fc0b
3 changed files with 13 additions and 8 deletions

View File

@ -85,11 +85,14 @@ event_inherited();
dialog_w += ui(32);
var _mon = winMan_getData();
dialog_y = min(dialog_y, _mon[7] - WIN_Y - dialog_h - 2);
var _maxw = PREFERENCES.multi_window? _mon[6] - WIN_X : WIN_W;
var _maxh = PREFERENCES.multi_window? _mon[7] - WIN_Y : WIN_H;
dialog_y = min(dialog_y, _maxh - dialog_h - 2);
switch(align) {
case fa_left: dialog_x = round(min(dialog_x, _mon[6] - WIN_X - dialog_w - 2)); break;
case fa_center: dialog_x = round(min(dialog_x - dialog_w / 2, _mon[6] - WIN_X - dialog_w - 2)); break;
case fa_left: dialog_x = round(min(dialog_x, _maxw - dialog_w - 2)); break;
case fa_center: dialog_x = round(min(dialog_x - dialog_w / 2, _maxw - dialog_w - 2)); break;
case fa_right: dialog_x = round(max(dialog_x - dialog_w, 2)); break;
}
@ -119,6 +122,9 @@ event_inherited();
dialog_x = 0;
dialog_y = 0;
} else if(winwin_exists(window)) {
winwin_destroy(window);
}
}
#endregion

View File

@ -55,7 +55,6 @@
fpsr = 0;
_cursor_lock = false;
watcher_surface = surface_create(1, 1);
panelInit();

View File

@ -21,11 +21,11 @@
#macro DISPLAY_REFRESH CURRENT_PANEL = panelSerialize(true); display_refresh();
#endregion
function winManInit() { #region
function winManInit() {
if(OS == os_macosx) mac_window_init();
window_preminimize_rect = [ 0, 0, 1, 1 ];
} #endregion
}
function winMan_getData(curr = true) {
INLINE