fix set fixed width, and naming.

This commit is contained in:
ericz 2026-03-28 16:48:36 +01:00
parent 109e69685f
commit bb6afad326
6 changed files with 12 additions and 12 deletions

View file

@ -672,7 +672,7 @@ class _ContactsScreenState extends State<ContactsScreen>
: "",
);
break;
case ContactTypeFilter.chat:
case ContactTypeFilter.activeChat:
hintText = context.l10n.contacts_searchContacts(
filteredAndSorted.length,
viewState.contactsShowUnreadOnly
@ -694,10 +694,7 @@ class _ContactsScreenState extends State<ContactsScreen>
97.0,
double.infinity,
); // allow expansion up to 72% of screen width, but not less than the collapsed width
final searchCollapsedWidth = (screenWidth * 0.22).clamp(
97.0,
97.0,
); //two 48px icon buttons + 1px divider
final searchCollapsedWidth = 97.0; //two 48px icon buttons + 1px divider
return Column(
children: [
@ -928,7 +925,7 @@ class _ContactsScreenState extends State<ContactsScreen>
return contact.type == advTypeRepeater;
case ContactTypeFilter.rooms:
return contact.type == advTypeRoom;
case ContactTypeFilter.chat:
case ContactTypeFilter.activeChat:
return connector.getMessages(contact).isNotEmpty;
}
}

View file

@ -306,7 +306,7 @@ class _DiscoveryScreenState extends State<DiscoveryScreen> {
showUnreadOnly ? " ${context.l10n.contacts_unread}" : "",
);
break;
case ContactTypeFilter.chat:
case ContactTypeFilter.activeChat:
hintText = context.l10n.contacts_searchContacts(
filteredAndSorted.length,
showUnreadOnly ? " ${context.l10n.contacts_unread}" : "",
@ -430,7 +430,7 @@ class _DiscoveryScreenState extends State<DiscoveryScreen> {
return contact.type == advTypeRepeater;
case ContactTypeFilter.rooms:
return contact.type == advTypeRoom;
case ContactTypeFilter.chat:
case ContactTypeFilter.activeChat:
return false;
default:
return false;

View file

@ -57,8 +57,9 @@ class UiViewStateService extends ChangeNotifier {
final typeStr = prefs.getString(_keyContactsTypeFilter);
if (typeStr != null) {
final normalizedTypeStr = typeStr == 'chat' ? 'activeChat' : typeStr;
_contactsTypeFilter = ContactTypeFilter.values.firstWhere(
(e) => e.name == typeStr,
(e) => e.name == normalizedTypeStr,
orElse: () => ContactTypeFilter.all,
);
}

View file

@ -1,3 +1,3 @@
enum ContactSortOption { lastSeen, recentMessages, name }
enum ContactTypeFilter { all, favorites, users, repeaters, rooms, chat }
enum ContactTypeFilter { all, favorites, users, repeaters, rooms, activeChat }

View file

@ -158,9 +158,9 @@ class ContactsFilterMenu extends StatelessWidget {
checked: typeFilter == ContactTypeFilter.all,
),
SortFilterMenuOption(
value: _TypeFilterAction(ContactTypeFilter.chat),
value: _TypeFilterAction(ContactTypeFilter.activeChat),
label: l10n.listFilter_activeChat,
checked: typeFilter == ContactTypeFilter.chat,
checked: typeFilter == ContactTypeFilter.activeChat,
),
SortFilterMenuOption(
value: _TypeFilterAction(ContactTypeFilter.favorites),

View file

@ -9,6 +9,7 @@ import flutter_blue_plus_darwin
import flutter_local_notifications
import mobile_scanner
import package_info_plus
import path_provider_foundation
import share_plus
import shared_preferences_foundation
import sqflite_darwin
@ -19,6 +20,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))