1
0
mirror of synced 2024-11-28 17:40:51 +01:00

ui: Add tooltips to custom titlebar buttons

This commit is contained in:
WerWolv 2021-08-18 23:12:27 +02:00
parent b66304fc91
commit 63f4d553cc
10 changed files with 27 additions and 5 deletions

View File

@ -38,6 +38,8 @@ namespace ImGui {
void Header(const char *label, bool firstEntry = false);
void InfoTooltip(const char *text);
inline bool HasSecondPassed() {
return static_cast<ImU32>(ImGui::GetTime() * 100) % 100 <= static_cast<ImU32>(ImGui::GetIO().DeltaTime * 100);
}

View File

@ -204,6 +204,14 @@ namespace ImGui {
ImGui::Separator();
}
void InfoTooltip(const char *text) {
if (IsItemHovered()) {
BeginTooltip();
TextUnformatted(text);
EndTooltip();
}
}
ImU32 GetCustomColorU32(ImGuiCustomCol idx, float alpha_mul) {
auto& customData = *static_cast<ImHexCustomData*>(GImGui->IO.UserData);
ImVec4 c = customData.Colors[idx];

View File

@ -65,8 +65,6 @@ namespace hex {
ImGui::Texture m_bannerTexture;
ImGui::Texture m_logoTexture;
std::filesystem::path m_safetyBackupPath;
};

View File

@ -13,6 +13,8 @@ namespace hex::plugin::builtin {
{ "hex.menu.view.fps", "FPS anzeigen" },
{ "hex.menu.view.demo", "ImGui Demo anzeigen" },
{ "hex.menu.help", "Hilfe" },
{ "hex.menu.feedback", "Feedback hinterlassen" },
{ "hex.menu.debug_build", "Debug build"},
{ "hex.welcome.header.main", "Wilkommen zu ImHex" },
{ "hex.welcome.header.start", "Start" },

View File

@ -13,6 +13,8 @@ namespace hex::plugin::builtin {
{ "hex.menu.view.fps", "Display FPS" },
{ "hex.menu.view.demo", "Show ImGui Demo" },
{ "hex.menu.help", "Help" },
{ "hex.menu.feedback", "Leave Feedback" },
{ "hex.menu.debug_build", "Debug build"},
{ "hex.welcome.header.main", "Welcome to ImHex" },
{ "hex.welcome.header.start", "Start" },

View File

@ -13,6 +13,8 @@ namespace hex::plugin::builtin {
{ "hex.menu.view.fps", "Mostra FPS" },
{ "hex.menu.view.demo", "Mostra la demo di ImGui" },
{ "hex.menu.help", "Aiuto" },
//{ "hex.menu.feedback", "Leave Feedback" },
//{ "hex.menu.debug_build", "Debug build"},
{ "hex.welcome.header.main", "Benvenuto in ImHex" },
{ "hex.welcome.header.start", "Inizia" },

View File

@ -43,9 +43,7 @@ namespace hex {
View::doLater([]{ ImGui::OpenPopup(View::toWindowName("hex.view.settings.name").c_str()); });
this->getWindowOpenState() = true;
}
if (ImGui::MenuItem("Crash")) {
*reinterpret_cast<int*>(8) = 16;
}
ImGui::EndMenu();
}
}

View File

@ -12,6 +12,10 @@
}
void Window::drawTitleBar() {
}
}
#endif

View File

@ -12,6 +12,10 @@
}
void Window::drawTitleBar() {
}
}
#endif

View File

@ -148,9 +148,11 @@
#if defined(DEBUG)
if (ImGui::Button(ICON_VS_DEBUG, buttonSize))
hex::openWebpage("https://imhex.werwolv.net/debug");
ImGui::InfoTooltip("hex.menu.debug_build"_lang);
#endif
if (ImGui::Button(ICON_VS_SMILEY, buttonSize))
hex::openWebpage("mailto://hey@werwolv.net");
ImGui::InfoTooltip("hex.menu.feedback"_lang);
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - buttonSize.x * 3);
if (ImGui::Button(ICON_VS_CHROME_MINIMIZE, buttonSize))