mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-06-15 10:24:22 +08:00
Gallery sort now always available in popup menu
Fix some pages change settings via popup seems not works Fix home pages themeMode not follow latest settings
This commit is contained in:
@@ -105,10 +105,7 @@ class _GalleriesPage extends State<GalleriesPage>
|
||||
queryParameters: queryParameters);
|
||||
}
|
||||
},
|
||||
label: Text(i18n.sortByGid,
|
||||
style: MediaQuery.of(context).size.width > 810
|
||||
? Theme.of(context).textTheme.labelMedium
|
||||
: Theme.of(context).textTheme.labelLarge),
|
||||
label: Text(i18n.sortByGid),
|
||||
dropdownMenuEntries: [
|
||||
DropdownMenuEntry(value: SortByGid.none, label: i18n.none),
|
||||
DropdownMenuEntry(value: SortByGid.asc, label: i18n.asc),
|
||||
@@ -137,14 +134,10 @@ class _GalleriesPage extends State<GalleriesPage>
|
||||
),
|
||||
title: Text(title),
|
||||
actions: [
|
||||
MediaQuery.of(context).size.width > 810
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(top: 4.0),
|
||||
child: sortByGidMenu)
|
||||
: PopupMenuButton(
|
||||
icon: const Icon(Icons.sort),
|
||||
itemBuilder: (context) =>
|
||||
[PopupMenuItem(child: sortByGidMenu)]),
|
||||
PopupMenuButton(
|
||||
icon: const Icon(Icons.sort),
|
||||
itemBuilder: (context) =>
|
||||
[PopupMenuItem(child: sortByGidMenu)]),
|
||||
buildThemeModeIcon(context),
|
||||
buildMoreVertSettingsButon(context),
|
||||
]),
|
||||
|
||||
@@ -183,7 +183,11 @@ List<PopupMenuEntry<MoreVertSettings>> buildMoreVertSettings(
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
prefs.setBool("showNsfw", value);
|
||||
listener.emit("showNsfwChanged", null);
|
||||
try {
|
||||
listener.emit("showNsfwChanged", null);
|
||||
} catch (e) {
|
||||
// Do nothing.
|
||||
}
|
||||
setState(() {
|
||||
showNsfw = value;
|
||||
});
|
||||
@@ -201,7 +205,11 @@ List<PopupMenuEntry<MoreVertSettings>> buildMoreVertSettings(
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
prefs.setBool("displayAd", value);
|
||||
listener.emit("displayAdChanged", null);
|
||||
try {
|
||||
listener.emit("displayAdChanged", null);
|
||||
} catch (e) {
|
||||
// Do nothing.
|
||||
}
|
||||
setState(() {
|
||||
displayAd = value;
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ class HomePage extends HookWidget {
|
||||
Widget build(BuildContext context) {
|
||||
tryInitApi(context);
|
||||
var mode = useState(MainApp.of(context).themeMode);
|
||||
mode.value = MainApp.of(context).themeMode;
|
||||
setCurrentTitle("", Theme.of(context).primaryColor.value, usePrefix: true);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
|
||||
Reference in New Issue
Block a user