From 3dd4fef45a743619b26449a936e54f38c0699083 Mon Sep 17 00:00:00 2001 From: orz12 Date: Sun, 2 Jun 2024 12:24:23 +0800 Subject: [PATCH] =?UTF-8?q?mod:=20=E9=87=87=E7=94=A8=E6=9B=B4=E5=87=86?= =?UTF-8?q?=E7=A1=AE=E7=9A=84=E9=85=8D=E7=BD=AE=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/main/view.dart | 10 +++++----- lib/pages/setting/style_setting.dart | 7 ++++--- lib/utils/grid.dart | 2 +- lib/utils/storage.dart | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index af6e0220..b338b847 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -29,7 +29,7 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { int? _lastSelectTime; //上次点击时间 Box setting = GStrorage.setting; late bool enableMYBar; - late bool adaptiveNavBar; + late bool useSideBar; late bool enableGradientBg; @override @@ -39,8 +39,8 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { _mainController.pageController = PageController(initialPage: _mainController.selectedIndex); enableMYBar = setting.get(SettingBoxKey.enableMYBar, defaultValue: true); - adaptiveNavBar = - setting.get(SettingBoxKey.adaptiveNavBar, defaultValue: false); + useSideBar = + setting.get(SettingBoxKey.useSideBar, defaultValue: false); enableGradientBg = setting.get(SettingBoxKey.enableGradientBg, defaultValue: true); } @@ -150,7 +150,7 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - if (adaptiveNavBar) ...[ + if (useSideBar) ...[ SizedBox( width: 55, child: NavigationRail( @@ -205,7 +205,7 @@ class _MainAppState extends State with SingleTickerProviderStateMixin { ], ) ]), - bottomNavigationBar: adaptiveNavBar + bottomNavigationBar: useSideBar ? null : StreamBuilder( stream: _mainController.hideTabBar diff --git a/lib/pages/setting/style_setting.dart b/lib/pages/setting/style_setting.dart index f7241de7..e4225148 100644 --- a/lib/pages/setting/style_setting.dart +++ b/lib/pages/setting/style_setting.dart @@ -86,7 +86,7 @@ class _StyleSettingState extends State { title: '改用侧边栏', subTitle: '开启后底栏被替换,且底栏相关设置失效', leading: Icon(Icons.chrome_reader_mode_outlined), - setKey: SettingBoxKey.adaptiveNavBar, + setKey: SettingBoxKey.useSideBar, defaultVal: false, ), const SetSwitchItem( @@ -136,7 +136,7 @@ class _StyleSettingState extends State { const SetSwitchItem( title: '播放页移除安全边距', subTitle: '隐藏状态栏、撑满屏幕,但播放控件仍处于安全域内', - leading: Icon(Icons.crop_outlined), + leading: Icon(Icons.fit_screen_outlined), setKey: SettingBoxKey.videoPlayerRemoveSafeArea, defaultVal: false, needReboot: true, @@ -153,7 +153,8 @@ class _StyleSettingState extends State { dense: false, title: Text('动态页Up主显示位置', style: titleStyle), leading: const Icon(Icons.person_outlined), - subtitle: Text('当前:${upPanelPosition.labels}', style: subTitleStyle), + subtitle: + Text('当前:${upPanelPosition.labels}', style: subTitleStyle), onTap: () async { UpPanelPosition? result = await showDialog( context: context, diff --git a/lib/utils/grid.dart b/lib/utils/grid.dart index 322153b0..0ce07b4c 100644 --- a/lib/utils/grid.dart +++ b/lib/utils/grid.dart @@ -11,7 +11,7 @@ class Grid { // if (screenWidthOffset != null) { // screenWidth -= screenWidthOffset; // } - // if (GStrorage.setting.get(SettingBoxKey.adaptiveNavBar, defaultValue: false) as bool) { + // if (GStrorage.setting.get(SettingBoxKey.useSideBar, defaultValue: false) as bool) { // screenWidth -= 55; // } // int columnCount = ((screenWidth - crossAxisSpacing) / (maxCrossAxisExtent + crossAxisSpacing)).ceil(); diff --git a/lib/utils/storage.dart b/lib/utils/storage.dart index 033b6493..2d963280 100644 --- a/lib/utils/storage.dart +++ b/lib/utils/storage.dart @@ -180,10 +180,10 @@ class SettingBoxKey { enableSingleRow = 'enableSingleRow', // 首页单列 displayMode = 'displayMode', maxRowWidth = 'maxRowWidth', // 首页列最大宽度(dp) - videoPlayerRemoveSafeArea = 'videoPlayerHideStatusBar', + videoPlayerRemoveSafeArea = 'videoPlayerRemoveSafeArea', // 视频播放器移除安全边距 dynamicsWaterfallFlow = 'dynamicsWaterfallFlow', // 动态瀑布流 upPanelPosition = 'upPanelPosition', // up主面板位置 - adaptiveNavBar = 'adaptiveNavBar', + useSideBar = 'useSideBar', enableMYBar = 'enableMYBar', hideSearchBar = 'hideSearchBar', // 收起顶栏 hideTabBar = 'hideTabBar', // 收起底栏