mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-23 12:26:59 +01:00
Save and re-apply window icon when changing window style.
(cherry picked from commit b268c4b4bc8a1c246984249b2ce88277df47fe78)
This commit is contained in:
parent
7a8b5a9a7b
commit
e7f9cc8db3
@ -2289,6 +2289,10 @@ void OS_Windows::_update_window_style(bool p_repaint, bool p_maximized) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (icon.is_valid()) {
|
||||||
|
set_icon(icon);
|
||||||
|
}
|
||||||
|
|
||||||
SetWindowPos(hWnd, video_mode.always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE);
|
SetWindowPos(hWnd, video_mode.always_on_top ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE);
|
||||||
|
|
||||||
if (p_repaint) {
|
if (p_repaint) {
|
||||||
@ -3017,9 +3021,12 @@ void OS_Windows::set_native_icon(const String &p_filename) {
|
|||||||
|
|
||||||
void OS_Windows::set_icon(const Ref<Image> &p_icon) {
|
void OS_Windows::set_icon(const Ref<Image> &p_icon) {
|
||||||
ERR_FAIL_COND(!p_icon.is_valid());
|
ERR_FAIL_COND(!p_icon.is_valid());
|
||||||
Ref<Image> icon = p_icon->duplicate();
|
if (icon != p_icon) {
|
||||||
if (icon->get_format() != Image::FORMAT_RGBA8)
|
icon = p_icon->duplicate();
|
||||||
|
if (icon->get_format() != Image::FORMAT_RGBA8) {
|
||||||
icon->convert(Image::FORMAT_RGBA8);
|
icon->convert(Image::FORMAT_RGBA8);
|
||||||
|
}
|
||||||
|
}
|
||||||
int w = icon->get_width();
|
int w = icon->get_width();
|
||||||
int h = icon->get_height();
|
int h = icon->get_height();
|
||||||
|
|
||||||
|
@ -317,6 +317,8 @@ class OS_Windows : public OS {
|
|||||||
|
|
||||||
uint32_t move_timer_id;
|
uint32_t move_timer_id;
|
||||||
|
|
||||||
|
Ref<Image> icon;
|
||||||
|
|
||||||
HCURSOR hCursor;
|
HCURSOR hCursor;
|
||||||
|
|
||||||
Size2 min_size;
|
Size2 min_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user