Skip to content

Commit

Permalink
Merge pull request #77625 from RenechCDDA/mission_ui_scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
Maleclypse authored Nov 8, 2024
2 parents c9808dd + 18eb3df commit 95a029c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/mission_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ class mission_ui_impl : public cataimgui::window
public:
std::string last_action;
explicit mission_ui_impl() : cataimgui::window( _( "Your missions" ),
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNav |
ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse ) {
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNav ) {
}

private:
Expand Down Expand Up @@ -139,6 +138,12 @@ void mission_ui_impl::draw_controls()
selected_mission = 0;
switch_tab = selected_tab;
--switch_tab;
} else if( last_action == "PAGE_UP" ) {
ImGui::SetWindowFocus(); // Dumb hack! Clear our focused item so listbox selection isn't nav highlighted.
ImGui::SetScrollY( ImGui::GetScrollY() - ( window_height / 5.0f ) );
} else if( last_action == "PAGE_DOWN" ) {
ImGui::SetWindowFocus(); // Dumb hack! Clear our focused item so listbox selection isn't nav highlighted.
ImGui::SetScrollY( ImGui::GetScrollY() + ( window_height / 5.0f ) );
}

ImGuiTabItemFlags_ flags = ImGuiTabItemFlags_None;
Expand Down

0 comments on commit 95a029c

Please sign in to comment.