mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
Make control bar scrollable
This commit is contained in:
@@ -1,16 +1,31 @@
|
||||
#include "render.h"
|
||||
|
||||
int Render::ControlWindow() {
|
||||
ImGui::PushStyleColor(ImGuiCol_MenuBarBg, ImVec4(0, 0, 0, 0));
|
||||
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0));
|
||||
static bool a, b, c, d, e;
|
||||
ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Always);
|
||||
ImGui::SetWindowFontScale(0.5f);
|
||||
|
||||
auto time_duration = ImGui::GetTime() - control_bar_button_pressed_time_;
|
||||
auto control_window_width =
|
||||
!control_bar_button_pressed_
|
||||
? time_duration < 0.25f
|
||||
? main_window_width_ -
|
||||
(main_window_width_ - control_window_min_width_) * 4 *
|
||||
time_duration
|
||||
: control_window_min_width_
|
||||
: time_duration < 0.25f
|
||||
? control_window_min_width_ +
|
||||
(main_window_width_ - control_window_min_width_) * 4 *
|
||||
time_duration
|
||||
: main_window_width_;
|
||||
ImGui::BeginChild("ControlWindow",
|
||||
ImVec2(main_window_width_, menu_window_height_),
|
||||
ImGuiChildFlags_Border, ImGuiWindowFlags_NoScrollbar);
|
||||
ImVec2(control_window_width, control_window_height_),
|
||||
ImGuiChildFlags_Border, ImGuiWindowFlags_NoDecoration);
|
||||
ImGui::SetWindowFontScale(1.0f);
|
||||
|
||||
ControlBar();
|
||||
|
||||
ImGui::SetWindowFontScale(1.0f);
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::EndChild();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user