Skip to content

Commit

Permalink
Introduce effectiveColumnCount for tablet mode
Browse files Browse the repository at this point in the history
  • Loading branch information
violet-dev committed Feb 9, 2024
1 parent f533280 commit 3100155
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/pages/download/download_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,10 @@ class _DownloadPageState extends ThemeSwitchableState<DownloadPage>
}

Widget _panelGroupBy(List<(String, List<DownloadItemModel>)> groupBy) {
var windowWidth = lastWindowWidth = MediaQuery.of(context).size.width;
var mm = Settings.downloadResultType == 0 ? 3 : 2;
final windowWidth = lastWindowWidth = MediaQuery.of(context).size.width;
final columnCount = Settings.downloadResultType == 0 ? 3 : 2;
final effectiveColumnCount =
Settings.useTabletMode ? columnCount * 2 : columnCount;

heightRefHeader = null;
heightRefArticle = null;
Expand Down Expand Up @@ -653,7 +655,7 @@ class _DownloadPageState extends ThemeSwitchableState<DownloadPage>
padding: const EdgeInsets.fromLTRB(8, 4, 8, 16),
shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: Settings.useTabletMode ? mm * 2 : mm,
crossAxisCount: effectiveColumnCount,
crossAxisSpacing: 8,
mainAxisSpacing: 8,
childAspectRatio: 3 / 4,
Expand All @@ -672,7 +674,7 @@ class _DownloadPageState extends ThemeSwitchableState<DownloadPage>
initialStyle: DownloadListItem(
showDetail: false,
addBottomPadding: false,
width: (windowWidth - 4.0) / mm,
width: (windowWidth - 4.0) / effectiveColumnCount,
),
item: e,
download: e.download,
Expand Down

0 comments on commit 3100155

Please sign in to comment.