improve menus

This commit is contained in:
Green Sky 2024-09-22 12:35:19 +02:00
parent 557a642ad3
commit 86ce199ac8
No known key found for this signature in database
6 changed files with 25 additions and 20 deletions

View File

@ -109,8 +109,8 @@ void SettingsWindow::render(void) {
if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenuBar()) {
ImGui::Separator(); ImGui::Separator();
if (ImGui::BeginMenu("Settings")) { if (ImGui::BeginMenu("Settings")) {
if (ImGui::MenuItem("settings window")) { if (ImGui::MenuItem("settings window", nullptr, _show_window)) {
_show_window = true; _show_window = !_show_window;
} }
ImGui::EndMenu(); ImGui::EndMenu();
} }

View File

@ -284,20 +284,24 @@ Screen* MainScreen::render(float time_delta, bool&) {
if (ImGui::BeginMenu("Settings")) { if (ImGui::BeginMenu("Settings")) {
ImGui::SeparatorText("ImGui"); ImGui::SeparatorText("ImGui");
if (ImGui::MenuItem("Style Editor")) { if (ImGui::MenuItem("Style Editor", nullptr, _show_tool_style_editor)) {
_show_tool_style_editor = true; _show_tool_style_editor = !_show_tool_style_editor;
} }
if (ImGui::MenuItem("Metrics")) { if (ImGui::MenuItem("Metrics", nullptr, _show_tool_metrics)) {
_show_tool_metrics = true; _show_tool_metrics = !_show_tool_metrics;
} }
if (ImGui::MenuItem("Debug Log")) { if (ImGui::MenuItem("Debug Log", nullptr, _show_tool_debug_log)) {
_show_tool_debug_log = true; _show_tool_debug_log = !_show_tool_debug_log;
} }
if (ImGui::MenuItem("ID Stack Tool")) { if (ImGui::MenuItem("ID Stack Tool", nullptr, _show_tool_id_stack)) {
_show_tool_id_stack = true; _show_tool_id_stack = !_show_tool_id_stack;
}
if (ImGui::MenuItem("Demo", nullptr, _show_tool_demo)) {
_show_tool_demo = !_show_tool_demo;
} }
ImGui::EndMenu(); ImGui::EndMenu();
@ -328,8 +332,8 @@ Screen* MainScreen::render(float time_delta, bool&) {
ImGui::ShowIDStackToolWindow(&_show_tool_id_stack); ImGui::ShowIDStackToolWindow(&_show_tool_id_stack);
} }
if constexpr (false) { if (_show_tool_demo) {
ImGui::ShowDemoWindow(); ImGui::ShowDemoWindow(&_show_tool_demo);
} }
float tc_unfinished_queue_interval; float tc_unfinished_queue_interval;

View File

@ -95,6 +95,7 @@ struct MainScreen final : public Screen {
bool _show_tool_metrics {false}; bool _show_tool_metrics {false};
bool _show_tool_debug_log {false}; bool _show_tool_debug_log {false};
bool _show_tool_id_stack {false}; bool _show_tool_id_stack {false};
bool _show_tool_demo {false};
bool _window_hidden {false}; bool _window_hidden {false};
uint64_t _window_hidden_ts {0}; uint64_t _window_hidden_ts {0};

View File

@ -118,8 +118,8 @@ void ObjectStoreUI::render(void) {
if (ImGui::BeginMenuBar()) { if (ImGui::BeginMenuBar()) {
ImGui::Separator(); ImGui::Separator();
if (ImGui::BeginMenu("ObjectStore")) { if (ImGui::BeginMenu("ObjectStore")) {
if (ImGui::MenuItem("Inspector")) { if (ImGui::MenuItem("Inspector", nullptr, _ee.show_window)) {
_ee.show_window = true; _ee.show_window = !_ee.show_window;
} }
ImGui::EndMenu(); ImGui::EndMenu();
} }

View File

@ -38,8 +38,8 @@ void ToxDHTCapHisto::render(void) {
ImGui::Checkbox("enabled", &_enabled); ImGui::Checkbox("enabled", &_enabled);
if (ImGui::MenuItem("show DHT announce capability histogram")) { if (ImGui::MenuItem("announce capability histogram", nullptr, _show_window)) {
_show_window = true; _show_window = !_show_window;
} }
ImGui::EndMenu(); ImGui::EndMenu();

View File

@ -26,14 +26,14 @@ void ToxUIUtils::render(void) {
if (ImGui::BeginMenu("Tox")) { if (ImGui::BeginMenu("Tox")) {
ImGui::SeparatorText("Friends/Groups"); ImGui::SeparatorText("Friends/Groups");
if (ImGui::MenuItem("add Friend by ID")) { if (ImGui::MenuItem("add Friend by ID", nullptr, _show_add_friend_window)) {
_show_add_friend_window = true; _show_add_friend_window = !_show_add_friend_window;
} }
if (ImGui::MenuItem("copy own ToxID")) { if (ImGui::MenuItem("copy own ToxID")) {
ImGui::SetClipboardText(_tc.toxSelfGetAddressStr().c_str()); ImGui::SetClipboardText(_tc.toxSelfGetAddressStr().c_str());
} }
if (ImGui::MenuItem("join Group by ID (ngc)")) { if (ImGui::MenuItem("join Group by ID (ngc)", nullptr, _show_add_group_window)) {
_show_add_group_window = true; _show_add_group_window = !_show_add_group_window;
} }
ImGui::SeparatorText("DHT"); ImGui::SeparatorText("DHT");