impr: Move update button from welcome screen to the title bar and show a toast

This commit is contained in:
WerWolv
2025-02-15 19:25:29 +01:00
parent d8877e7d8b
commit cf194e332c
13 changed files with 20 additions and 19 deletions

View File

@@ -541,6 +541,15 @@ namespace hex::plugin::builtin {
ContentRegistry::Interface::addMenuItemToToolbar("hex.builtin.view.hex_editor.menu.file.save", ImGuiCustomCol_ToolbarBlue);
ContentRegistry::Interface::addMenuItemToToolbar("hex.builtin.view.hex_editor.menu.file.save_as", ImGuiCustomCol_ToolbarBlue);
ContentRegistry::Interface::addMenuItemToToolbar("hex.builtin.menu.edit.bookmark.create", ImGuiCustomCol_ToolbarGreen);
const auto &initArgs = ImHexApi::System::getInitArguments();
if (auto it = initArgs.find("update-available"); it != initArgs.end()) {
ContentRegistry::Interface::addTitleBarButton(ICON_VS_GIFT, "hex.builtin.welcome.update.title", [] {
ImHexApi::System::updateImHex(ImHexApi::System::UpdateType::Stable);
});
ui::ToastInfo::open(hex::format("hex.builtin.welcome.update.desc"_lang, it->second));
}
});
}