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> {
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];
late double minSize;
late double maxSize;
@@ -29,8 +29,8 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
setFontSize() {
setting.put(SettingBoxKey.defaultTextScale, currentSize);
Get.forceAppUpdate();
Get.back(result: currentSize);
Get.forceAppUpdate();
}
@override
@@ -38,7 +38,13 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
return Scaffold(
appBar: AppBar(
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)
],
),

View File

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