forked from Nexus/nexus
parent
7353955d4e
commit
a5fef138dd
4 changed files with 48 additions and 13 deletions
|
|
@ -18,6 +18,7 @@ import "package:nexus/controllers/unified_push_allowed.dart";
|
|||
import "package:nexus/controllers/unified_push_distributors.dart";
|
||||
import "package:nexus/helpers/extensions/distributor_name.dart";
|
||||
import "package:nexus/models/account_data.dart";
|
||||
import "package:nexus/models/room_order.dart";
|
||||
import "package:nexus/models/settings_category.dart";
|
||||
import "package:nexus/main.dart";
|
||||
import "package:nexus/widgets/settings/dialog_list_tile.dart";
|
||||
|
|
@ -94,6 +95,26 @@ class SettingsSectionsController
|
|||
.onError(showError),
|
||||
),
|
||||
),
|
||||
.new(
|
||||
title: "Room Ordering",
|
||||
description: "Sort rooms by recent activity, optionally showing mentioned and unread rooms first.",
|
||||
icon: Icons.sort,
|
||||
builder: (title, description, icon) => DialogListTile<RoomOrder>(
|
||||
icon: Icon(icon),
|
||||
title: title,
|
||||
subtitle: Text(description),
|
||||
initialValue: settings.roomOrder,
|
||||
options: RoomOrder.values,
|
||||
getName: (option) => switch (option) {
|
||||
.unreadFirst => "Mentioned, then unread",
|
||||
.recentActivity => "Recent activity only",
|
||||
},
|
||||
onChanged: (value) => ref
|
||||
.read(SettingsController.provider.notifier)
|
||||
.set(settings.copyWith(roomOrder: value))
|
||||
.onError(showError),
|
||||
),
|
||||
),
|
||||
if (!Platform.isAndroid && !Platform.isIOS)
|
||||
.new(
|
||||
title: "Show Minimize Button",
|
||||
|
|
|
|||
Loading…
Reference in a new issue