opt: popupmenu item

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-29 12:59:52 +08:00
parent 9c989d0699
commit 203906d9f1
3 changed files with 58 additions and 33 deletions

View File

@@ -12,7 +12,7 @@ class FontSizeSelectPage extends StatefulWidget {
class _FontSizeSelectPageState extends State<FontSizeSelectPage> { class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
Box setting = GStorage.setting; Box setting = GStorage.setting;
List<double> list = List.generate(12, (index) => 0.85 + index * 0.05); List<double> list = List.generate(16, (index) => 0.85 + index * 0.05);
//[0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3, 1.35]; //[0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3, 1.35];
late double minSize; late double minSize;
late double maxSize; late double maxSize;
@@ -29,8 +29,8 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
setFontSize() { setFontSize() {
setting.put(SettingBoxKey.defaultTextScale, currentSize); setting.put(SettingBoxKey.defaultTextScale, currentSize);
Get.forceAppUpdate();
Get.back(result: currentSize); Get.back(result: currentSize);
Get.forceAppUpdate();
} }
@override @override
@@ -38,7 +38,13 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
actions: [ actions: [
TextButton(onPressed: () => setFontSize(), child: const Text('确定')), TextButton(
onPressed: () {
currentSize = 1.0;
setFontSize();
},
child: const Text('重置')),
TextButton(onPressed: setFontSize, child: const Text('确定')),
const SizedBox(width: 12) const SizedBox(width: 12)
], ],
), ),

View File

@@ -11,6 +11,7 @@ import 'package:dio/dio.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:uuid/uuid.dart'; import 'package:uuid/uuid.dart';
class SponsorBlockPage extends StatefulWidget { class SponsorBlockPage extends StatefulWidget {
@@ -51,9 +52,9 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
super.dispose(); super.dispose();
} }
TextStyle get _titleStyle => TextStyle(fontSize: 14); TextStyle get _titleStyle => TextStyle(fontSize: 15);
TextStyle get _subTitleStyle => TextStyle( TextStyle get _subTitleStyle => TextStyle(
fontSize: 12, fontSize: 13,
color: Theme.of(context).colorScheme.outline, color: Theme.of(context).colorScheme.outline,
); );
@@ -497,27 +498,32 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
child: Text(item.title), child: Text(item.title),
)) ))
.toList(), .toList(),
child: Row( child: Padding(
mainAxisSize: MainAxisSize.min, padding: const EdgeInsets.symmetric(vertical: 8),
crossAxisAlignment: CrossAxisAlignment.start, child: Row(
children: [ mainAxisSize: MainAxisSize.min,
Text( children: [
_blockSettings[index].second.title, Text(
style: TextStyle( _blockSettings[index].second.title,
fontSize: 13, style: TextStyle(
height: 1,
fontSize: 14,
color:
_blockSettings[index].second == SkipType.disable
? Theme.of(context).colorScheme.error
: Theme.of(context).colorScheme.primary,
),
strutStyle: StrutStyle(height: 1, leading: 0),
),
Icon(
MdiIcons.unfoldMoreHorizontal,
size: MediaQuery.textScalerOf(context).scale(14),
color: _blockSettings[index].second == SkipType.disable color: _blockSettings[index].second == SkipType.disable
? Theme.of(context).colorScheme.error ? Theme.of(context).colorScheme.error
: Theme.of(context).colorScheme.primary, : Theme.of(context).colorScheme.primary,
), ),
), ],
Icon( ),
size: 20,
Icons.keyboard_arrow_right,
color: _blockSettings[index].second == SkipType.disable
? Theme.of(context).colorScheme.error
: Theme.of(context).colorScheme.primary,
)
],
), ),
), ),
), ),

View File

@@ -25,6 +25,7 @@ import 'package:PiliPalaX/plugin/pl_player/index.dart';
import 'package:PiliPalaX/utils/storage.dart'; import 'package:PiliPalaX/utils/storage.dart';
import 'package:PiliPalaX/utils/utils.dart'; import 'package:PiliPalaX/utils/utils.dart';
import 'package:PiliPalaX/utils/video_utils.dart'; import 'package:PiliPalaX/utils/video_utils.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:ns_danmaku/models/danmaku_item.dart'; import 'package:ns_danmaku/models/danmaku_item.dart';
import '../../../utils/id_utils.dart'; import '../../../utils/id_utils.dart';
@@ -1307,24 +1308,30 @@ class VideoDetailController extends GetxController
child: Row( child: Row(
mainAxisSize: mainAxisSize:
MainAxisSize.min, MainAxisSize.min,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
list![index] list![index]
.category .category
.title, .title,
style: TextStyle( style: TextStyle(
height: 1,
fontSize: 14, fontSize: 14,
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.primary, .primary,
), ),
strutStyle: StrutStyle(
height: 1,
leading: 0,
),
), ),
Icon( Icon(
Icons MdiIcons
.keyboard_arrow_right, .unfoldMoreHorizontal,
size: 22, size: MediaQuery
.textScalerOf(
context)
.scale(14),
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.primary, .primary,
@@ -1368,24 +1375,30 @@ class VideoDetailController extends GetxController
child: Row( child: Row(
mainAxisSize: mainAxisSize:
MainAxisSize.min, MainAxisSize.min,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Text( Text(
list![index] list![index]
.actionType .actionType
.title, .title,
style: TextStyle( style: TextStyle(
height: 1,
fontSize: 14, fontSize: 14,
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.primary, .primary,
), ),
strutStyle: StrutStyle(
height: 1,
leading: 0,
),
), ),
Icon( Icon(
Icons MdiIcons
.keyboard_arrow_right, .unfoldMoreHorizontal,
size: 22, size: MediaQuery
.textScalerOf(
context)
.scale(14),
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.primary, .primary,
@@ -1394,7 +1407,7 @@ class VideoDetailController extends GetxController
), ),
), ),
], ],
) ),
], ],
), ),
), ),