blob: 0c8e7b9e29006dc550d32eddcac15e252d0f0bf9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
#include "UI.hpp"
#include "Model/Project.hpp"
#include "UI/Localization.hpp"
#include "UI/States.hpp"
#include <imgui.h>
namespace {
void ProjectTab_Normal() {
// TODO
}
void ProjectTab_NoProject() {
auto ls = LocaleStrings::Instance.get();
if (ImGui::Button(ls->NewProject.Get())) {
// TODO
}
if (ImGui::Button(ls->OpenProject.Get())) {
// TODO
}
ImGui::Separator();
ImGui::Text(ls->Recents.Get());
ImGui::SameLine();
if (ImGui::Button(ls->ClearRecents.Get())) {
// TODO
}
// TODO
}
} // namespace
void UI::MainWindow() {
auto ls = LocaleStrings::Instance.get();
auto& uis = UIState::GetInstance();
auto windowSize = ImGui::GetMainViewport()->Size;
ImGui::SetNextWindowSize({ windowSize.x, windowSize.y });
ImGui::SetNextWindowPos({ 0, 0 });
ImGui::Begin("##MainWindow", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize);
if (ImGui::BeginTabBar("##MainWindowTabs")) {
if (ImGui::BeginTabItem(ls->TabSettings.Get())) {
UI::SettingsTab();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem(ls->TabProject.Get())) {
if (uis.CurrentProject) {
ProjectTab_Normal();
} else {
ProjectTab_NoProject();
}
ImGui::EndTabItem();
}
if (!uis.CurrentProject) {
// No project open, simply skip all project specific tabs
goto endTab;
}
if (ImGui::BeginTabItem(ls->TabDatabaseView.Get())) {
UI::DatabaseViewTab();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem(ls->TabItems.Get())) {
UI::ItemsTab();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem(ls->TabExport.Get())) {
UI::ExportTab();
ImGui::EndTabItem();
}
endTab:
ImGui::EndTabBar();
}
ImGui::End();
}
|