Update imgui 1.91.3 -> 1.92.1

This commit is contained in:
Guillaume Meunier
2025-07-26 11:18:58 +02:00
parent 96083cd02e
commit 794f2e3468
9 changed files with 87 additions and 198 deletions
+1 -1
View File
@@ -915,7 +915,7 @@ void scenes::lobby::on_unfocused()
renderer->wait_idle(); // Must be before the scene data because the renderer uses its descriptor sets
about_picture = nullptr;
about_picture = 0;
imgui_ctx.reset();
world.clear(); // Must be cleared before the renderer so that the descriptor sets are freed before their pools
+8 -13
View File
@@ -95,7 +95,7 @@ static void InputText(const char * label, std::string & text, const ImVec2 & siz
static void display_recentering_tip(imgui_context & ctx, const std::string & tip)
{
ImGui::PushFont(ctx.large_font);
ImGui::PushFont(nullptr, constants::gui::font_size_large);
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, constants::style::window_padding);
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 2);
ImGui::SetNextWindowPos(ctx.layers()[3].vp_center(), ImGuiCond_Always, {0.5, 0.5});
@@ -216,7 +216,7 @@ void scenes::lobby::gui_connecting(locked_notifiable<pin_request_data> & pin_req
ImGui::Dummy({1000, 1});
ImGui::PushFont(imgui_ctx->large_font);
ImGui::PushFont(nullptr, constants::gui::font_size_large);
if (server_name == "")
CenterTextH(fmt::format(_F("Connection")));
else
@@ -245,7 +245,7 @@ void scenes::lobby::gui_enter_pin(locked_notifiable<pin_request_data> & pin_requ
const int pin_size = 6;
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, constants::style::pin_entry_item_spacing);
ImGui::PushFont(imgui_ctx->large_font);
ImGui::PushFont(nullptr, constants::gui::font_size_large);
const auto & style = ImGui::GetStyle();
const auto window = ImGui::GetCurrentWindow();
@@ -447,7 +447,7 @@ void scenes::lobby::gui_server_list()
std::string cookie_to_remove;
if (sorted_cookies.empty())
{
ImGui::PushFont(imgui_ctx->large_font);
ImGui::PushFont(nullptr, constants::gui::font_size_large);
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1, 1, 1, 0.5));
CenterTextHV(_("Start a WiVRn server on your\nlocal network"));
ImGui::PopStyleColor();
@@ -835,7 +835,7 @@ void scenes::lobby::gui_settings()
ImPlot::PushStyleColor(ImPlotCol_AxisBgActive, IM_COL32(0, 0, 0, 0));
ImPlot::PushStyleColor(ImPlotCol_AxisBgHovered, IM_COL32(0, 0, 0, 0));
if (ImPlot::BeginPlot(_S("CPU time"), plot_size, ImPlotFlags_CanvasOnly | ImPlotFlags_NoChild))
if (ImPlot::BeginPlot(_S("CPU time"), plot_size, ImPlotFlags_CanvasOnly))
{
auto col = ImPlot::GetColormapColor(0);
@@ -849,7 +849,7 @@ void scenes::lobby::gui_settings()
ImGui::SameLine();
if (ImPlot::BeginPlot(_S("GPU time"), plot_size, ImPlotFlags_CanvasOnly | ImPlotFlags_NoChild))
if (ImPlot::BeginPlot(_S("GPU time"), plot_size, ImPlotFlags_CanvasOnly))
{
auto col = ImPlot::GetColormapColor(1);
@@ -1077,7 +1077,7 @@ void scenes::lobby::gui_debug()
void scenes::lobby::gui_about()
{
ImGui::PushFont(imgui_ctx->large_font);
ImGui::PushFont(nullptr, constants::gui::font_size_large);
CenterTextH(std::string("WiVRn ") + wivrn::git_version);
ImGui::PopFont();
@@ -1091,7 +1091,7 @@ void scenes::lobby::gui_about()
void scenes::lobby::gui_licenses()
{
ImGui::PushFont(imgui_ctx->large_font);
ImGui::PushFont(nullptr, constants::gui::font_size_large);
ImGui::Text("%s", _("Licenses").c_str());
ImGui::PopFont();
@@ -1630,11 +1630,6 @@ static bool is_gui_visible(imgui_context & ctx, XrTime predicted_display_time)
std::vector<std::pair<int, XrCompositionLayerQuad>> scenes::lobby::draw_gui(XrTime predicted_display_time)
{
for (const auto & [key, server]: application::get_config().servers)
{
imgui_ctx->add_chars(server.service.name);
}
imgui_ctx->new_frame(predicted_display_time);
ImGuiStyle & style = ImGui::GetStyle();
+10 -10
View File
@@ -319,14 +319,14 @@ virtual_keyboard::key_status virtual_keyboard::button_behavior(const ImRect & bb
float prev_held_duration = held_duration;
held_duration += g.IO.DeltaTime;
if ((flags & ImGuiButtonFlags_Repeat) and held_duration > g.IO.KeyRepeatDelay)
{
int n1 = (prev_held_duration - g.IO.KeyRepeatDelay) / g.IO.KeyRepeatRate;
int n2 = (held_duration - g.IO.KeyRepeatDelay) / g.IO.KeyRepeatRate;
if (n2 != n1)
pressed = true;
}
// if ((flags & ImGuiButtonFlags_Repeat) and held_duration > g.IO.KeyRepeatDelay)
// {
// int n1 = (prev_held_duration - g.IO.KeyRepeatDelay) / g.IO.KeyRepeatRate;
// int n2 = (held_duration - g.IO.KeyRepeatDelay) / g.IO.KeyRepeatRate;
//
// if (n2 != n1)
// pressed = true;
// }
}
else
{
@@ -381,8 +381,8 @@ virtual_keyboard::key_status virtual_keyboard::draw_single_key(const key & k, in
ImGuiButtonFlags flags = ImGuiButtonFlags_None;
if (k.flag & key_flag_repeat)
flags |= ImGuiButtonFlags_Repeat;
// if (k.flag & key_flag_repeat)
// flags |= ImGuiButtonFlags_Repeat;
auto status = button_behavior(bb, id, window_hovered, flags);
+2 -2
View File
@@ -232,7 +232,7 @@ void scenes::stream::gui_performance_metrics()
int n = 0;
for (const auto & [title, subplots, unit]: plots)
{
if (ImPlot::BeginPlot(title.c_str(), plot_size, ImPlotFlags_NoTitle | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMouseText | ImPlotFlags_NoChild))
if (ImPlot::BeginPlot(title.c_str(), plot_size, ImPlotFlags_NoTitle | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMouseText))
{
float min_v = 0;
float max_v = 0;
@@ -279,7 +279,7 @@ void scenes::stream::gui_performance_metrics()
for (auto && [index, metrics]: utils::enumerate(decoder_metrics))
{
std::string title = fmt::format(_F("Decoder {}"), std::to_string(index));
if (ImPlot::BeginPlot(title.c_str(), plot_size, ImPlotFlags_NoTitle | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMouseText | ImPlotFlags_NoChild))
if (ImPlot::BeginPlot(title.c_str(), plot_size, ImPlotFlags_NoTitle | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMouseText))
{
float min_v = 0;
float max_v = compute_plot_max_value(&(metrics.data()->displayed), metrics.size(), sizeof(decoder_metric));