74 const ImGuiStyle& style = ImGui::GetStyle();
76 {{ImGuiStyleVar_FramePadding,
77 ImVec2(std::max(4.0f, style.FramePadding.x),
78 std::max(3.0f, style.FramePadding.y - 1.0f))},
79 {ImGuiStyleVar_ItemSpacing,
80 ImVec2(std::max(4.0f, style.ItemSpacing.x),
81 std::max(3.0f, style.ItemSpacing.y - 1.0f))}});
84 ImGui::OpenPopup(
"JumpToAddress");
86 if (ImGui::IsItemHovered()) {
87 ImGui::SetTooltip(tr(
"Jump to specific address"));
91 ImGui::BeginDisabled();
94 if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) {
96 tr(
"Hex pattern search is not available yet. Use Jump to go to an "
102 ImGui::OpenPopup(
"Bookmarks");
104 if (ImGui::IsItemHovered()) {
105 ImGui::SetTooltip(tr(
"Manage address bookmarks"));
126 if (ImGui::BeginPopupModal(
"JumpToAddress",
nullptr,
127 ImGuiWindowFlags_AlwaysAutoResize)) {
133 ImGui::SetNextItemWidth(200);
136 ImGuiInputTextFlags_CharsHexadecimal |
137 ImGuiInputTextFlags_EnterReturnsTrue)) {
143 ImGui::CloseCurrentPopup();
146 ImGui::TextDisabled(tr(
"Format: 0x1C800 or 1C800"));
158 ImGui::CloseCurrentPopup();
162 ImGui::CloseCurrentPopup();
169 if (ImGui::BeginPopupModal(
"Bookmarks",
nullptr,
170 ImGuiWindowFlags_AlwaysAutoResize)) {
182 if (ImGui::Button(
ICON_MD_ADD " Add Current Address", ImVec2(250, 0))) {
186 absl::StrFormat(
"Bookmark %zu",
bookmarks_.size() + 1);
187 new_bookmark.
description =
"User-defined bookmark";
192 ImGui::BeginChild(
"##bookmarks_list", ImVec2(0, 300),
true);
193 if (ImGui::BeginTable(
"##bookmarks_table", 3,
194 ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg |
195 ImGuiTableFlags_Resizable)) {
196 ImGui::TableSetupColumn(
"Name", ImGuiTableColumnFlags_WidthFixed, 150);
197 ImGui::TableSetupColumn(
"Address", ImGuiTableColumnFlags_WidthFixed,
199 ImGui::TableSetupColumn(
"Description",
200 ImGuiTableColumnFlags_WidthStretch);
201 ImGui::TableHeadersRow();
203 for (
size_t i = 0; i <
bookmarks_.size(); ++i) {
205 ImGui::PushID(
static_cast<int>(i));
207 ImGui::TableNextRow();
208 ImGui::TableNextColumn();
209 if (ImGui::Selectable(bm.name.c_str(),
false,
210 ImGuiSelectableFlags_SpanAllColumns)) {
213 ImGui::CloseCurrentPopup();
216 ImGui::TableNextColumn();
219 ImGui::TableNextColumn();
220 ImGui::TextDisabled(
"%s", bm.description.c_str());
229 if (ImGui::Button(
ICON_MD_ADD " Add Bookmark", ImVec2(150, 0))) {
233 absl::StrFormat(
"Bookmark %zu",
bookmarks_.size() + 1);
234 new_bookmark.
description =
"User-defined bookmark";
248 ImGui::CloseCurrentPopup();