@@ -29,11 +29,7 @@ namespace UserInterface {
2929 }
3030
3131 void CreateSortSelectionDropdown (Application::AppContext* appContext) {
32- float maxWidth = 150 .0f ;
33- float availableWidth = ImGui::GetContentRegionAvail ().x ;
34- float comboWidth = (availableWidth > maxWidth) ? maxWidth : availableWidth;
35- ImGui::SetNextItemWidth (comboWidth);
36-
32+ ImGui::SetNextItemWidth (ImGui::GetContentRegionAvail ().x );
3733 int sortId = appContext->sortManager ->currentSortId ;
3834 if (ImGui::BeginCombo (" ##Select_Sort" , appContext->sortManager ->GetSortName (sortId), ImGuiComboFlags_NoArrowButton)) {
3935 int sortCount = appContext->sortManager ->GetSortCount ();
@@ -51,10 +47,7 @@ namespace UserInterface {
5147 }
5248
5349 void CreateSortSpeedSlider (Application::AppContext* appContext) {
54- float maxWidth = 150 .0f ;
55- float availableWidth = ImGui::GetContentRegionAvail ().x ;
56- float sliderWidth = (availableWidth > maxWidth) ? maxWidth : availableWidth;
57- ImGui::SetNextItemWidth (sliderWidth);
50+ ImGui::SetNextItemWidth (ImGui::GetContentRegionAvail ().x );
5851
5952 // USER ADJUSTED VALUE, DETERMINES SORT SPEED (0 = SLOWEST, 1 = FASTEST)
6053 ImGui::SliderFloat (" ##SORT_SPEED" , &appContext->delayTimeNormalized , 0 .0f , 1 .0f );
@@ -65,23 +58,21 @@ namespace UserInterface {
6558 int itemCount = 4 ;
6659 ImGuiStyle& style = ImGui::GetStyle ();
6760
68- float itemHeight = ImGui::GetFrameHeight (); // BASE ITEM HEIGHT
69- float itemFramePadding = itemCount * (style.FramePadding .y * 2 .0f ); // TOP/BOTTOM FRAME PADDING
70- float itemSpacing = (itemCount - 1 ) * style.ItemSpacing .y ; // VERTICAL SPACING BETWEEN ITEMS
71- float windowPadding = style.WindowPadding .y * 2 .0f ; // TOP/BOTTOM WINDOW PADDING
72- float minHeight = windowPadding + itemFramePadding + itemSpacing + (itemCount * itemHeight);
61+ float itemHeight = ImGui::GetFrameHeight (); // BASE ITEM HEIGHT
62+ float itemFramePadding = (itemCount - 0.5 ) * (style.FramePadding .y * 2 .0f ); // TOP/BOTTOM FRAME PADDING
63+ float itemSpacing = (itemCount - 1 ) * style.ItemSpacing .y ; // VERTICAL SPACING BETWEEN ITEMS
64+ float minHeight = itemFramePadding + itemSpacing + (itemCount * itemHeight);
7365
74- float minWidth = 120 .0f ;
75- ImVec2 minSize (minWidth, minHeight);
76- ImVec2 maxSize (minWidth * 2 .0f , float (MINIMUM_WINDOW_HEIGHT) / 2 .0f );
66+ const float minWidth = float (MINIMUM_WINDOW_WIDTH) / 2 .5f ;
67+ const ImVec2 minSize (minWidth, minHeight);
7768 ImGui::SetNextWindowSize (minSize, ImGuiCond_FirstUseEver);
78- ImGui::SetNextWindowSizeConstraints (minSize, maxSize );
79- ImGui::Begin (" ##CONTROL_PANEL" , nullptr , ImGuiWindowFlags_NoCollapse);
69+ ImGui::SetNextWindowSizeConstraints (minSize, minSize );
70+ ImGui::Begin (" ##CONTROL_PANEL" , nullptr , ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);
8071
8172 CreateShuffleButton (appContext);
8273 CreateSortButton (appContext);
83- CreateSortSelectionDropdown (appContext);
8474 CreateSortSpeedSlider (appContext);
75+ CreateSortSelectionDropdown (appContext);
8576
8677 ImGui::End ();
8778 }
0 commit comments