16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 01:59:19 +02:00

Make launcher respond to window resize

This commit is contained in:
jakubg1
2025-09-09 17:08:23 +02:00
parent c217081823
commit 9fa22d81e5
12 changed files with 105 additions and 133 deletions

View File

@@ -3,8 +3,7 @@
#include "application.h"
#include "translation.h"
launcher_ui::launcher_ui()
: m_scenery_scanner(m_vehicles_bank), m_scenerylist_panel(m_scenery_scanner)
launcher_ui::launcher_ui() : m_scenery_scanner(m_vehicles_bank), m_scenerylist_panel(m_scenery_scanner)
{
m_vehicles_bank.scan_textures();
m_scenery_scanner.scan();
@@ -29,6 +28,11 @@ bool launcher_ui::on_key(const int Key, const int Action)
return ui_layer::on_key(Key, Action);
}
void launcher_ui::on_window_resize(int w, int h)
{
open_panel(m_current_panel);
}
void launcher_ui::render_()
{
ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove;
@@ -68,4 +72,6 @@ void launcher_ui::open_panel(ui_panel* panel)
panel->size = glm::vec2(Global.window_size.x, Global.window_size.y - topbar_height);
panel->no_title_bar = true;
panel->is_open = true;
m_current_panel = panel;
}