improve tab bar auto hide; add autohide setting
This commit is contained in:
@@ -57,8 +57,8 @@ class GeneralSettings with FastEquatable {
|
||||
final bool enableLocalAiFeatures;
|
||||
final TabType defaultCreateTabType;
|
||||
final TabType defaultIntentTabType;
|
||||
|
||||
final bool proxyPrivateTabsTor;
|
||||
final bool autoHideTabBar;
|
||||
|
||||
GeneralSettings({
|
||||
required this.themeMode,
|
||||
@@ -73,6 +73,7 @@ class GeneralSettings with FastEquatable {
|
||||
required this.enableLocalAiFeatures,
|
||||
required this.defaultCreateTabType,
|
||||
required this.defaultIntentTabType,
|
||||
required this.autoHideTabBar,
|
||||
});
|
||||
|
||||
GeneralSettings.withDefaults({
|
||||
@@ -88,6 +89,7 @@ class GeneralSettings with FastEquatable {
|
||||
bool? enableLocalAiFeatures,
|
||||
TabType? defaultCreateTabType,
|
||||
TabType? defaultIntentTabType,
|
||||
bool? autoHideTabBar,
|
||||
}) : themeMode = themeMode ?? ThemeMode.dark,
|
||||
enableReadability = enableReadability ?? true,
|
||||
enforceReadability = enforceReadability ?? false,
|
||||
@@ -99,7 +101,8 @@ class GeneralSettings with FastEquatable {
|
||||
showExtensionShortcut = showExtensionShortcut ?? false,
|
||||
enableLocalAiFeatures = enableLocalAiFeatures ?? true,
|
||||
defaultCreateTabType = defaultCreateTabType ?? TabType.regular,
|
||||
defaultIntentTabType = defaultIntentTabType ?? TabType.regular;
|
||||
defaultIntentTabType = defaultIntentTabType ?? TabType.regular,
|
||||
autoHideTabBar = autoHideTabBar ?? true;
|
||||
|
||||
factory GeneralSettings.fromJson(Map<String, dynamic> json) =>
|
||||
_$GeneralSettingsFromJson(json);
|
||||
@@ -120,5 +123,6 @@ class GeneralSettings with FastEquatable {
|
||||
defaultCreateTabType,
|
||||
defaultIntentTabType,
|
||||
proxyPrivateTabsTor,
|
||||
autoHideTabBar,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ abstract class _$GeneralSettingsCWProxy {
|
||||
|
||||
GeneralSettings defaultIntentTabType(TabType defaultIntentTabType);
|
||||
|
||||
GeneralSettings autoHideTabBar(bool autoHideTabBar);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GeneralSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
@@ -54,6 +56,7 @@ abstract class _$GeneralSettingsCWProxy {
|
||||
bool enableLocalAiFeatures,
|
||||
TabType defaultCreateTabType,
|
||||
TabType defaultIntentTabType,
|
||||
bool autoHideTabBar,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -112,6 +115,10 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
|
||||
GeneralSettings defaultIntentTabType(TabType defaultIntentTabType) =>
|
||||
this(defaultIntentTabType: defaultIntentTabType);
|
||||
|
||||
@override
|
||||
GeneralSettings autoHideTabBar(bool autoHideTabBar) =>
|
||||
this(autoHideTabBar: autoHideTabBar);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GeneralSettings(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
@@ -132,6 +139,7 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
|
||||
Object? enableLocalAiFeatures = const $CopyWithPlaceholder(),
|
||||
Object? defaultCreateTabType = const $CopyWithPlaceholder(),
|
||||
Object? defaultIntentTabType = const $CopyWithPlaceholder(),
|
||||
Object? autoHideTabBar = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return GeneralSettings(
|
||||
themeMode: themeMode == const $CopyWithPlaceholder()
|
||||
@@ -188,6 +196,10 @@ class _$GeneralSettingsCWProxyImpl implements _$GeneralSettingsCWProxy {
|
||||
? _value.defaultIntentTabType
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: defaultIntentTabType as TabType,
|
||||
autoHideTabBar: autoHideTabBar == const $CopyWithPlaceholder()
|
||||
? _value.autoHideTabBar
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: autoHideTabBar as bool,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -228,6 +240,7 @@ GeneralSettings _$GeneralSettingsFromJson(Map<String, dynamic> json) =>
|
||||
_$TabTypeEnumMap,
|
||||
json['defaultIntentTabType'],
|
||||
),
|
||||
autoHideTabBar: json['autoHideTabBar'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GeneralSettingsToJson(GeneralSettings instance) =>
|
||||
@@ -248,6 +261,7 @@ Map<String, dynamic> _$GeneralSettingsToJson(GeneralSettings instance) =>
|
||||
'defaultCreateTabType': _$TabTypeEnumMap[instance.defaultCreateTabType]!,
|
||||
'defaultIntentTabType': _$TabTypeEnumMap[instance.defaultIntentTabType]!,
|
||||
'proxyPrivateTabsTor': instance.proxyPrivateTabsTor,
|
||||
'autoHideTabBar': instance.autoHideTabBar,
|
||||
};
|
||||
|
||||
const _$ThemeModeEnumMap = {
|
||||
|
||||
Reference in New Issue
Block a user