feat: Display titlebar buttons when not running borderless (#1099)

Tested on Linux (non-borderless) and Windows (borderless)

You may want to also test it just to be sure
This commit is contained in:
iTrooz
2023-05-25 09:26:40 +02:00
committed by GitHub
parent 7d457998d7
commit d2638c4f27
9 changed files with 112 additions and 84 deletions

View File

@@ -13,31 +13,6 @@
namespace hex::plugin::windows {
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;
std::unreachable();
} 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");
std::unreachable();
} else {
hex::openWebpage("https://imhex.werwolv.net/debug");
}
});
#endif
ContentRegistry::Interface::addTitleBarButton(ICON_VS_SMILEY, "hex.windows.title_bar_button.feedback", []{
hex::openWebpage("https://github.com/WerWolv/ImHex/discussions/categories/feedback");
});
}
void addFooterItems() {
ContentRegistry::Interface::addFooterItem([] {