[feat] enable movement for control bar

This commit is contained in:
dijunkun
2024-08-02 12:30:50 +08:00
parent d17c70c2c8
commit e4c05e1f4d
5 changed files with 41 additions and 27 deletions

View File

@@ -33,20 +33,14 @@ int Render::ControlBar() {
if (ImGui::Button(fullscreen.c_str(), ImVec2(25, 25))) {
fullscreen_button_pressed_ = !fullscreen_button_pressed_;
if (fullscreen_button_pressed_) {
main_window_width_before_fullscreen_ = main_window_width_;
main_window_height_before_fullscreen_ = main_window_height_;
SDL_SetWindowFullscreen(main_window_, SDL_WINDOW_FULLSCREEN_DESKTOP);
} else {
SDL_SetWindowFullscreen(main_window_, SDL_FALSE);
SDL_SetWindowSize(main_window_, main_window_width_before_fullscreen_,
main_window_height_before_fullscreen_);
main_window_width_ = main_window_width_before_fullscreen_;
main_window_height_ = main_window_height_before_fullscreen_;
}
}
ImGui::SameLine();
ImGui::SetCursorPosX(main_window_width_ - 35);
ImGui::SetCursorPosX(control_window_max_width_ - 35);
}
std::string control_bar =