[studio] Add build date to About
All checks were successful
Build / build (push) Successful in 1m15s
All checks were successful
Build / build (push) Successful in 1m15s
This commit is contained in:
parent
d585794cbe
commit
df87832324
@ -13,22 +13,10 @@ extern ox::String appVersion;
|
|||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
AboutPopup::AboutPopup(turbine::Context &ctx) noexcept {
|
AboutPopup::AboutPopup(turbine::Context &ctx) noexcept: Popup("About") {
|
||||||
m_text = ox::sfmt("{} - {}", keelCtx(ctx).appName, olympic::appVersion);
|
m_text = ox::sfmt("{} - {}", keelCtx(ctx).appName, olympic::appVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AboutPopup::open() noexcept {
|
|
||||||
m_stage = Stage::Opening;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AboutPopup::close() noexcept {
|
|
||||||
m_stage = Stage::Closed;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AboutPopup::isOpen() const noexcept {
|
|
||||||
return m_stage == Stage::Open;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AboutPopup::draw(Context &sctx) noexcept {
|
void AboutPopup::draw(Context &sctx) noexcept {
|
||||||
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
||||||
close();
|
close();
|
||||||
@ -47,7 +35,7 @@ void AboutPopup::draw(Context &sctx) noexcept {
|
|||||||
ig::centerNextWindow(sctx.tctx);
|
ig::centerNextWindow(sctx.tctx);
|
||||||
auto open = true;
|
auto open = true;
|
||||||
if (ImGui::BeginPopupModal("About", &open, modalFlags)) {
|
if (ImGui::BeginPopupModal("About", &open, modalFlags)) {
|
||||||
ImGui::Text("%s", m_text.c_str());
|
ImGui::Text("%s\n\nBuild date: %s", m_text.c_str(), __DATE__);
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
ImGui::Dummy({148.0f, 0.0f});
|
ImGui::Dummy({148.0f, 0.0f});
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
@ -13,29 +13,14 @@
|
|||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
class AboutPopup: public studio::Popup {
|
class AboutPopup final: public ig::Popup {
|
||||||
public:
|
|
||||||
enum class Stage {
|
|
||||||
Closed,
|
|
||||||
Opening,
|
|
||||||
Open,
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Stage m_stage = Stage::Closed;
|
|
||||||
ox::String m_text;
|
ox::String m_text;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AboutPopup(turbine::Context &ctx) noexcept;
|
explicit AboutPopup(turbine::Context &ctx) noexcept;
|
||||||
|
|
||||||
void open() noexcept override;
|
void draw(Context &sctx) noexcept override;
|
||||||
|
|
||||||
void close() noexcept override;
|
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
bool isOpen() const noexcept override;
|
|
||||||
|
|
||||||
void draw(studio::Context &sctx) noexcept override;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -65,10 +65,7 @@ OX_MODEL_END()
|
|||||||
StudioUI::StudioUI(turbine::Context &ctx, ox::StringParam projectDataDir) noexcept:
|
StudioUI::StudioUI(turbine::Context &ctx, ox::StringParam projectDataDir) noexcept:
|
||||||
m_sctx{*this, ctx},
|
m_sctx{*this, ctx},
|
||||||
m_tctx{ctx},
|
m_tctx{ctx},
|
||||||
m_projectDataDir{std::move(projectDataDir)},
|
m_projectDataDir{std::move(projectDataDir)} {
|
||||||
m_projectExplorer{keelCtx(m_tctx)},
|
|
||||||
m_newProject{m_projectDataDir},
|
|
||||||
m_aboutPopup{m_tctx} {
|
|
||||||
{
|
{
|
||||||
ImFontConfig fontCfg;
|
ImFontConfig fontCfg;
|
||||||
fontCfg.FontDataOwnedByAtlas = false;
|
fontCfg.FontDataOwnedByAtlas = false;
|
||||||
|
@ -36,7 +36,7 @@ class StudioUI: public ox::SignalHandler {
|
|||||||
TaskRunner m_taskRunner;
|
TaskRunner m_taskRunner;
|
||||||
ox::Vector<ox::UPtr<BaseEditor>> m_editors;
|
ox::Vector<ox::UPtr<BaseEditor>> m_editors;
|
||||||
ox::HashMap<ox::String, EditorMaker::Func> m_editorMakers;
|
ox::HashMap<ox::String, EditorMaker::Func> m_editorMakers;
|
||||||
ProjectExplorer m_projectExplorer;
|
ProjectExplorer m_projectExplorer{keelCtx(m_tctx)};
|
||||||
ox::Vector<ox::String> m_openFiles;
|
ox::Vector<ox::String> m_openFiles;
|
||||||
BaseEditor *m_activeEditorOnLastDraw = nullptr;
|
BaseEditor *m_activeEditorOnLastDraw = nullptr;
|
||||||
BaseEditor *m_activeEditor = nullptr;
|
BaseEditor *m_activeEditor = nullptr;
|
||||||
@ -45,6 +45,7 @@ class StudioUI: public ox::SignalHandler {
|
|||||||
ox::Vector<ox::Pair<ox::String>> m_queuedMoves;
|
ox::Vector<ox::Pair<ox::String>> m_queuedMoves;
|
||||||
ox::Vector<ox::Pair<ox::String>> m_queuedDirMoves;
|
ox::Vector<ox::Pair<ox::String>> m_queuedDirMoves;
|
||||||
NewMenu m_newMenu{keelCtx(m_tctx)};
|
NewMenu m_newMenu{keelCtx(m_tctx)};
|
||||||
|
AboutPopup m_aboutPopup{m_tctx};
|
||||||
DeleteConfirmation m_deleteConfirmation;
|
DeleteConfirmation m_deleteConfirmation;
|
||||||
NewDir m_newDirDialog;
|
NewDir m_newDirDialog;
|
||||||
ig::QuestionPopup m_closeFileConfirm{"Close File?", "This file has unsaved changes. Close?"};
|
ig::QuestionPopup m_closeFileConfirm{"Close File?", "This file has unsaved changes. Close?"};
|
||||||
@ -55,8 +56,7 @@ class StudioUI: public ox::SignalHandler {
|
|||||||
ig::MessagePopup m_messagePopup{"Message", ""};
|
ig::MessagePopup m_messagePopup{"Message", ""};
|
||||||
MakeCopyPopup m_copyFilePopup;
|
MakeCopyPopup m_copyFilePopup;
|
||||||
RenameFile m_renameFile;
|
RenameFile m_renameFile;
|
||||||
NewProject m_newProject;
|
NewProject m_newProject{m_projectDataDir};
|
||||||
AboutPopup m_aboutPopup;
|
|
||||||
ox::Array<Widget*, 10> const m_widgets {
|
ox::Array<Widget*, 10> const m_widgets {
|
||||||
&m_closeFileConfirm,
|
&m_closeFileConfirm,
|
||||||
&m_closeAppConfirm,
|
&m_closeAppConfirm,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user