[fix] fix control window position when stream window size changed

This commit is contained in:
dijunkun
2024-11-20 19:17:33 +08:00
parent 0ba12f3ccf
commit 2d2a578800
6 changed files with 135 additions and 54 deletions

View File

@@ -0,0 +1,26 @@
#include "localization.h"
#include "rd_log.h"
#include "render.h"
int Render::StreamWindow() {
ImGui::SetNextWindowPos(
ImVec2(0, fullscreen_button_pressed_ ? 0 : title_bar_height_),
ImGuiCond_Always);
ImGui::SetNextWindowSize(
ImVec2(stream_window_width_, stream_window_height_ - title_bar_height_),
ImGuiCond_Always);
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(1, 1, 1, 0));
ImGui::PushStyleColor(ImGuiCol_Border,
ImVec4(178 / 255.0f, 178 / 255.0f, 178 / 255.0f,
fullscreen_button_pressed_ ? 0 : 1.0f));
ImGui::Begin("VideoBg", nullptr,
ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoDecoration |
ImGuiWindowFlags_NoBringToFrontOnFocus);
ImGui::PopStyleColor(2);
ControlWindow();
ImGui::End();
return 0;
}