Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

chore: better desktop compact layout

Prediditbb338c251b61
diff --git a/lib/main.dart b/lib/main.dart
index bdcfd903..b9c417dc 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -66,7 +66,7 @@ void main() async {
await windowManager.ensureInitialized();
bool isLowResolution = await Utils.isLowResolution();
WindowOptions windowOptions = WindowOptions(
- size: isLowResolution ? const Size(800, 600) : const Size(1280, 860),
+ size: isLowResolution ? const Size(840, 600) : const Size(1280, 860),
center: true,
skipTaskbar: false,
// macOS always hide title bar regardless of showWindowButton setting
diff --git a/lib/pages/player/player_item.dart b/lib/pages/player/player_item.dart
index 5ade4cf6..7305d5de 100644
--- a/lib/pages/player/player_item.dart
+++ b/lib/pages/player/player_item.dart
@@ -951,9 +951,18 @@ class _PlayerItemState extends State<PlayerItem>
return false;
}
// does not meet Google's phone landscape height and tablet landscape width requirements.
- if (MediaQuery.sizeOf(context).height >
- LayoutBreakpoint.compact['height']! &&
- MediaQuery.sizeOf(context).width < LayoutBreakpoint.medium['width']!) {
+ if (!Utils.isDesktop() &&
+ (MediaQuery.sizeOf(context).height >
+ LayoutBreakpoint.compact['height']! &&
+ MediaQuery.sizeOf(context).width <
+ LayoutBreakpoint.medium['width']!)) {
+ return false;
+ }
+ if (Utils.isDesktop() &&
+ (MediaQuery.sizeOf(context).height >
+ LayoutBreakpoint.compact['height']! &&
+ MediaQuery.sizeOf(context).width <
+ LayoutBreakpoint.compact['width']!)) {
return false;
}
return true;
@@ -1000,7 +1009,8 @@ class _PlayerItemState extends State<PlayerItem>
_massiveMode =
setting.get(SettingBoxKey.danmakuMassive, defaultValue: false);
_danmakuColor = setting.get(SettingBoxKey.danmakuColor, defaultValue: true);
- _danmakuDuration = setting.get(SettingBoxKey.danmakuDuration, defaultValue: 8.0);
+ _danmakuDuration =
+ setting.get(SettingBoxKey.danmakuDuration, defaultValue: 8.0);
_danmakuBiliBiliSource =
setting.get(SettingBoxKey.danmakuBiliBiliSource, defaultValue: true);
_danmakuGamerSource =
@@ -1273,7 +1283,8 @@ class _PlayerItemState extends State<PlayerItem>
area: _danmakuArea,
opacity: _opacity,
fontSize: _fontSize,
- duration: _danmakuDuration ~/ playerController.playerSpeed,
+ duration:
+ _danmakuDuration ~/ playerController.playerSpeed,
showStroke: _border,
fontWeight: _danmakuFontWeight,
massiveMode: _massiveMode,