sys: Final cleanup to get rid of everything builtin in the main application

This commit is contained in:
WerWolv
2022-02-02 00:36:09 +01:00
parent f76e65a58d
commit 876dbe8179
24 changed files with 818 additions and 783 deletions

View File

@@ -8,7 +8,9 @@
#include <imgui.h>
#include <hex/ui/imgui_imhex_extensions.h>
#include <fontawesome_font.h>
#include <codicons_font.h>
namespace hex::plugin::windows {
@@ -24,6 +26,29 @@ namespace hex::plugin::windows {
return a.QuadPart - b.QuadPart;
}
void addTitleBarButtons() {
#if defined(DEBUG)
ContentRegistry::Interface::addTitleBarButton(ICON_VS_DEBUG, "hex.windows.title_bar_button.debug_build", []{
if (ImGui::GetIO().KeyCtrl) {
// Explicitly trigger a segfault by writing to an invalid memory location
// Used for debugging crashes
*reinterpret_cast<u8 *>(0x10) = 0x10;
} else if (ImGui::GetIO().KeyShift) {
// Explicitly trigger an abort by throwing an uncaught exception
// Used for debugging exception errors
throw std::runtime_error("Debug Error");
} else {
hex::openWebpage("https://imhex.werwolv.net/debug");
}
});
#endif
ContentRegistry::Interface::addTitleBarButton(ICON_VS_SMILEY, "hex.windows.title_bar_button.feedback", []{
hex::openWebpage("mailto://hey@werwolv.net");
});
}
void addFooterItems() {
ContentRegistry::Interface::addFooterItem([] {