1
0
mirror of synced 2025-01-18 00:56:49 +01:00

impr: Make sure welcome screen stays at the back

This commit is contained in:
WerWolv 2023-12-18 10:14:07 +01:00
parent d2d36c2211
commit c1abbfad7d
7 changed files with 12 additions and 10 deletions

View File

@ -163,7 +163,7 @@ namespace hex {
ImGui::SetNextWindowPos(position, ImGuiCond_Always, pivot);
if (ImGui::Begin("##TutorialMessage", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing)) {
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindowRead());
if (!message->unlocalizedTitle.empty())
ImGuiExt::Header(Lang(message->unlocalizedTitle), true);

View File

@ -402,7 +402,7 @@ namespace hex {
}
void Window::beginNativeWindowFrame() {
g_titleBarHeight = ImGui::GetCurrentWindow()->MenuBarHeight();
g_titleBarHeight = ImGui::GetCurrentWindowRead()->MenuBarHeight();
}
void Window::endNativeWindowFrame() {

View File

@ -255,7 +255,7 @@ namespace hex {
}
void Window::drawTitleBar() const {
auto titleBarHeight = ImGui::GetCurrentWindow()->MenuBarHeight();
auto titleBarHeight = ImGui::GetCurrentWindowRead()->MenuBarHeight();
auto buttonSize = ImVec2(titleBarHeight * 1.5F, titleBarHeight - 1);
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
@ -383,7 +383,7 @@ namespace hex {
}
}();
const auto menuBarHeight = ImGui::GetCurrentWindow()->MenuBarHeight();
const auto menuBarHeight = ImGui::GetCurrentWindowRead()->MenuBarHeight();
auto sidebarPos = ImGui::GetCursorPos();
auto sidebarWidth = shouldDrawSidebar ? 20_scaled : 0;

View File

@ -95,13 +95,13 @@ namespace hex::plugin::builtin {
{
ImGuiExt::TextSpinner(hex::format("({})", taskCount).c_str());
ImGui::SameLine();
ImGuiExt::SmallProgressBar(progress, (ImGui::GetCurrentWindow()->MenuBarHeight() - 10_scaled) / 2.0);
ImGuiExt::SmallProgressBar(progress, (ImGui::GetCurrentWindowRead()->MenuBarHeight() - 10_scaled) / 2.0);
ImGui::SameLine();
}
const auto widgetEnd = ImGui::GetCursorPos();
ImGui::SetCursorPos(widgetStart);
ImGui::InvisibleButton("FrontTask", ImVec2(widgetEnd.x - widgetStart.x, ImGui::GetCurrentWindow()->MenuBarHeight()));
ImGui::InvisibleButton("FrontTask", ImVec2(widgetEnd.x - widgetStart.x, ImGui::GetCurrentWindowRead()->MenuBarHeight()));
ImGui::SetCursorPos(widgetEnd);
ImGuiExt::InfoTooltip(hex::format("[{:.1f}%] {}", progress * 100.0F, Lang(frontTask->getUnlocalizedName())).c_str());

View File

@ -414,7 +414,7 @@ namespace hex::plugin::builtin {
ImGui::SetNextWindowPos(ImHexApi::System::getMainWindowPosition() + ImVec2 { ImHexApi::System::getMainWindowSize().x - windowSize.x - 100_scaled, 0 });
ImGui::SetNextWindowSize(windowSize);
if (ImGui::Begin("##achievement_unlocked", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoInputs)) {
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindowRead());
// Draw unlock text
ImGuiExt::TextFormattedColored(ImGuiExt::GetCustomColorVec4(ImGuiCustomCol_AchievementUnlocked), "{}", "hex.builtin.view.achievements.unlocked"_lang);

View File

@ -66,7 +66,7 @@ namespace hex::plugin::builtin {
this->m_dragStartIterator = tools.end();
// Attach the newly created window to the cursor, so it gets dragged around
GImGui->MovingWindow = ImGui::GetCurrentWindow();
GImGui->MovingWindow = ImGui::GetCurrentWindowRead();
GImGui->ActiveId = GImGui->MovingWindow->MoveId;
}
}

View File

@ -383,7 +383,7 @@ namespace hex::plugin::builtin {
if (ImGui::Begin("ImHexDockSpace")) {
if (!ImHexApi::Provider::isValid()) {
static std::array<char, 256> title;
ImFormatString(title.data(), title.size(), "%s/DockSpace_%08X", ImGui::GetCurrentWindow()->Name, ImGui::GetID("ImHexMainDock"));
ImFormatString(title.data(), title.size(), "%s/DockSpace_%08X", ImGui::GetCurrentWindowRead()->Name, ImGui::GetID("ImHexMainDock"));
if (ImGui::Begin(title.data(), nullptr, ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoBringToFrontOnFocus)) {
ImGui::Dummy({});
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, scaled({ 10, 10 }));
@ -392,6 +392,7 @@ namespace hex::plugin::builtin {
ImGui::SetNextWindowSize(ImGui::GetContentRegionAvail() + scaled({ 0, 10 }));
ImGui::SetNextWindowPos(ImGui::GetCursorScreenPos() - ImVec2(0, ImGui::GetStyle().FramePadding.y + 2_scaled));
if (ImGui::Begin("Welcome Screen", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove)) {
ImGui::BringWindowToDisplayBack(ImGui::GetCurrentWindowRead());
if (s_simplifiedWelcomeScreen)
drawWelcomeScreenContentSimplified();
else
@ -421,6 +422,7 @@ namespace hex::plugin::builtin {
ImGui::PopStyleVar();
}
ImGui::End();
ImGui::BringWindowToDisplayBack(ImGui::GetCurrentWindowRead());
}
}
ImGui::End();
@ -432,7 +434,7 @@ namespace hex::plugin::builtin {
void drawNoViewsBackground() {
if (ImGui::Begin("ImHexDockSpace")) {
static std::array<char, 256> title;
ImFormatString(title.data(), title.size(), "%s/DockSpace_%08X", ImGui::GetCurrentWindow()->Name, ImGui::GetID("ImHexMainDock"));
ImFormatString(title.data(), title.size(), "%s/DockSpace_%08X", ImGui::GetCurrentWindowRead()->Name, ImGui::GetID("ImHexMainDock"));
if (ImGui::Begin(title.data())) {
ImGui::Dummy({});
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, scaled({ 10, 10 }));