mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-01 06:00:04 +00:00
Enable ImGui context selection
This commit is contained in:
parent
9684aa4cdc
commit
f27e2534a7
6 changed files with 76 additions and 14 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include "ui_imgui_debug_dialog.h"
|
||||
|
||||
#include <scwx/qt/model/imgui_context_model.hpp>
|
||||
#include <scwx/qt/types/qt_types.hpp>
|
||||
#include <scwx/qt/ui/imgui_debug_widget.hpp>
|
||||
|
||||
namespace scwx
|
||||
|
|
@ -36,7 +37,26 @@ ImGuiDebugDialog::ImGuiDebugDialog(QWidget* parent) :
|
|||
ui->verticalLayout->insertWidget(0, p->imGuiDebugWidget_);
|
||||
|
||||
// Context Combo Box
|
||||
ui->contextComboBox->setModel(&model::ImGuiContextModel::Instance());
|
||||
auto& contextModel = model::ImGuiContextModel::Instance();
|
||||
auto index = contextModel.IndexOf(p->imGuiDebugWidget_->context_name());
|
||||
ui->contextComboBox->setModel(&contextModel);
|
||||
ui->contextComboBox->setCurrentIndex(index.row());
|
||||
|
||||
connect(
|
||||
ui->contextComboBox,
|
||||
&QComboBox::currentIndexChanged,
|
||||
[=](int row)
|
||||
{
|
||||
auto& contextModel = model::ImGuiContextModel::Instance();
|
||||
auto index = contextModel.index(row, 0);
|
||||
if (index.isValid())
|
||||
{
|
||||
QVariant data = contextModel.data(index, qt::types::RawDataRole);
|
||||
auto contextInfo = data.value<model::ImGuiContextInfo>();
|
||||
|
||||
p->imGuiDebugWidget_->set_current_context(contextInfo.context_);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ImGuiDebugDialog::~ImGuiDebugDialog()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue