refactor tab bar behaviour; respect scroll preferences of websites;
This commit is contained in:
@@ -64,6 +64,7 @@ class TabState extends WebPageInfo {
|
||||
final bool isPrivate;
|
||||
final bool isFullScreen;
|
||||
final bool isLoading;
|
||||
final bool showToolbarAsExpanded;
|
||||
|
||||
bool get isFinishedLoading => !isLoading && progress == 100;
|
||||
|
||||
@@ -84,6 +85,7 @@ class TabState extends WebPageInfo {
|
||||
required this.isPrivate,
|
||||
required this.isFullScreen,
|
||||
required this.isLoading,
|
||||
required this.showToolbarAsExpanded,
|
||||
required this.securityInfoState,
|
||||
required this.historyState,
|
||||
required this.readerableState,
|
||||
@@ -102,6 +104,7 @@ class TabState extends WebPageInfo {
|
||||
isPrivate: false,
|
||||
isFullScreen: false,
|
||||
isLoading: false,
|
||||
showToolbarAsExpanded: false,
|
||||
securityInfoState: SecurityState.$default(),
|
||||
historyState: HistoryState.$default(),
|
||||
readerableState: ReaderableState.$default(),
|
||||
@@ -120,6 +123,7 @@ class TabState extends WebPageInfo {
|
||||
isPrivate,
|
||||
isFullScreen,
|
||||
isLoading,
|
||||
showToolbarAsExpanded,
|
||||
securityInfoState,
|
||||
historyState,
|
||||
readerableState,
|
||||
|
||||
@@ -27,6 +27,8 @@ abstract class _$TabStateCWProxy {
|
||||
|
||||
TabState isLoading(bool isLoading);
|
||||
|
||||
TabState showToolbarAsExpanded(bool showToolbarAsExpanded);
|
||||
|
||||
TabState securityInfoState(SecurityState securityInfoState);
|
||||
|
||||
TabState historyState(HistoryState historyState);
|
||||
@@ -53,6 +55,7 @@ abstract class _$TabStateCWProxy {
|
||||
bool isPrivate,
|
||||
bool isFullScreen,
|
||||
bool isLoading,
|
||||
bool showToolbarAsExpanded,
|
||||
SecurityState securityInfoState,
|
||||
HistoryState historyState,
|
||||
ReaderableState readerableState,
|
||||
@@ -97,6 +100,10 @@ class _$TabStateCWProxyImpl implements _$TabStateCWProxy {
|
||||
@override
|
||||
TabState isLoading(bool isLoading) => call(isLoading: isLoading);
|
||||
|
||||
@override
|
||||
TabState showToolbarAsExpanded(bool showToolbarAsExpanded) =>
|
||||
call(showToolbarAsExpanded: showToolbarAsExpanded);
|
||||
|
||||
@override
|
||||
TabState securityInfoState(SecurityState securityInfoState) =>
|
||||
call(securityInfoState: securityInfoState);
|
||||
@@ -132,6 +139,7 @@ class _$TabStateCWProxyImpl implements _$TabStateCWProxy {
|
||||
Object? isPrivate = const $CopyWithPlaceholder(),
|
||||
Object? isFullScreen = const $CopyWithPlaceholder(),
|
||||
Object? isLoading = const $CopyWithPlaceholder(),
|
||||
Object? showToolbarAsExpanded = const $CopyWithPlaceholder(),
|
||||
Object? securityInfoState = const $CopyWithPlaceholder(),
|
||||
Object? historyState = const $CopyWithPlaceholder(),
|
||||
Object? readerableState = const $CopyWithPlaceholder(),
|
||||
@@ -180,6 +188,12 @@ class _$TabStateCWProxyImpl implements _$TabStateCWProxy {
|
||||
? _value.isLoading
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isLoading as bool,
|
||||
showToolbarAsExpanded:
|
||||
showToolbarAsExpanded == const $CopyWithPlaceholder() ||
|
||||
showToolbarAsExpanded == null
|
||||
? _value.showToolbarAsExpanded
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: showToolbarAsExpanded as bool,
|
||||
securityInfoState:
|
||||
securityInfoState == const $CopyWithPlaceholder() ||
|
||||
securityInfoState == null
|
||||
|
||||
@@ -87,6 +87,7 @@ class TabStates extends _$TabStates {
|
||||
isPrivate: contentState.isPrivate,
|
||||
isFullScreen: contentState.isFullScreen,
|
||||
isLoading: contentState.isLoading,
|
||||
showToolbarAsExpanded: contentState.showToolbarAsExpanded,
|
||||
);
|
||||
|
||||
_updateState({...state}..[contentState.id] = newState);
|
||||
|
||||
@@ -41,7 +41,7 @@ final class TabStatesProvider
|
||||
}
|
||||
}
|
||||
|
||||
String _$tabStatesHash() => r'985d2eb87c59c3a113b8bbcf9d96267c42a2f543';
|
||||
String _$tabStatesHash() => r'975de1242f42e2017754dc560125788b83ad8b72';
|
||||
|
||||
abstract class _$TabStates extends $Notifier<Map<String, TabState>> {
|
||||
Map<String, TabState> build();
|
||||
|
||||
Reference in New Issue
Block a user