settings: Do not show navigation toolbar setting if window aspect ratio is less than 1.7

This commit is contained in:
Calcitem 2021-07-18 01:44:50 +08:00
parent c629ec8f1b
commit 699bd264a2
No known key found for this signature in database
GPG Key ID: F2F7C29E054CFB80
3 changed files with 8 additions and 4 deletions

View File

@ -67,7 +67,9 @@ class Constants {
static String githubThanksURL = "$githubRepoWiKiURL/thanks";
static String giteeThanksURL = "$giteeRepoWiKiURL/thanks";
static final windowWidth = window.physicalSize.width;
static final windowHeight = window.physicalSize.height;
static final windowAspectRatio = windowHeight / windowWidth;
}
bool isSmallScreen() {

View File

@ -92,7 +92,7 @@ Future<void> main() async {
);
print(window.physicalSize);
print(Constants.windowHeight);
print(Constants.windowAspectRatio);
SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown],

View File

@ -388,13 +388,15 @@ class _PersonalizationSettingsPageState
titleString: S.of(context).isNotationsShown,
),
ListItemDivider(),
SettingsSwitchListTile(
Constants.windowAspectRatio > 1.7
? SettingsSwitchListTile(
context: context,
value: Config.isHistoryNavigationToolbarShown,
onChanged: setIsHistoryNavigationToolbarShown,
titleString: S.of(context).isHistoryNavigationToolbarShown,
),
ListItemDivider(),
) : SizedBox(height: 1),
Constants.windowAspectRatio > 1.7
? ListItemDivider(): SizedBox(height: 1),
SettingsListTile(
context: context,
titleString: S.of(context).boardBorderLineWidth,