Skip to content

Commit

Permalink
ImGuiFullscreen: Enable smooth scrolling for file/choice selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Dec 24, 2024
1 parent c4e0e7f commit 0565320
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/util/imgui_fullscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2285,6 +2285,7 @@ void ImGuiFullscreen::DrawFileSelector()
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
LayoutScale(LAYOUT_MENU_BUTTON_X_PADDING, LAYOUT_MENU_BUTTON_Y_PADDING));
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_ScrollSmooth, s_state.smooth_scrolling ? SMOOTH_SCROLLING_SPEED : 1.0f);
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.PrimaryTextColor);
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIStyle.PrimaryDarkColor);
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIStyle.PrimaryColor);
Expand Down Expand Up @@ -2329,7 +2330,7 @@ void ImGuiFullscreen::DrawFileSelector()
}

ImGui::PopStyleColor(3);
ImGui::PopStyleVar(3);
ImGui::PopStyleVar(4);
ImGui::PopFont();

if (is_open)
Expand Down Expand Up @@ -2416,6 +2417,7 @@ void ImGuiFullscreen::DrawChoiceDialog()
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
LayoutScale(LAYOUT_MENU_BUTTON_X_PADDING, LAYOUT_MENU_BUTTON_Y_PADDING));
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_ScrollSmooth, s_state.smooth_scrolling ? SMOOTH_SCROLLING_SPEED : 1.0f);
ImGui::PushStyleColor(ImGuiCol_Text, UIStyle.PrimaryTextColor);
ImGui::PushStyleColor(ImGuiCol_TitleBg, UIStyle.PrimaryDarkColor);
ImGui::PushStyleColor(ImGuiCol_TitleBgActive, UIStyle.PrimaryColor);
Expand Down Expand Up @@ -2481,7 +2483,7 @@ void ImGuiFullscreen::DrawChoiceDialog()
}

ImGui::PopStyleColor(3);
ImGui::PopStyleVar(3);
ImGui::PopStyleVar(4);
ImGui::PopFont();

is_open &= !WantsToCloseMenu();
Expand Down

0 comments on commit 0565320

Please sign in to comment.