make drawer gesture controllable via settings

This commit is contained in:
Fabian Freund
2026-02-14 20:02:48 +01:00
parent c336b4fafe
commit 826015c42f
6 changed files with 61 additions and 3 deletions
@@ -88,6 +88,7 @@ class GeneralSettings with FastEquatable {
final bool allowClipboardAccess;
final bool tabListShowFavicons;
final bool quickTabSwitcherShowTitles;
final bool drawerGestureEnabled;
GeneralSettings({
required this.themeMode,
@@ -118,6 +119,7 @@ class GeneralSettings with FastEquatable {
required this.allowClipboardAccess,
required this.tabListShowFavicons,
required this.quickTabSwitcherShowTitles,
required this.drawerGestureEnabled,
});
GeneralSettings.withDefaults({
@@ -149,6 +151,7 @@ class GeneralSettings with FastEquatable {
bool? allowClipboardAccess,
bool? tabListShowFavicons,
bool? quickTabSwitcherShowTitles,
bool? drawerGestureEnabled,
}) : themeMode = themeMode ?? ThemeMode.dark,
enableReadability = enableReadability ?? true,
enforceReadability = enforceReadability ?? false,
@@ -180,7 +183,8 @@ class GeneralSettings with FastEquatable {
maxSearchHistoryEntries = maxSearchHistoryEntries ?? 5,
allowClipboardAccess = allowClipboardAccess ?? true,
tabListShowFavicons = tabListShowFavicons ?? false,
quickTabSwitcherShowTitles = quickTabSwitcherShowTitles ?? true;
quickTabSwitcherShowTitles = quickTabSwitcherShowTitles ?? true,
drawerGestureEnabled = drawerGestureEnabled ?? false;
factory GeneralSettings.fromJson(Map<String, dynamic> json) =>
_$GeneralSettingsFromJson(json);
@@ -217,5 +221,6 @@ class GeneralSettings with FastEquatable {
allowClipboardAccess,
tabListShowFavicons,
quickTabSwitcherShowTitles,
drawerGestureEnabled,
];
}
@@ -75,6 +75,8 @@ abstract class _$GeneralSettingsCWProxy {
GeneralSettings quickTabSwitcherShowTitles(bool quickTabSwitcherShowTitles);
GeneralSettings drawerGestureEnabled(bool drawerGestureEnabled);
/// Creates a new instance with the provided field values.
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `GeneralSettings(...).copyWith.fieldName(value)`.
///
@@ -111,6 +113,7 @@ abstract class _$GeneralSettingsCWProxy {
bool allowClipboardAccess,
bool tabListShowFavicons,
bool quickTabSwitcherShowTitles,
bool drawerGestureEnabled,
});
}
@@ -238,6 +241,10 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
GeneralSettings quickTabSwitcherShowTitles(bool quickTabSwitcherShowTitles) =>
call(quickTabSwitcherShowTitles: quickTabSwitcherShowTitles);
@override
GeneralSettings drawerGestureEnabled(bool drawerGestureEnabled) =>
call(drawerGestureEnabled: drawerGestureEnabled);
@override
/// Creates a new instance with the provided field values.
/// Passing `null` to a nullable field nullifies it, while `null` for a non-nullable field is ignored. To update a single field use `GeneralSettings(...).copyWith.fieldName(value)`.
@@ -275,6 +282,7 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
Object? allowClipboardAccess = const $CopyWithPlaceholder(),
Object? tabListShowFavicons = const $CopyWithPlaceholder(),
Object? quickTabSwitcherShowTitles = const $CopyWithPlaceholder(),
Object? drawerGestureEnabled = const $CopyWithPlaceholder(),
}) {
return GeneralSettings(
themeMode: themeMode == const $CopyWithPlaceholder() || themeMode == null
@@ -441,6 +449,12 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
? _value.quickTabSwitcherShowTitles
// ignore: cast_nullable_to_non_nullable
: quickTabSwitcherShowTitles as bool,
drawerGestureEnabled:
drawerGestureEnabled == const $CopyWithPlaceholder() ||
drawerGestureEnabled == null
? _value.drawerGestureEnabled
// ignore: cast_nullable_to_non_nullable
: drawerGestureEnabled as bool,
);
}
}
@@ -519,6 +533,7 @@ GeneralSettings _$GeneralSettingsFromJson(
allowClipboardAccess: json['allowClipboardAccess'] as bool?,
tabListShowFavicons: json['tabListShowFavicons'] as bool?,
quickTabSwitcherShowTitles: json['quickTabSwitcherShowTitles'] as bool?,
drawerGestureEnabled: json['drawerGestureEnabled'] as bool?,
);
Map<String, dynamic> _$GeneralSettingsToJson(
@@ -561,6 +576,7 @@ Map<String, dynamic> _$GeneralSettingsToJson(
'allowClipboardAccess': instance.allowClipboardAccess,
'tabListShowFavicons': instance.tabListShowFavicons,
'quickTabSwitcherShowTitles': instance.quickTabSwitcherShowTitles,
'drawerGestureEnabled': instance.drawerGestureEnabled,
};
const _$ThemeModeEnumMap = {