♻️ (Gui) Modify menu and icons
This commit is contained in:
parent
0ff443762b
commit
ccae23ed75
|
@ -6,6 +6,8 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:pikapika/basic/Common.dart';
|
import 'package:pikapika/basic/Common.dart';
|
||||||
|
import 'package:pikapika/basic/config/ImageAddress.dart';
|
||||||
|
import 'package:pikapika/basic/config/UseApiLoadImage.dart';
|
||||||
|
|
||||||
import '../Method.dart';
|
import '../Method.dart';
|
||||||
|
|
||||||
|
@ -126,12 +128,45 @@ Future chooseAddressAndSwitch(BuildContext context) async {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget addressActionButton(BuildContext context) {
|
Widget addressPopMenu(BuildContext context) {
|
||||||
return IconButton(
|
return PopupMenuButton<int>(
|
||||||
onPressed: () {
|
icon: const Icon(Icons.webhook),
|
||||||
|
itemBuilder: (BuildContext context) => <PopupMenuItem<int>>[
|
||||||
|
PopupMenuItem<int>(
|
||||||
|
value: 0,
|
||||||
|
child: ListTile(
|
||||||
|
leading: const Icon(Icons.share),
|
||||||
|
title: Text("分流 (${currentAddressName()})"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
PopupMenuItem<int>(
|
||||||
|
value: 1,
|
||||||
|
child: ListTile(
|
||||||
|
leading: const Icon(Icons.image_search),
|
||||||
|
title: Text("图片分流 (${currentImageAddressName()})"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
PopupMenuItem<int>(
|
||||||
|
value: 2,
|
||||||
|
child: ListTile(
|
||||||
|
leading: const Icon(Icons.network_ping),
|
||||||
|
title: Text("用API加载图片 (${currentUseApiLoadImageName()})"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
onSelected: (int value) {
|
||||||
|
switch (value) {
|
||||||
|
case 0:
|
||||||
chooseAddressAndSwitch(context);
|
chooseAddressAndSwitch(context);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
chooseImageAddress(context);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
chooseUseApiLoadImage(context);
|
||||||
|
break;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.network_ping),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,8 @@ class _CategoriesScreenState extends State<CategoriesScreen> {
|
||||||
return AppBar(
|
return AppBar(
|
||||||
title: const Text('分类'),
|
title: const Text('分类'),
|
||||||
actions: [
|
actions: [
|
||||||
aPopMenu(context),
|
commonPopMenu(context),
|
||||||
addressActionButton(context),
|
addressPopMenu(context),
|
||||||
_searchBar.getSearchAction(context),
|
_searchBar.getSearchAction(context),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -55,8 +55,8 @@ class _ComicsScreenState extends State<ComicsScreen> {
|
||||||
return AppBar(
|
return AppBar(
|
||||||
title: Text(categoryTitle(widget.category)),
|
title: Text(categoryTitle(widget.category)),
|
||||||
actions: [
|
actions: [
|
||||||
aPopMenu(context),
|
commonPopMenu(context),
|
||||||
addressActionButton(context),
|
addressPopMenu(context),
|
||||||
_chooseCategoryAction(),
|
_chooseCategoryAction(),
|
||||||
_categorySearchBar.getSearchAction(context),
|
_categorySearchBar.getSearchAction(context),
|
||||||
],
|
],
|
||||||
|
@ -147,8 +147,8 @@ class _ComicsScreenState extends State<ComicsScreen> {
|
||||||
appBar = AppBar(
|
appBar = AppBar(
|
||||||
title: Text(title),
|
title: Text(title),
|
||||||
actions: [
|
actions: [
|
||||||
aPopMenu(context),
|
commonPopMenu(context),
|
||||||
addressActionButton(context),
|
addressPopMenu(context),
|
||||||
_chooseCategoryAction(),
|
_chooseCategoryAction(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
@ -33,8 +33,8 @@ class _RandomComicsScreenState extends State<RandomComicsScreen> {
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('随机本子'),
|
title: const Text('随机本子'),
|
||||||
actions: [
|
actions: [
|
||||||
aPopMenu(context),
|
commonPopMenu(context),
|
||||||
addressActionButton(context),
|
addressPopMenu(context),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: ComicListBuilder(method.randomComics),
|
body: ComicListBuilder(method.randomComics),
|
||||||
|
|
|
@ -34,8 +34,8 @@ class RankingsScreen extends StatelessWidget {
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('排行榜'),
|
title: const Text('排行榜'),
|
||||||
actions: [
|
actions: [
|
||||||
aPopMenu(context),
|
commonPopMenu(context),
|
||||||
addressActionButton(context),
|
addressPopMenu(context),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: DefaultTabController(
|
body: DefaultTabController(
|
||||||
|
|
|
@ -51,8 +51,8 @@ class _SearchScreenState extends State<SearchScreen> {
|
||||||
return AppBar(
|
return AppBar(
|
||||||
title: Text("${categoryTitle(widget.category)} ${widget.keyword}"),
|
title: Text("${categoryTitle(widget.category)} ${widget.keyword}"),
|
||||||
actions: [
|
actions: [
|
||||||
aPopMenu(context),
|
commonPopMenu(context),
|
||||||
addressActionButton(context),
|
addressPopMenu(context),
|
||||||
_chooseCategoryAction(),
|
_chooseCategoryAction(),
|
||||||
_searchBar.getSearchAction(context),
|
_searchBar.getSearchAction(context),
|
||||||
],
|
],
|
||||||
|
|
|
@ -4,7 +4,7 @@ import '../../basic/config/ListLayout.dart';
|
||||||
import '../../basic/config/ShadowCategories.dart';
|
import '../../basic/config/ShadowCategories.dart';
|
||||||
import '../../basic/config/ShadowCategoriesMode.dart';
|
import '../../basic/config/ShadowCategoriesMode.dart';
|
||||||
|
|
||||||
Widget aPopMenu(BuildContext context) {
|
Widget commonPopMenu(BuildContext context) {
|
||||||
return PopupMenuButton<int>(
|
return PopupMenuButton<int>(
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuItem<int>>[
|
itemBuilder: (BuildContext context) => <PopupMenuItem<int>>[
|
||||||
const PopupMenuItem<int>(
|
const PopupMenuItem<int>(
|
||||||
|
|
|
@ -24,6 +24,7 @@ import 'package:pikapika/basic/config/VolumeController.dart';
|
||||||
import 'package:pikapika/screens/components/PkzImages.dart';
|
import 'package:pikapika/screens/components/PkzImages.dart';
|
||||||
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
||||||
import '../../basic/config/IconLoading.dart';
|
import '../../basic/config/IconLoading.dart';
|
||||||
|
import '../../basic/config/UseApiLoadImage.dart';
|
||||||
import '../FilePhotoViewScreen.dart';
|
import '../FilePhotoViewScreen.dart';
|
||||||
import 'gesture_zoom_box.dart';
|
import 'gesture_zoom_box.dart';
|
||||||
|
|
||||||
|
@ -903,7 +904,7 @@ class _SettingPanelState extends State<_SettingPanel> {
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
_bottomIcon(
|
_bottomIcon(
|
||||||
icon: Icons.shuffle,
|
icon: Icons.share,
|
||||||
title: currentAddressName(),
|
title: currentAddressName(),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await chooseAddressAndSwitch(context);
|
await chooseAddressAndSwitch(context);
|
||||||
|
@ -911,13 +912,20 @@ class _SettingPanelState extends State<_SettingPanel> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
_bottomIcon(
|
_bottomIcon(
|
||||||
icon: Icons.repeat_one,
|
icon: Icons.image_search,
|
||||||
title: currentImageAddressName(),
|
title: currentImageAddressName(),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await chooseImageAddress(context);
|
await chooseImageAddress(context);
|
||||||
setState(() {});
|
setState(() {});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
_bottomIcon(
|
||||||
|
icon: Icons.network_ping,
|
||||||
|
title: currentUseApiLoadImageName(),
|
||||||
|
onPressed: () {
|
||||||
|
chooseUseApiLoadImage(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
_bottomIcon(
|
_bottomIcon(
|
||||||
icon: Icons.refresh,
|
icon: Icons.refresh,
|
||||||
title: "重载页面",
|
title: "重载页面",
|
||||||
|
@ -926,11 +934,11 @@ class _SettingPanelState extends State<_SettingPanel> {
|
||||||
widget.onReloadEp();
|
widget.onReloadEp();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
_bottomIcon(
|
// _bottomIcon(
|
||||||
icon: Icons.file_download,
|
// icon: Icons.file_download,
|
||||||
title: "下载本作",
|
// title: "下载本作",
|
||||||
onPressed: widget.onDownload,
|
// onPressed: widget.onDownload,
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue