Merge pull request #2450 from 21pages/tab

fix menu padding mistake
This commit is contained in:
RustDesk 2022-12-05 09:49:33 +08:00 committed by GitHub
commit a472439db7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,10 @@ class _TabEntry {
_TabEntry(this.name, this.widget, this.load); _TabEntry(this.name, this.widget, this.load);
} }
EdgeInsets? _menuPadding() {
return isDesktop ? kDesktopMenuPadding : null;
}
class _PeerTabPageState extends State<PeerTabPage> class _PeerTabPageState extends State<PeerTabPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
late final RxInt tabHiddenFlag; late final RxInt tabHiddenFlag;
@ -38,25 +42,25 @@ class _PeerTabPageState extends State<PeerTabPage>
_TabEntry( _TabEntry(
'Recent Sessions', 'Recent Sessions',
RecentPeersView( RecentPeersView(
menuPadding: kDesktopMenuPadding, menuPadding: _menuPadding(),
), ),
bind.mainLoadRecentPeers), bind.mainLoadRecentPeers),
_TabEntry( _TabEntry(
'Favorites', 'Favorites',
FavoritePeersView( FavoritePeersView(
menuPadding: kDesktopMenuPadding, menuPadding: _menuPadding(),
), ),
bind.mainLoadFavPeers), bind.mainLoadFavPeers),
_TabEntry( _TabEntry(
'Discovered', 'Discovered',
DiscoveredPeersView( DiscoveredPeersView(
menuPadding: kDesktopMenuPadding, menuPadding: _menuPadding(),
), ),
bind.mainDiscover), bind.mainDiscover),
_TabEntry( _TabEntry(
'Address Book', 'Address Book',
const AddressBook( AddressBook(
menuPadding: kDesktopMenuPadding, menuPadding: _menuPadding(),
), ),
() => {}), () => {}),
]; ];