Skip to content

Commit

Permalink
YaruTitleBar: small styling changes (#478)
Browse files Browse the repository at this point in the history
* YaruTitleBar: small styling changes

- default size is now 47px (border adds on top, which ends up with 48 which is the height of gtk headerbars)
-  default light bg to #ebebeb, which is the gtk4 dark headerbar bg and dark bg to #303030

* add goldens

* Update goldens

Co-authored-by: J-P Nurmi <jp.nurmi@canonical.com>
  • Loading branch information
Feichtmeier and jpnurmi committed Jan 10, 2023
1 parent 72932a1 commit 2acf494
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion lib/src/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import 'package:flutter/material.dart';
const kYaruPagePadding = 20.0;

/// The default height of [YaruTitleBar].
const kYaruTitleBarHeight = 50.0;
const kYaruTitleBarHeight = 47.0;

/// The default background color of [YaruTitleBar] in the light theme.
const kYaruTitleBarBgLight = Color(0xFFebebeb);

/// The default background color of [YaruTitleBar] in the dark theme.
const kYaruTitleBarBgDark = Color(0xFF303030);

/// The default border radius for Yaru-style containers.
const kYaruContainerRadius = 8.0;
Expand Down
6 changes: 4 additions & 2 deletions lib/src/controls/yaru_title_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class YaruTitleBar extends StatelessWidget implements PreferredSizeWidget {
if (!states.contains(MaterialState.focused)) {
return Colors.transparent;
}
return Colors.black.withOpacity(light ? 0.075 : 0.2);
return light ? kYaruTitleBarBgLight : kYaruTitleBarBgDark;
});
final backgroundColor =
MaterialStateProperty.resolveAs(this.backgroundColor, states) ??
Expand All @@ -135,7 +135,9 @@ class YaruTitleBar extends StatelessWidget implements PreferredSizeWidget {
final shape = theme.shape ??
Border(
bottom: BorderSide(
color: Colors.black.withOpacity(light ? 0.1 : 0.2),
color: light
? Colors.black.withOpacity(0.1)
: Colors.white.withOpacity(0.06),
),
);

Expand Down
Binary file modified test/controls/goldens/yaru_title_bar-closable-dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/controls/goldens/yaru_title_bar-closable-light.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/controls/goldens/yaru_title_bar-empty-dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/controls/goldens/yaru_title_bar-empty-light.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/controls/goldens/yaru_title_bar-inactive-dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/controls/goldens/yaru_title_bar-inactive-light.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/controls/goldens/yaru_title_bar-maximizable-dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/controls/goldens/yaru_title_bar-maximizable-light.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/controls/goldens/yaru_title_bar-restorable-dark.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified test/controls/goldens/yaru_title_bar-restorable-light.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2acf494

Please sign in to comment.