Gary Talent e773d6f0ee
All checks were successful
Build / build (push) Successful in 1m16s
[studio] Rename StudioContext to Context
2025-05-06 22:37:21 -05:00

50 lines
822 B
C++

/*
* Copyright 2016 - 2025 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#pragma once
#include <ox/std/string.hpp>
#include <studio/context.hpp>
#include <studio/popup.hpp>
namespace studio {
class NewDir final: public Popup {
private:
enum class Stage {
Closed,
Opening,
Open,
};
Stage m_stage = Stage::Closed;
bool m_open{};
ox::String m_path;
ox::IString<255> m_str;
public:
ox::Signal<ox::Error(ox::StringViewCR path)> newDir;
NewDir() noexcept;
void openPath(ox::StringViewCR path) noexcept;
void open() noexcept override;
void close() noexcept override;
[[nodiscard]]
bool isOpen() const noexcept override;
void draw(Context &ctx) noexcept override;
[[nodiscard]]
constexpr ox::CStringView value() const noexcept {
return m_str;
}
};
}