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

@@ -1011,7 +1011,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "Auto Backups",
"hex.builtin.welcome.start.recent.auto_backups.backup": "Backup vom {:%Y-%m-%d %H:%M:%S}",
"hex.builtin.welcome.tip_of_the_day": "Tipp des Tages",
"hex.builtin.welcome.update.desc": "ImHex {0} wurde gerade released! Downloade die neue Version hier",
"hex.builtin.welcome.update.desc": "ImHex {0} wurde gerade released!",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "Neues Update verfügbar!"
}

View File

@@ -1159,7 +1159,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "Auto Backups",
"hex.builtin.welcome.start.recent.auto_backups.backup": "Backup from {:%Y-%m-%d %H:%M:%S}",
"hex.builtin.welcome.tip_of_the_day": "Tip of the Day",
"hex.builtin.welcome.update.desc": "ImHex {0} just released! Download it here.",
"hex.builtin.welcome.update.desc": "ImHex {0} just released!",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "New Update available!",
"hex.builtin.welcome.quick_settings.simplified": "Simplified"

View File

@@ -1005,7 +1005,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "",
"hex.builtin.welcome.start.recent.auto_backups.backup": "",
"hex.builtin.welcome.tip_of_the_day": "Consejo del día",
"hex.builtin.welcome.update.desc": "¡ImHex {0} está disponible! Descárguelo aquí.",
"hex.builtin.welcome.update.desc": "¡ImHex {0} está disponible!",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "Nueva actualización disponible!"
}

View File

@@ -1033,7 +1033,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "Automatikus mentések",
"hex.builtin.welcome.start.recent.auto_backups.backup": "Biztonsági mentés: {:%Y-%m-%d %H:%M:%S}",
"hex.builtin.welcome.tip_of_the_day": "A nap tippje",
"hex.builtin.welcome.update.desc": "Megjelent az ImHex {0}! Itt töltheted le.",
"hex.builtin.welcome.update.desc": "Megjelent az ImHex {0}!.",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "Elérhető egy új frissítés!",
"hex.builtin.welcome.quick_settings.simplified": "Egyszerűsített"

View File

@@ -1006,7 +1006,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "",
"hex.builtin.welcome.start.recent.auto_backups.backup": "",
"hex.builtin.welcome.tip_of_the_day": "Consiglio del giorno",
"hex.builtin.welcome.update.desc": "ImHex {0} è appena stato rilasciato! Scaricalo qua",
"hex.builtin.welcome.update.desc": "ImHex {0} è appena stato rilasciato!",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "Nuovo aggiornamento disponibile!"
}

View File

@@ -1006,7 +1006,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "",
"hex.builtin.welcome.start.recent.auto_backups.backup": "",
"hex.builtin.welcome.tip_of_the_day": "今日の豆知識",
"hex.builtin.welcome.update.desc": "ImHex {0} がリリースされました。ここからダウンロードできます。",
"hex.builtin.welcome.update.desc": "ImHex {0} がリリースされました。",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "新しいアップデートが利用可能です。"
}

View File

@@ -1006,7 +1006,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "",
"hex.builtin.welcome.start.recent.auto_backups.backup": "",
"hex.builtin.welcome.tip_of_the_day": "오늘의 팁",
"hex.builtin.welcome.update.desc": "ImHex {0}이(가) 출시되었습니다! 여기서 다운로드하세요.",
"hex.builtin.welcome.update.desc": "ImHex {0}이(가) 출시되었습니다!",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "새 업데이트를 사용할 수 있습니다!"
}

View File

@@ -1006,7 +1006,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "",
"hex.builtin.welcome.start.recent.auto_backups.backup": "",
"hex.builtin.welcome.tip_of_the_day": "Dica do Dia",
"hex.builtin.welcome.update.desc": "ImHex {0} acabou de lançar! Baixe aqui.",
"hex.builtin.welcome.update.desc": "ImHex {0} acabou de lançar!",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "Nova atualização disponivel!"
}

View File

@@ -1129,7 +1129,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "Резервные копии",
"hex.builtin.welcome.start.recent.auto_backups.backup": "Резервная копия от {:%Y-%m-%d %H:%M:%S}",
"hex.builtin.welcome.tip_of_the_day": "Подсказка дня",
"hex.builtin.welcome.update.desc": "ImHex {0} только что вышел! Его можно скачать здесь.",
"hex.builtin.welcome.update.desc": "ImHex {0} только что вышел!",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "Доступно новое обновление!",
"hex.builtin.welcome.quick_settings.simplified": "Простой режим"

View File

@@ -1070,7 +1070,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "自动备份",
"hex.builtin.welcome.start.recent.auto_backups.backup": "备份于 {:%年-%月-%日 %时:%分:%秒}",
"hex.builtin.welcome.tip_of_the_day": "每日提示",
"hex.builtin.welcome.update.desc": "ImHex {0} 已发布!在这里下载。",
"hex.builtin.welcome.update.desc": "ImHex {0} 已发布!",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "新的更新可用!"
}

View File

@@ -1006,7 +1006,7 @@
"hex.builtin.welcome.start.recent.auto_backups": "",
"hex.builtin.welcome.start.recent.auto_backups.backup": "",
"hex.builtin.welcome.tip_of_the_day": "今日提示",
"hex.builtin.welcome.update.desc": "ImHex {0} 發布了!點此下載。",
"hex.builtin.welcome.update.desc": "ImHex {0} 發布了!",
"hex.builtin.welcome.update.link": "https://github.com/WerWolv/ImHex/releases/latest",
"hex.builtin.welcome.update.title": "有可用更新!"
}

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));
}
});
}

View File

@@ -379,14 +379,6 @@ namespace hex::plugin::builtin {
}
ImGuiExt::EndSubWindow();
if (ImHexApi::System::getInitArguments().contains("update-available")) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (ImGuiExt::DescriptionButton("hex.builtin.welcome.update.title"_lang, hex::format("hex.builtin.welcome.update.desc"_lang, ImHexApi::System::getInitArgument("update-available")).c_str(), ImVec2(ImGui::GetContentRegionAvail().x * 0.8F, 0)))
ImHexApi::System::updateImHex(ImHexApi::System::UpdateType::Stable);
}
ImGui::EndTable();
}
ImGui::SameLine();