feat: Added close button for welcome screen
This commit is contained in:
parent
5c13cf9dbf
commit
d55c59c796
@ -131,7 +131,7 @@ namespace hex::prv {
|
||||
|
||||
|
||||
u32 Provider::getPageCount() const {
|
||||
return std::ceil(this->getActualSize() / double(PageSize));
|
||||
return std::max(1.0, std::ceil(this->getActualSize() / double(PageSize)));
|
||||
}
|
||||
|
||||
u32 Provider::getCurrentPage() const {
|
||||
|
@ -64,10 +64,6 @@ namespace hex {
|
||||
}
|
||||
|
||||
static void signalHandler(int signalNumber) {
|
||||
// Ignore SIGTERMs and SIGINTs so ImHex can be killed with Ctrl+C and a debugger
|
||||
if (signalNumber == SIGTERM || signalNumber == SIGINT)
|
||||
return;
|
||||
|
||||
log::fatal("Terminating with signal {}", signalNumber);
|
||||
|
||||
EventManager::post<EventAbnormalTermination>(signalNumber);
|
||||
@ -150,9 +146,11 @@ namespace hex {
|
||||
this->m_popupsToOpen.push_back(name);
|
||||
});
|
||||
|
||||
for (u32 signal = 0; signal < NSIG; signal++)
|
||||
std::signal(signal, signalHandler);
|
||||
std::set_terminate([]{ signalHandler(SIGTERM); });
|
||||
for (u32 signal = 0; signal < NSIG; signal++) {
|
||||
if (signal != SIGTERM && signal != SIGINT)
|
||||
std::signal(signal, signalHandler);
|
||||
}
|
||||
std::set_terminate([]{ signalHandler(SIGABRT); });
|
||||
|
||||
auto imhexLogo = romfs::get("logo.png");
|
||||
this->m_logoTexture = ImGui::LoadImageFromMemory(reinterpret_cast<const ImU8 *>(imhexLogo.data()), imhexLogo.size());
|
||||
|
@ -410,7 +410,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
ImGui::BeginDisabled(this->m_searchRunning);
|
||||
{
|
||||
ui::regionSelectionPicker(&this->m_searchSettings.range);
|
||||
ui::regionSelectionPicker(&this->m_searchSettings.range, true, true);
|
||||
|
||||
ImGui::NewLine();
|
||||
|
||||
|
@ -262,6 +262,13 @@ namespace hex::plugin::builtin {
|
||||
|
||||
ImGui::EndTable();
|
||||
}
|
||||
|
||||
ImGui::SetCursorPos(ImVec2(ImGui::GetWindowSize().x - ImGui::CalcTextSize("X").x * 2, 0));
|
||||
if (ImGui::Hyperlink("X")) {
|
||||
auto provider = ImHexApi::Provider::createProvider("hex.builtin.provider.null");
|
||||
if (provider != nullptr)
|
||||
(void)provider->open();
|
||||
}
|
||||
}
|
||||
|
||||
static void drawWelcomeScreen() {
|
||||
|
Loading…
Reference in New Issue
Block a user