HapeLee il y a 3 mois
Parent
commit
5c3c628514

+ 2 - 2
app/src/main/java/io/legado/app/ui/book/read/ReadBookContract.kt

@@ -391,8 +391,8 @@ data class ReadMenuConfig(
     val readMenuFloatingIconLiquidGlass: Boolean = false,
     val readMenuTopBarBlurStyle: Int = ReadMenuBlurStyle.Solid,
     val readMenuBottomBarBlurStyle: Int = ReadMenuBlurStyle.Solid,
-    val readMenuIconStyle: Int = 0,
-    val titleBarIconStyle: Int = 0,
+    val readMenuIconStyle: Int = 1,
+    val titleBarIconStyle: Int = 1,
     val readMenuIconShowText: Boolean = false,
     val readSliderMode: String = "0",
     val titleBarCustomIcons: ImmutableMap<String, String> = persistentMapOf(),

+ 3 - 13
app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@@ -2564,14 +2564,11 @@ class ReadBookViewModel(
             ReadBookButtonIds.map { id ->
                 ReadBookButtonConfigItem(
                     id = id,
-                    enabled = id in DEFAULT_ENABLED_BUTTON_IDS ||
-                            (preferenceName == TOOL_BUTTON_PREFS && id in DEFAULT_AI_TOOL_BUTTON_IDS),
+                    enabled = id in DEFAULT_ENABLED_BUTTON_IDS,
                 )
             }
         } else {
-            normalizeButtonConfig(raw) { id ->
-                preferenceName == TOOL_BUTTON_PREFS && id in DEFAULT_AI_TOOL_BUTTON_IDS
-            }
+            normalizeButtonConfig(raw)
         }
     }
 
@@ -2589,7 +2586,6 @@ class ReadBookViewModel(
 
     private fun normalizeButtonConfig(
         items: List<ReadBookButtonConfigItem>,
-        defaultEnabled: (String) -> Boolean = { false },
     ): List<ReadBookButtonConfigItem> {
         val seen = mutableSetOf<String>()
         val normalized = items.mapNotNull { item ->
@@ -2602,12 +2598,7 @@ class ReadBookViewModel(
         }.toMutableList()
         ReadBookButtonIds.forEach { id ->
             if (seen.add(id)) {
-                val item = ReadBookButtonConfigItem(id, defaultEnabled(id))
-                if (id in DEFAULT_AI_TOOL_BUTTON_IDS && item.enabled) {
-                    normalized.add(0, item)
-                } else {
-                    normalized.add(item)
-                }
+                normalized.add(ReadBookButtonConfigItem(id, false))
             }
         }
         return normalized
@@ -6518,7 +6509,6 @@ private val DEFAULT_ENABLED_BUTTON_IDS = setOf(
     "read_aloud",
     "setting",
 )
-private val DEFAULT_AI_TOOL_BUTTON_IDS = setOf("ai_summary", "ai_rewrite")
 
 private const val DARK_LUX_THRESHOLD = 8f
 private const val BRIGHT_LUX_THRESHOLD = 100f