add GeneralSettings
This commit is contained in:
@@ -3,6 +3,8 @@
|
|||||||
#include <imgui/imgui.h>
|
#include <imgui/imgui.h>
|
||||||
|
|
||||||
#include "absl/status/status.h"
|
#include "absl/status/status.h"
|
||||||
|
#include "app/editor/utils/flags.h"
|
||||||
|
#include "app/editor/utils/keyboard_shortcuts.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
@@ -12,22 +14,26 @@ using ImGui::BeginChild;
|
|||||||
using ImGui::BeginMenu;
|
using ImGui::BeginMenu;
|
||||||
using ImGui::BeginTabBar;
|
using ImGui::BeginTabBar;
|
||||||
using ImGui::BeginTabItem;
|
using ImGui::BeginTabItem;
|
||||||
|
using ImGui::BeginTable;
|
||||||
using ImGui::Checkbox;
|
using ImGui::Checkbox;
|
||||||
using ImGui::EndChild;
|
using ImGui::EndChild;
|
||||||
using ImGui::EndMenu;
|
using ImGui::EndMenu;
|
||||||
using ImGui::EndTabBar;
|
using ImGui::EndTabBar;
|
||||||
using ImGui::EndTabItem;
|
using ImGui::EndTabItem;
|
||||||
|
using ImGui::EndTable;
|
||||||
|
using ImGui::TableHeader;
|
||||||
|
using ImGui::TableHeadersRow;
|
||||||
|
using ImGui::TableNextColumn;
|
||||||
|
using ImGui::TableNextRow;
|
||||||
|
using ImGui::TableSetBgColor;
|
||||||
|
using ImGui::TableSetColumnIndex;
|
||||||
|
using ImGui::TableSetupColumn;
|
||||||
using ImGui::Text;
|
using ImGui::Text;
|
||||||
|
|
||||||
absl::Status SettingsEditor::Update() {
|
absl::Status SettingsEditor::Update() {
|
||||||
if (BeginTabBar("Settings", ImGuiTabBarFlags_None)) {
|
if (BeginTabBar("Settings", ImGuiTabBarFlags_None)) {
|
||||||
if (BeginTabItem("General")) {
|
if (BeginTabItem("General")) {
|
||||||
if (BeginChild("##GeneralSettingsStyleWrapper", ImVec2(0, 0),
|
DrawGeneralSettings();
|
||||||
ImGuiChildFlags_FrameStyle)) {
|
|
||||||
static FlagsMenu flags;
|
|
||||||
flags.Draw();
|
|
||||||
}
|
|
||||||
EndChild();
|
|
||||||
EndTabItem();
|
EndTabItem();
|
||||||
}
|
}
|
||||||
if (BeginTabItem("Keyboard Shortcuts")) {
|
if (BeginTabItem("Keyboard Shortcuts")) {
|
||||||
@@ -39,6 +45,36 @@ absl::Status SettingsEditor::Update() {
|
|||||||
return absl::OkStatus();
|
return absl::OkStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingsEditor::DrawGeneralSettings() {
|
||||||
|
if (BeginTable("##SettingsTable", 2,
|
||||||
|
ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable |
|
||||||
|
ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable)) {
|
||||||
|
TableSetupColumn("Experiment Flags", ImGuiTableColumnFlags_WidthFixed,
|
||||||
|
250.0f);
|
||||||
|
TableSetupColumn("General Setting", ImGuiTableColumnFlags_WidthStretch,
|
||||||
|
0.0f);
|
||||||
|
|
||||||
|
TableHeadersRow();
|
||||||
|
|
||||||
|
TableNextColumn();
|
||||||
|
if (BeginChild("##GeneralSettingsStyleWrapper", ImVec2(0, 0),
|
||||||
|
ImGuiChildFlags_FrameStyle)) {
|
||||||
|
static FlagsMenu flags;
|
||||||
|
flags.Draw();
|
||||||
|
EndChild();
|
||||||
|
}
|
||||||
|
|
||||||
|
TableNextColumn();
|
||||||
|
if (BeginChild("##GeneralSettingsWrapper", ImVec2(0, 0),
|
||||||
|
ImGuiChildFlags_FrameStyle)) {
|
||||||
|
Text("TODO: Add some settings here");
|
||||||
|
EndChild();
|
||||||
|
}
|
||||||
|
|
||||||
|
EndTable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
absl::Status SettingsEditor::DrawKeyboardShortcuts() {
|
absl::Status SettingsEditor::DrawKeyboardShortcuts() {
|
||||||
return absl::OkStatus();
|
return absl::OkStatus();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ class SettingsEditor : public Editor {
|
|||||||
absl::Status Find() override { return absl::UnimplementedError("Find"); }
|
absl::Status Find() override { return absl::UnimplementedError("Find"); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void DrawGeneralSettings();
|
||||||
|
|
||||||
absl::Status DrawKeyboardShortcuts();
|
absl::Status DrawKeyboardShortcuts();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user