Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set minimum sizes for missions menu window #78811

Merged
merged 6 commits into from
Jan 5, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/mission_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include "cata_imgui.h"
#include "imgui/imgui.h"

static const float minimum_window_width = 640;
static const float minimum_window_height = 384;

enum class mission_ui_tab_enum : int {
ACTIVE = 0,
COMPLETED,
Expand Down Expand Up @@ -71,9 +74,9 @@ class mission_ui_impl : public cataimgui::window
mission_ui_tab_enum selected_tab = mission_ui_tab_enum::ACTIVE;
mission_ui_tab_enum switch_tab = mission_ui_tab_enum::num_tabs;

size_t window_width = str_width_to_pixels( TERMX ) / 2;
size_t window_height = str_height_to_pixels( TERMY ) / 2;
size_t table_column_width = window_width / 2;
float window_width = std::max(ImGui::GetMainViewport()->Size.x / 2, minimum_window_width);
float window_height = std::max(ImGui::GetMainViewport()->Size.y / 2, minimum_window_height);
Kilvoctu marked this conversation as resolved.
Show resolved Hide resolved
float table_column_width = window_width / 2;

cataimgui::scroll s = cataimgui::scroll::none;

Expand Down
Loading