mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-26 20:25:34 +08:00
[fix] fix control bar cannot stick to right side when out of y-axis region
This commit is contained in:
@@ -29,10 +29,7 @@ int Render::ControlWindow() {
|
|||||||
ImGui::SetNextWindowPos(ImVec2(0, title_bar_height_), ImGuiCond_Once);
|
ImGui::SetNextWindowPos(ImVec2(0, title_bar_height_), ImGuiCond_Once);
|
||||||
if (ImGui::IsMouseReleased(ImGuiPopupFlags_MouseButtonLeft) ||
|
if (ImGui::IsMouseReleased(ImGuiPopupFlags_MouseButtonLeft) ||
|
||||||
control_window_width_is_changing_) {
|
control_window_width_is_changing_) {
|
||||||
if (control_winodw_pos_.x <= main_window_width_ / 2 ||
|
if (control_winodw_pos_.x <= main_window_width_ / 2) {
|
||||||
(control_winodw_pos_.y < title_bar_height_ ||
|
|
||||||
control_winodw_pos_.y >
|
|
||||||
main_window_height_ - control_window_height_)) {
|
|
||||||
int pos_x = 0;
|
int pos_x = 0;
|
||||||
int pos_y = (control_winodw_pos_.y >= title_bar_height_ &&
|
int pos_y = (control_winodw_pos_.y >= title_bar_height_ &&
|
||||||
control_winodw_pos_.y <=
|
control_winodw_pos_.y <=
|
||||||
@@ -59,10 +56,7 @@ int Render::ControlWindow() {
|
|||||||
}
|
}
|
||||||
ImGui::SetNextWindowPos(ImVec2(pos_x, pos_y), ImGuiCond_Always);
|
ImGui::SetNextWindowPos(ImVec2(pos_x, pos_y), ImGuiCond_Always);
|
||||||
is_control_bar_in_left_ = true;
|
is_control_bar_in_left_ = true;
|
||||||
} else if (control_winodw_pos_.x > main_window_width_ / 2 ||
|
} else if (control_winodw_pos_.x > main_window_width_ / 2) {
|
||||||
(control_winodw_pos_.y < title_bar_height_ ||
|
|
||||||
control_winodw_pos_.y >
|
|
||||||
main_window_height_ - control_window_height_)) {
|
|
||||||
int pos_x = 0;
|
int pos_x = 0;
|
||||||
int pos_y = (control_winodw_pos_.y >= title_bar_height_ &&
|
int pos_y = (control_winodw_pos_.y >= title_bar_height_ &&
|
||||||
control_winodw_pos_.y <=
|
control_winodw_pos_.y <=
|
||||||
|
|||||||
Reference in New Issue
Block a user