Skip to content

Commit

Permalink
Fixed obsoleted code calls from ImGui 1.90
Browse files Browse the repository at this point in the history
  • Loading branch information
rtoumazet committed Nov 22, 2023
1 parent 66c16ee commit 60d34bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions saturnin/lib/imgui/imgui_custom_controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void peripheralKeyCombo(const std::vector<PeripheralKey>& keys, PeripheralKey& d
void CenteredText(const std::string& text) {
auto size = ImGui::CalcTextSize(text.c_str());
constexpr auto ratio = float{0.5f};
ImGui::SetCursorPosX(ImGui::GetWindowContentRegionWidth() * ratio - size.x / 2);
ImGui::SetCursorPosX(ImGui::GetContentRegionAvail().x * ratio - size.x / 2);
ImGui::TextUnformatted(text.c_str());
}

Expand All @@ -121,7 +121,7 @@ void ChildWindowHeader(const std::string& label) {
ImVec2(pos.x + size.x, pos.y + 15.f),
ImGui::GetColorU32(ImGuiCol_TableHeaderBg, 255),
5.f,
ImDrawCornerFlags_Top);
ImDrawFlags_RoundCornersTop);
ImGui::AlignTextToFramePadding();
ImGui::SameLine(3.0f);
ImGui::Text("%s", label.c_str());
Expand Down
8 changes: 4 additions & 4 deletions saturnin/src/video/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ void showMainMenu(GuiConfiguration& conf, core::EmulatorContext& state) {

ImGui::BeginChild("ChildSaturnPlayer1", ImVec2(child_width, child_height), true, window_flags);

ImGui::PushItemWidth(ImGui::GetWindowContentRegionWidth() - second_column_offset);
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - second_column_offset);

ImGui::CenteredText(tr("Player 1"));

Expand Down Expand Up @@ -583,7 +583,7 @@ void showMainMenu(GuiConfiguration& conf, core::EmulatorContext& state) {
state.config()->readPeripheralConfiguration(core::AccessKeys::cfg_controls_saturn_player_2));

ImGui::BeginChild("ChildSaturnPlayer2", ImVec2(child_width, child_height), true, window_flags);
ImGui::PushItemWidth(ImGui::GetWindowContentRegionWidth() - second_column_offset);
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - second_column_offset);

ImGui::CenteredText(tr("Player 2"));

Expand Down Expand Up @@ -710,7 +710,7 @@ void showMainMenu(GuiConfiguration& conf, core::EmulatorContext& state) {
constexpr auto child_height = u16{220};
ImGui::BeginChild("ChildStvPlayer1", ImVec2(child_width, child_height), true, window_flags);

ImGui::PushItemWidth(ImGui::GetWindowContentRegionWidth() - second_column_offset);
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - second_column_offset);

ImGui::CenteredText(tr("Player 1"));

Expand Down Expand Up @@ -761,7 +761,7 @@ void showMainMenu(GuiConfiguration& conf, core::EmulatorContext& state) {
constexpr auto child_height = u16{220};
ImGui::BeginChild("ChildStvPlayer2", ImVec2(child_width, child_height), true, window_flags);

ImGui::PushItemWidth(ImGui::GetWindowContentRegionWidth() - second_column_offset);
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x - second_column_offset);

ImGui::CenteredText(tr("Player 2"));

Expand Down

0 comments on commit 60d34bb

Please sign in to comment.