Added very basic Welcome screen
This commit is contained in:
parent
8990fad85a
commit
47ca69b80e
@ -32,6 +32,8 @@ namespace hex {
|
||||
void frameBegin();
|
||||
void frameEnd();
|
||||
|
||||
void drawWelcomeScreen();
|
||||
|
||||
void initGLFW();
|
||||
void initImGui();
|
||||
void deinitGLFW();
|
||||
|
@ -94,16 +94,18 @@ namespace hex {
|
||||
call();
|
||||
View::getDeferedCalls().clear();
|
||||
|
||||
for (auto &view : ContentRegistry::Views::getEntries()) {
|
||||
if (!view->getWindowOpenState())
|
||||
continue;
|
||||
if (SharedData::currentProvider != nullptr) {
|
||||
for (auto &view : ContentRegistry::Views::getEntries()) {
|
||||
if (!view->getWindowOpenState())
|
||||
continue;
|
||||
|
||||
auto minSize = view->getMinSize();
|
||||
minSize.x *= this->m_globalScale;
|
||||
minSize.y *= this->m_globalScale;
|
||||
auto minSize = view->getMinSize();
|
||||
minSize.x *= this->m_globalScale;
|
||||
minSize.y *= this->m_globalScale;
|
||||
|
||||
ImGui::SetNextWindowSizeConstraints(minSize, view->getMaxSize());
|
||||
view->drawContent();
|
||||
ImGui::SetNextWindowSizeConstraints(minSize, view->getMaxSize());
|
||||
view->drawContent();
|
||||
}
|
||||
}
|
||||
|
||||
View::drawCommonInterfaces();
|
||||
@ -218,6 +220,21 @@ namespace hex {
|
||||
Window::s_currShortcut = { -1, -1 };
|
||||
}
|
||||
|
||||
ImGui::GetWindowDockID()
|
||||
if (SharedData::currentProvider == nullptr) {
|
||||
char title[256];
|
||||
ImFormatString(title, IM_ARRAYSIZE(title), "%s/DockSpace_%08X", ImGui::GetCurrentWindow()->Name, ImGui::GetID("MainDock"));
|
||||
if (ImGui::Begin(title)) {
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(10 * this->m_globalScale, 10 * this->m_globalScale));
|
||||
if (ImGui::BeginChild("Welcome Screen", ImVec2(0, 0), ImGuiWindowFlags_AlwaysUseWindowPadding | ImGuiWindowFlags_NoDecoration)) {
|
||||
this->drawWelcomeScreen();
|
||||
}
|
||||
ImGui::EndChild();
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
@ -240,6 +257,10 @@ namespace hex {
|
||||
glfwSwapBuffers(this->m_window);
|
||||
}
|
||||
|
||||
void Window::drawWelcomeScreen() {
|
||||
ImGui::TextColored(ImGui::GetStyleColorVec4(ImGuiCol_HeaderActive), "Welcome to ImHex!");
|
||||
}
|
||||
|
||||
void Window::initGLFW() {
|
||||
glfwSetErrorCallback([](int error, const char* desc) {
|
||||
fprintf(stderr, "Glfw Error %d: %s\n", error, desc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user