From 83b7d8de2bb09bb5d31c4d1adce0634f14387380 Mon Sep 17 00:00:00 2001 From: yparitcher Date: Fri, 8 Nov 2019 15:01:38 -0500 Subject: [PATCH] [UX] Default setting option always enabled (#5580) as per https://github.com/koreader/koreader/pull/5522#issuecomment-548006595 do not grey out the current default --- frontend/apps/reader/modules/readerdictionary.lua | 2 -- frontend/apps/reader/modules/readerhighlight.lua | 2 -- frontend/apps/reader/modules/readerpaging.lua | 2 -- frontend/apps/reader/modules/readerrolling.lua | 2 -- frontend/apps/reader/modules/readertypeset.lua | 2 -- 5 files changed, 10 deletions(-) diff --git a/frontend/apps/reader/modules/readerdictionary.lua b/frontend/apps/reader/modules/readerdictionary.lua index dd6664019..dc775837c 100644 --- a/frontend/apps/reader/modules/readerdictionary.lua +++ b/frontend/apps/reader/modules/readerdictionary.lua @@ -972,14 +972,12 @@ The current default (★) is enabled.]]) choice1_text_func = function() return disable_fuzzy_search and _("Disable (★)") or _("Disable") end, - choice1_enabled = not disable_fuzzy_search, choice1_callback = function() G_reader_settings:saveSetting("disable_fuzzy_search", true) end, choice2_text_func = function() return disable_fuzzy_search and _("Enable") or _("Enable (★)") end, - choice2_enabled = disable_fuzzy_search, choice2_callback = function() G_reader_settings:saveSetting("disable_fuzzy_search", false) end, diff --git a/frontend/apps/reader/modules/readerhighlight.lua b/frontend/apps/reader/modules/readerhighlight.lua index 3734d15ed..ebd98d139 100644 --- a/frontend/apps/reader/modules/readerhighlight.lua +++ b/frontend/apps/reader/modules/readerhighlight.lua @@ -1187,14 +1187,12 @@ function ReaderHighlight:toggleDefault() choice1_text_func = function() return highlight_disabled and _("Disable (★)") or _("Disable") end, - choice1_enabled = not highlight_disabled, choice1_callback = function() G_reader_settings:saveSetting("highlight_disabled", true) end, choice2_text_func = function() return highlight_disabled and _("Enable") or _("Enable (★)") end, - choice2_enabled = highlight_disabled, choice2_callback = function() G_reader_settings:saveSetting("highlight_disabled", false) end, diff --git a/frontend/apps/reader/modules/readerpaging.lua b/frontend/apps/reader/modules/readerpaging.lua index 2ed2d0a42..209dbad89 100644 --- a/frontend/apps/reader/modules/readerpaging.lua +++ b/frontend/apps/reader/modules/readerpaging.lua @@ -251,7 +251,6 @@ function ReaderPaging:addToMainMenu(menu_items) choice1_text_func = function() return inverse_reading_order and _("LTR") or _("LTR (★)") end, - choice1_enabled = inverse_reading_order, choice1_callback = function() G_reader_settings:saveSetting("inverse_reading_order", false) if touchmenu_instance then touchmenu_instance:updateItems() end @@ -259,7 +258,6 @@ function ReaderPaging:addToMainMenu(menu_items) choice2_text_func = function() return inverse_reading_order and _("RTL (★)") or _("RTL") end, - choice2_enabled = not inverse_reading_order, choice2_callback = function() G_reader_settings:saveSetting("inverse_reading_order", true) if touchmenu_instance then touchmenu_instance:updateItems() end diff --git a/frontend/apps/reader/modules/readerrolling.lua b/frontend/apps/reader/modules/readerrolling.lua index 88d0ca364..8ef6a2764 100644 --- a/frontend/apps/reader/modules/readerrolling.lua +++ b/frontend/apps/reader/modules/readerrolling.lua @@ -378,7 +378,6 @@ function ReaderRolling:addToMainMenu(menu_items) choice1_text_func = function() return inverse_reading_order and _("LTR") or _("LTR (★)") end, - choice1_enabled = inverse_reading_order, choice1_callback = function() G_reader_settings:saveSetting("inverse_reading_order", false) if touchmenu_instance then touchmenu_instance:updateItems() end @@ -386,7 +385,6 @@ function ReaderRolling:addToMainMenu(menu_items) choice2_text_func = function() return inverse_reading_order and _("RTL (★)") or _("RTL") end, - choice2_enabled = not inverse_reading_order, choice2_callback = function() G_reader_settings:saveSetting("inverse_reading_order", true) if touchmenu_instance then touchmenu_instance:updateItems() end diff --git a/frontend/apps/reader/modules/readertypeset.lua b/frontend/apps/reader/modules/readertypeset.lua index 84d2b96e8..3b9b961b8 100644 --- a/frontend/apps/reader/modules/readertypeset.lua +++ b/frontend/apps/reader/modules/readertypeset.lua @@ -436,14 +436,12 @@ function ReaderTypeset:makeDefaultFloatingPunctuation() choice1_text_func = function() return floating_punctuation and _("Disable") or _("Disable (★)") end, - choice1_enabled = floating_punctuation, choice1_callback = function() G_reader_settings:saveSetting("floating_punctuation", false) end, choice2_text_func = function() return floating_punctuation and _("Enable (★)") or _("Enable") end, - choice2_enabled = not floating_punctuation, choice2_callback = function() G_reader_settings:saveSetting("floating_punctuation", true) end,