diff --git a/src/single_window/control_bar.cpp b/src/single_window/control_bar.cpp index 551e42b..cbddd37 100644 --- a/src/single_window/control_bar.cpp +++ b/src/single_window/control_bar.cpp @@ -5,16 +5,24 @@ #include "render.h" int Render::ControlBar() { - ImVec2 bar_pos = ImGui::GetWindowPos(); - ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); if (control_bar_expand_) { - ImGui::SetCursorPosX(is_control_bar_in_left_ ? (control_window_width_ + 5) - : 53); + ImGui::SetCursorPosX( + is_control_bar_in_left_ ? (control_window_width_ + 5.0f) : 53.0f); // Mouse control ImDrawList* draw_list = ImGui::GetWindowDrawList(); - float disable_mouse_x = ImGui::GetCursorScreenPos().x + 4; + + if (is_control_bar_in_left_) { + draw_list->AddLine( + ImVec2(ImGui::GetCursorScreenPos().x - 5.0f, + ImGui::GetCursorScreenPos().y - 7.0f), + ImVec2(ImGui::GetCursorScreenPos().x - 5.0f, + ImGui::GetCursorScreenPos().y - 7.0f + control_window_height_), + IM_COL32(178, 178, 178, 255), 1.0f); + } + + float disable_mouse_x = ImGui::GetCursorScreenPos().x + 4.0f; float disable_mouse_y = ImGui::GetCursorScreenPos().y + 4.0f; std::string mouse = mouse_control_button_pressed_ ? ICON_FA_COMPUTER_MOUSE : ICON_FA_COMPUTER_MOUSE; @@ -96,10 +104,19 @@ int Render::ControlBar() { } ImGui::SameLine(); + + if (!is_control_bar_in_left_) { + draw_list->AddLine( + ImVec2(ImGui::GetCursorScreenPos().x - 3.0f, + ImGui::GetCursorScreenPos().y - 7.0f), + ImVec2(ImGui::GetCursorScreenPos().x - 3.0f, + ImGui::GetCursorScreenPos().y - 7.0f + control_window_height_), + IM_COL32(178, 178, 178, 255), 1.0f); + } } ImGui::SetCursorPosX( - is_control_bar_in_left_ ? (control_window_width_ * 2 - 18) : 3); + is_control_bar_in_left_ ? (control_window_width_ * 2 - 18.0f) : 3.0f); std::string control_bar = control_bar_expand_ diff --git a/src/single_window/control_window.cpp b/src/single_window/control_window.cpp index c0a5e72..0e61c5a 100644 --- a/src/single_window/control_window.cpp +++ b/src/single_window/control_window.cpp @@ -121,5 +121,19 @@ int Render::ControlWindow() { ImGui::PopStyleVar(4); ImGui::PopStyleColor(); + ImGui::SetNextWindowPos(ImVec2(0, title_bar_height_), ImGuiCond_Always); + ImGui::SetNextWindowSize( + ImVec2(main_window_width_, main_window_height_ - title_bar_height_), + ImGuiCond_Always); + ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0)); + ImGui::PushStyleColor(ImGuiCol_Border, + ImVec4(178 / 255.0f, 178 / 255.0f, 178 / 255.0f, 1.0f)); + ImGui::Begin("VideoBg", nullptr, + ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | + ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | + ImGuiWindowFlags_NoBringToFrontOnFocus); + ImGui::PopStyleColor(2); + ImGui::End(); + return 0; } \ No newline at end of file diff --git a/src/single_window/render.cpp b/src/single_window/render.cpp index 4f4dcea..4b810da 100644 --- a/src/single_window/render.cpp +++ b/src/single_window/render.cpp @@ -328,7 +328,7 @@ int Render::Run() { stream_render_rect_.x = 0; stream_render_rect_.y = title_bar_height_; stream_render_rect_.w = main_window_width_; - stream_render_rect_.h = main_window_height_; + stream_render_rect_.h = main_window_height_ - title_bar_height_; SDL_DisplayMode DM; SDL_GetCurrentDisplayMode(0, &DM); @@ -491,7 +491,6 @@ int Render::Run() { ImGui::PushStyleColor( ImGuiCol_WindowBg, ImVec4(1.0f, 1.0f, 1.0f, fullscreen_button_pressed_ ? 0 : 1.0f)); - ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0); ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Always); ImGui::SetNextWindowSize( ImVec2(main_window_width_, @@ -502,7 +501,6 @@ int Render::Run() { ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus); - ImGui::PopStyleVar(); ImGui::PopStyleColor(); if (!fullscreen_button_pressed_) { diff --git a/src/single_window/render.h b/src/single_window/render.h index 1bcd3dd..b2a45a8 100644 --- a/src/single_window/render.h +++ b/src/single_window/render.h @@ -135,7 +135,7 @@ class Render { int main_window_width_default_ = 960; int main_window_height_default_ = 570; int main_window_width_ = 960; - int main_window_height_ = 540; + int main_window_height_ = 570; int main_window_width_last_ = 960; int main_window_height_last_ = 540; int stream_window_width_ = 1280; diff --git a/src/single_window/title_bar.cpp b/src/single_window/title_bar.cpp index adf0613..5c728da 100644 --- a/src/single_window/title_bar.cpp +++ b/src/single_window/title_bar.cpp @@ -5,13 +5,11 @@ #define BUTTON_PADDING 36.0f int Render::TitleBar() { - // ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 1); - ImGui::PushStyleColor(ImGuiCol_MenuBarBg, ImVec4(1, 1, 1, 0.0f)); ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Always); ImGui::SetWindowFontScale(0.8f); ImGui::BeginChild("TitleBar", ImVec2(main_window_width_, title_bar_height_), - ImGuiChildFlags_Border, + ImGuiChildFlags_None, ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoBringToFrontOnFocus); ImDrawList* draw_list = ImGui::GetWindowDrawList(); @@ -154,6 +152,5 @@ int Render::TitleBar() { ImGui::EndChild(); ImGui::PopStyleColor(2); - // ImGui::PopStyleVar(); return 0; } \ No newline at end of file