Эх сурвалжийг харах

fix: 翻译图标激活状态

HapeLee 4 сар өмнө
parent
commit
b5d34bf574

+ 4 - 1
app/src/main/java/io/legado/app/ui/book/read/ReadBookMenuBar.kt

@@ -1774,6 +1774,7 @@ private fun FloatingIconRow(
         state.menuConfig.titleBarButtons,
         state.menuConfig.titleBarButtons,
         state.isReadAloudRunning,
         state.isReadAloudRunning,
         state.isAutoPage,
         state.isAutoPage,
+        state.translationMode,
     ) {
     ) {
         loadFloatingIcons(context, state, onIntent)
         loadFloatingIcons(context, state, onIntent)
     }
     }
@@ -2351,7 +2352,8 @@ private fun MenuBottomBar(
             state.menuConfig.bottomBarButtons,
             state.menuConfig.bottomBarButtons,
             state.menuConfig.readMenuCustomIcons,
             state.menuConfig.readMenuCustomIcons,
             state.isReadAloudRunning,
             state.isReadAloudRunning,
-            state.isAutoPage
+            state.isAutoPage,
+            state.translationMode
         ) {
         ) {
             loadToolButtons(context, state, onIntent)
             loadToolButtons(context, state, onIntent)
         }
         }
@@ -3243,6 +3245,7 @@ private fun loadFloatingIcons(
     val activeIds = buildSet {
     val activeIds = buildSet {
         if (state.isReadAloudRunning) add("read_aloud")
         if (state.isReadAloudRunning) add("read_aloud")
         if (state.isAutoPage) add("auto_page")
         if (state.isAutoPage) add("auto_page")
+        if (state.translationMode) add("translate")
     }
     }
 
 
     return state.menuConfig.titleBarButtons
     return state.menuConfig.titleBarButtons