sys: Added setting to disable multi-window support
This commit is contained in:
parent
eb247b8607
commit
210106901e
@ -20,9 +20,8 @@ int main(int argc, char **argv, char **envp) {
|
||||
|
||||
bool shouldRestart = false;
|
||||
|
||||
EventManager::subscribe<RequestRestartImHex>([&]{ shouldRestart = true; });
|
||||
|
||||
do {
|
||||
EventManager::subscribe<RequestRestartImHex>([&]{ shouldRestart = true; });
|
||||
shouldRestart = false;
|
||||
|
||||
// Initialization
|
||||
|
@ -684,8 +684,9 @@ namespace hex {
|
||||
|
||||
if (glfwGetPrimaryMonitor() != nullptr) {
|
||||
auto sessionType = hex::getEnvironmentVariable("XDG_SESSION_TYPE");
|
||||
bool multiWindowEnabled = ContentRegistry::Settings::read("hex.builtin.setting.interface", "hex.builtin.setting.interface.multi_windows", 1) != 0;
|
||||
|
||||
if (!sessionType || !hex::containsIgnoreCase(*sessionType, "wayland"))
|
||||
if ((!sessionType || !hex::containsIgnoreCase(*sessionType, "wayland")) && multiWindowEnabled)
|
||||
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
}
|
||||
|
||||
|
@ -185,6 +185,17 @@ namespace hex::plugin::builtin {
|
||||
return false;
|
||||
});
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.interface", "hex.builtin.setting.interface.multi_windows", 1, [](auto name, nlohmann::json &setting) {
|
||||
static bool enabled = static_cast<int>(setting);
|
||||
|
||||
if (ImGui::Checkbox(name.data(), &enabled)) {
|
||||
setting = static_cast<int>(enabled);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}, true);
|
||||
|
||||
ContentRegistry::Settings::add("hex.builtin.setting.hex_editor", "hex.builtin.setting.hex_editor.highlight_color", 0x60C08080, [](auto name, nlohmann::json &setting) {
|
||||
static auto color = static_cast<color_t>(setting);
|
||||
|
||||
|
@ -770,6 +770,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.wiki_explain_language", "Wikipedia Sprache" },
|
||||
{ "hex.builtin.setting.interface.fps", "FPS Limite" },
|
||||
{ "hex.builtin.setting.interface.fps.unlocked", "Unbegrenzt" },
|
||||
{ "hex.builtin.setting.interface.multi_windows", "Multi-Window-Unterstützung aktivieren" },
|
||||
{ "hex.builtin.setting.hex_editor", "Hex Editor" },
|
||||
{ "hex.builtin.setting.hex_editor.highlight_color", "Auswahlfarbe" },
|
||||
{ "hex.builtin.setting.hex_editor.bytes_per_row", "Bytes pro Zeile" },
|
||||
|
@ -774,6 +774,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.wiki_explain_language", "Wikipedia Language" },
|
||||
{ "hex.builtin.setting.interface.fps", "FPS Limit" },
|
||||
{ "hex.builtin.setting.interface.fps.unlocked", "Unlocked" },
|
||||
{ "hex.builtin.setting.interface.multi_windows", "Enable Multi Window support" },
|
||||
{ "hex.builtin.setting.hex_editor", "Hex Editor" },
|
||||
{ "hex.builtin.setting.hex_editor.highlight_color", "Selection highlight color" },
|
||||
{ "hex.builtin.setting.hex_editor.bytes_per_row", "Bytes per row" },
|
||||
|
@ -780,6 +780,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.scaling.x2_0", "x4.0" },
|
||||
{ "hex.builtin.setting.interface.fps", "Limite FPS" },
|
||||
{ "hex.builtin.setting.interface.fps.unlocked", "Unblocca" },
|
||||
//{ "hex.builtin.setting.interface.multi_windows", "Enable Multi Window support" },
|
||||
{ "hex.builtin.setting.hex_editor", "Hex Editor" },
|
||||
//{ "hex.builtin.setting.hex_editor.highlight_color", "Selection highlight color" },
|
||||
//{ "hex.builtin.setting.hex_editor.bytes_per_row", "Bytes per row" },
|
||||
|
@ -776,6 +776,7 @@ namespace hex::plugin::builtin {
|
||||
//{ "hex.builtin.setting.interface.wiki_explain_language", "Wikipedia Language" },
|
||||
{ "hex.builtin.setting.interface.fps", "FPS制限" },
|
||||
{ "hex.builtin.setting.interface.fps.unlocked", "無制限" },
|
||||
//{ "hex.builtin.setting.interface.multi_windows", "Enable Multi Window support" },
|
||||
{ "hex.builtin.setting.hex_editor", "Hexエディタ" },
|
||||
{ "hex.builtin.setting.hex_editor.highlight_color", "選択範囲の色" },
|
||||
{ "hex.builtin.setting.hex_editor.bytes_per_row", "1行のバイト数" },
|
||||
|
@ -773,6 +773,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.wiki_explain_language", "Wikipedia 언어" },
|
||||
{ "hex.builtin.setting.interface.fps", "FPS 제한" },
|
||||
{ "hex.builtin.setting.interface.fps.unlocked", "제한 없음" },
|
||||
//{ "hex.builtin.setting.interface.multi_windows", "Enable Multi Window support" },
|
||||
{ "hex.builtin.setting.hex_editor", "헥스 편집기" },
|
||||
{ "hex.builtin.setting.hex_editor.highlight_color", "선택 영역 색상 하이라이트" },
|
||||
{ "hex.builtin.setting.hex_editor.bytes_per_row", "한 줄당 바이트 수" },
|
||||
|
@ -772,6 +772,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.wiki_explain_language", "Idioma do Wikipedia" },
|
||||
{ "hex.builtin.setting.interface.fps", "FPS Limit" },
|
||||
{ "hex.builtin.setting.interface.fps.unlocked", "Destravado" },
|
||||
//{ "hex.builtin.setting.interface.multi_windows", "Enable Multi Window support" },
|
||||
{ "hex.builtin.setting.hex_editor", "Hex Editor" },
|
||||
//{ "hex.builtin.setting.hex_editor.highlight_color", "Selection highlight color" },
|
||||
{ "hex.builtin.setting.hex_editor.bytes_per_row", "Bytes por linha" },
|
||||
|
@ -775,6 +775,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.wiki_explain_language", "维基百科使用语言" },
|
||||
{ "hex.builtin.setting.interface.fps", "FPS 限制" },
|
||||
{ "hex.builtin.setting.interface.fps.unlocked", "无限制" },
|
||||
//{ "hex.builtin.setting.interface.multi_windows", "Enable Multi Window support" },
|
||||
{ "hex.builtin.setting.hex_editor", "Hex 编辑器" },
|
||||
{ "hex.builtin.setting.hex_editor.highlight_color", "选区高亮色" },
|
||||
{ "hex.builtin.setting.hex_editor.bytes_per_row", "每行显示的字节数" },
|
||||
|
@ -772,6 +772,7 @@ namespace hex::plugin::builtin {
|
||||
{ "hex.builtin.setting.interface.wiki_explain_language", "維基百科語言" },
|
||||
{ "hex.builtin.setting.interface.fps", "FPS 限制" },
|
||||
{ "hex.builtin.setting.interface.fps.unlocked", "解鎖" },
|
||||
//{ "hex.builtin.setting.interface.multi_windows", "Enable Multi Window support" },
|
||||
{ "hex.builtin.setting.hex_editor", "十六進位編輯器" },
|
||||
//{ "hex.builtin.setting.hex_editor.highlight_color", "Selection highlight color" },
|
||||
//{ "hex.builtin.setting.hex_editor.bytes_per_row", "Bytes per row" },
|
||||
|
Loading…
x
Reference in New Issue
Block a user