Skip to content

Commit

Permalink
Use adaptive platform density for privacy policy. (#1691)
Browse files Browse the repository at this point in the history
With 219bea1 we started to use
`VisualDensitySetting.standard()` on all platforms instead of
`VisualDensitySetting.adaptivePlatformDensity()`. Since the latter is
better for the privacy policy UI on desktops we override it on this
page.

| Before | After |
| - | - |
| <img width="1440" alt="grafik"
src="https://github.com/user-attachments/assets/43a18405-f589-4949-930e-0d96c447f7bf">
| <img width="1439" alt="grafik"
src="https://github.com/user-attachments/assets/bb0979cd-98fd-4294-b9f4-f02464c643ab">
|

---------

Co-authored-by: Nils Reichardt <[email protected]>
  • Loading branch information
Jonas-Sander and nilsreichardt authored Jul 25, 2024
1 parent 7435573 commit 31326e9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/lib/legal/privacy_policy/privacy_policy_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,19 @@ class PrivacyPolicyPage extends StatelessWidget {
create: (context) {
final themeSettings =
Provider.of<ThemeSettings>(context, listen: false);
return _createPrivacyPolicyThemeSettings(
final newSettings = _createPrivacyPolicyThemeSettings(
context, themeSettings, config);
// As of this writing, we always use
// VisualDensitySetting.standard() instead of
// VisualDensitySetting.adaptivePlatformDensity() on all
// platforms. This may make sense for the general UI, but for
// the privacy policy page it is much better to use the adaptive
// spacing. This will make the TOC tiles more compact for
// desktop (since users will most likely be using a mouse there)
// and more spread out for touch users.
newSettings.visualDensitySetting =
VisualDensitySetting.adaptivePlatformDensity();
return newSettings;
},
),
Provider<DocumentController>(
Expand Down

0 comments on commit 31326e9

Please sign in to comment.