From 90abe982ed98c2f212c11e6e398fa161e302c433 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 17 Dec 2023 23:22:39 +0100 Subject: [PATCH] fix: Bookmark region setting not being locked correctly --- plugins/builtin/romfs/lang/de_DE.json | 2 +- plugins/builtin/romfs/lang/en_US.json | 2 +- plugins/builtin/romfs/lang/es_ES.json | 2 +- plugins/builtin/romfs/lang/it_IT.json | 2 +- plugins/builtin/romfs/lang/ja_JP.json | 2 +- plugins/builtin/romfs/lang/ko_KR.json | 2 +- plugins/builtin/romfs/lang/pt_BR.json | 2 +- plugins/builtin/romfs/lang/zh_CN.json | 2 +- plugins/builtin/romfs/lang/zh_TW.json | 2 +- .../source/content/views/view_bookmarks.cpp | 22 +++++++++++-------- 10 files changed, 22 insertions(+), 18 deletions(-) diff --git a/plugins/builtin/romfs/lang/de_DE.json b/plugins/builtin/romfs/lang/de_DE.json index fcd5a0834..e4a79b863 100644 --- a/plugins/builtin/romfs/lang/de_DE.json +++ b/plugins/builtin/romfs/lang/de_DE.json @@ -665,7 +665,7 @@ "hex.builtin.view.bookmarks.address": "0x{0:02X} - 0x{1:02X}", "hex.builtin.view.bookmarks.button.jump": "Gehe zu", "hex.builtin.view.bookmarks.button.remove": "Entfernen", - "hex.builtin.view.bookmarks.default_title": "Lesezeichen [0x{0:X} - 0x{1:X}]", + "hex.builtin.view.bookmarks.default_title": "Lesezeichen [0x{0:02X} - 0x{1:02X}]", "hex.builtin.view.bookmarks.header.color": "Farbe", "hex.builtin.view.bookmarks.header.comment": "Kommentar", "hex.builtin.view.bookmarks.header.name": "Name", diff --git a/plugins/builtin/romfs/lang/en_US.json b/plugins/builtin/romfs/lang/en_US.json index 327f96790..cf65cd29f 100644 --- a/plugins/builtin/romfs/lang/en_US.json +++ b/plugins/builtin/romfs/lang/en_US.json @@ -766,7 +766,7 @@ "hex.builtin.view.bookmarks.address": "0x{0:02X} - 0x{1:02X}", "hex.builtin.view.bookmarks.button.jump": "Jump to", "hex.builtin.view.bookmarks.button.remove": "Remove", - "hex.builtin.view.bookmarks.default_title": "Bookmark [0x{0:X} - 0x{1:X}]", + "hex.builtin.view.bookmarks.default_title": "Bookmark [0x{0:02X} - 0x{1:02X}]", "hex.builtin.view.bookmarks.header.color": "Color", "hex.builtin.view.bookmarks.header.comment": "Comment", "hex.builtin.view.bookmarks.header.name": "Name", diff --git a/plugins/builtin/romfs/lang/es_ES.json b/plugins/builtin/romfs/lang/es_ES.json index 4253cc1c6..c3167feed 100644 --- a/plugins/builtin/romfs/lang/es_ES.json +++ b/plugins/builtin/romfs/lang/es_ES.json @@ -664,7 +664,7 @@ "hex.builtin.view.bookmarks.address": "0x{0:02X} - 0x{1:02X}", "hex.builtin.view.bookmarks.button.jump": "Saltar a", "hex.builtin.view.bookmarks.button.remove": "Eliminar", - "hex.builtin.view.bookmarks.default_title": "Marcador [0x{0:X} - 0x{1:X}]", + "hex.builtin.view.bookmarks.default_title": "Marcador [0x{0:02X} - 0x{1:02X}]", "hex.builtin.view.bookmarks.header.color": "Color", "hex.builtin.view.bookmarks.header.comment": "Comentario", "hex.builtin.view.bookmarks.header.name": "Nombre", diff --git a/plugins/builtin/romfs/lang/it_IT.json b/plugins/builtin/romfs/lang/it_IT.json index 0631ae04f..d58004300 100644 --- a/plugins/builtin/romfs/lang/it_IT.json +++ b/plugins/builtin/romfs/lang/it_IT.json @@ -664,7 +664,7 @@ "hex.builtin.view.bookmarks.address": "0x{0:02X} - 0x{1:02X}", "hex.builtin.view.bookmarks.button.jump": "Vai a", "hex.builtin.view.bookmarks.button.remove": "Rimuovi", - "hex.builtin.view.bookmarks.default_title": "Segnalibro [0x{0:X} - 0x{1:X}]", + "hex.builtin.view.bookmarks.default_title": "Segnalibro [0x{0:02X} - 0x{1:02X}]", "hex.builtin.view.bookmarks.header.color": "Colore", "hex.builtin.view.bookmarks.header.comment": "Commento", "hex.builtin.view.bookmarks.header.name": "Nome", diff --git a/plugins/builtin/romfs/lang/ja_JP.json b/plugins/builtin/romfs/lang/ja_JP.json index 1cd41cb4d..47aafd296 100644 --- a/plugins/builtin/romfs/lang/ja_JP.json +++ b/plugins/builtin/romfs/lang/ja_JP.json @@ -664,7 +664,7 @@ "hex.builtin.view.bookmarks.address": "0x{0:02X} - 0x{1:02X}", "hex.builtin.view.bookmarks.button.jump": "移動", "hex.builtin.view.bookmarks.button.remove": "削除", - "hex.builtin.view.bookmarks.default_title": "ブックマーク [0x{0:X} - 0x{1:X}]", + "hex.builtin.view.bookmarks.default_title": "ブックマーク [0x{0:02X} - 0x{1:02X}]", "hex.builtin.view.bookmarks.header.color": "色", "hex.builtin.view.bookmarks.header.comment": "コメント", "hex.builtin.view.bookmarks.header.name": "名前", diff --git a/plugins/builtin/romfs/lang/ko_KR.json b/plugins/builtin/romfs/lang/ko_KR.json index 658e3a57a..8afa2a0e4 100644 --- a/plugins/builtin/romfs/lang/ko_KR.json +++ b/plugins/builtin/romfs/lang/ko_KR.json @@ -678,7 +678,7 @@ "hex.builtin.view.bookmarks.address": "0x{0:02X} ~ 0x{1:02X}", "hex.builtin.view.bookmarks.button.jump": "이동하기", "hex.builtin.view.bookmarks.button.remove": "지우기", - "hex.builtin.view.bookmarks.default_title": "북마크 [0x{0:X} ~ 0x{1:X}]", + "hex.builtin.view.bookmarks.default_title": "북마크 [0x{0:02X} ~ 0x{1:02X}]", "hex.builtin.view.bookmarks.header.color": "색상", "hex.builtin.view.bookmarks.header.comment": "설명", "hex.builtin.view.bookmarks.header.name": "이름", diff --git a/plugins/builtin/romfs/lang/pt_BR.json b/plugins/builtin/romfs/lang/pt_BR.json index 619e819ec..a93efd479 100644 --- a/plugins/builtin/romfs/lang/pt_BR.json +++ b/plugins/builtin/romfs/lang/pt_BR.json @@ -664,7 +664,7 @@ "hex.builtin.view.bookmarks.address": "0x{0:02X} - 0x{1:02X}", "hex.builtin.view.bookmarks.button.jump": "Pular para", "hex.builtin.view.bookmarks.button.remove": "Remover", - "hex.builtin.view.bookmarks.default_title": "Favorito [0x{0:X} - 0x{1:X}]", + "hex.builtin.view.bookmarks.default_title": "Favorito [0x{0:02X} - 0x{1:02X}]", "hex.builtin.view.bookmarks.header.color": "Cor", "hex.builtin.view.bookmarks.header.comment": "Comentar", "hex.builtin.view.bookmarks.header.name": "Nome", diff --git a/plugins/builtin/romfs/lang/zh_CN.json b/plugins/builtin/romfs/lang/zh_CN.json index 9886cfcb2..813e6acf0 100644 --- a/plugins/builtin/romfs/lang/zh_CN.json +++ b/plugins/builtin/romfs/lang/zh_CN.json @@ -678,7 +678,7 @@ "hex.builtin.view.bookmarks.address": "0x{0:02X} - 0x{1:02X}", "hex.builtin.view.bookmarks.button.jump": "转到", "hex.builtin.view.bookmarks.button.remove": "移除", - "hex.builtin.view.bookmarks.default_title": "书签 [0x{0:X} - 0x{1:X}]", + "hex.builtin.view.bookmarks.default_title": "书签 [0x{0:02X} - 0x{1:02X}]", "hex.builtin.view.bookmarks.header.color": "颜色", "hex.builtin.view.bookmarks.header.comment": "注释", "hex.builtin.view.bookmarks.header.name": "名称", diff --git a/plugins/builtin/romfs/lang/zh_TW.json b/plugins/builtin/romfs/lang/zh_TW.json index f5e5f9cf8..9d0598200 100644 --- a/plugins/builtin/romfs/lang/zh_TW.json +++ b/plugins/builtin/romfs/lang/zh_TW.json @@ -678,7 +678,7 @@ "hex.builtin.view.bookmarks.address": "0x{0:02X} - 0x{1:02X}", "hex.builtin.view.bookmarks.button.jump": "跳至", "hex.builtin.view.bookmarks.button.remove": "移除", - "hex.builtin.view.bookmarks.default_title": "書籤 [0x0:{X} - 0x1:{X}]", + "hex.builtin.view.bookmarks.default_title": "書籤 [0x{0:02X} - 0x{1:02X}]", "hex.builtin.view.bookmarks.header.color": "顏色", "hex.builtin.view.bookmarks.header.comment": "註解", "hex.builtin.view.bookmarks.header.name": "名稱", diff --git a/plugins/builtin/source/content/views/view_bookmarks.cpp b/plugins/builtin/source/content/views/view_bookmarks.cpp index 398ed6cd5..aed4d4b5e 100644 --- a/plugins/builtin/source/content/views/view_bookmarks.cpp +++ b/plugins/builtin/source/content/views/view_bookmarks.cpp @@ -386,16 +386,20 @@ namespace hex::plugin::builtin { u64 begin = region.getStartAddress(); u64 end = region.getEndAddress(); - ImGui::PushItemWidth(100_scaled); - ImGuiExt::InputHexadecimal("##begin", &begin); - ImGui::SameLine(); - ImGui::TextUnformatted(" - "); - ImGui::SameLine(); - ImGuiExt::InputHexadecimal("##end", &end); - ImGui::PopItemWidth(); + if (!locked) { + ImGui::PushItemWidth(100_scaled); + ImGuiExt::InputHexadecimal("##begin", &begin); + ImGui::SameLine(0, 0); + ImGui::TextUnformatted(" - "); + ImGui::SameLine(0, 0); + ImGuiExt::InputHexadecimal("##end", &end); + ImGui::PopItemWidth(); - if (end > begin) - region = Region(begin, end - begin + 1); + if (end > begin) + region = Region(begin, end - begin + 1); + } else { + ImGuiExt::TextFormatted("0x{:02X} - 0x{:02X}", begin, end); + } ImGui::TableNextRow(ImGuiTableRowFlags_None, rowHeight); ImGui::TableNextColumn();