From d155da750c9daf2ffe7b1758cd70ae525703c02c Mon Sep 17 00:00:00 2001 From: Feichtmeier Date: Tue, 19 Mar 2024 15:48:40 +0100 Subject: [PATCH] feat: use a paned look - to reduce the number of visual color background areas, use the paned look that can be found in gtk4 apps - since the right titlebar then has more contrast against the search field, remove the searchfield fill color override, this also... Fixes #1612 --- .../lib/src/search/search_field.dart | 1 - .../app_center/lib/src/store/store_app.dart | 38 ++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/packages/app_center/lib/src/search/search_field.dart b/packages/app_center/lib/src/search/search_field.dart index a4ed246d9..e2ec322c3 100644 --- a/packages/app_center/lib/src/search/search_field.dart +++ b/packages/app_center/lib/src/search/search_field.dart @@ -174,7 +174,6 @@ class _SearchFieldState extends ConsumerState { : widget.onSearch(query), decoration: InputDecoration( contentPadding: const EdgeInsets.fromLTRB(12, 8, 12, 8), - fillColor: Theme.of(context).dividerColor, prefixIcon: const Icon(YaruIcons.search, size: 16), prefixIconConstraints: iconConstraints, hintText: l10n.searchFieldSearchHint, diff --git a/packages/app_center/lib/src/store/store_app.dart b/packages/app_center/lib/src/store/store_app.dart index 786a39672..5a29b154c 100644 --- a/packages/app_center/lib/src/store/store_app.dart +++ b/packages/app_center/lib/src/store/store_app.dart @@ -60,7 +60,7 @@ class _StoreAppState extends ConsumerState { supportedLocales: supportedLocales, home: YaruWindowTitleSetter( child: Scaffold( - appBar: YaruWindowTitleBar( + appBar: _TitleBar( title: ConstrainedBox( constraints: const BoxConstraints(maxWidth: kSearchBarWidth), @@ -133,3 +133,39 @@ class YaruWindowTitleSetter extends StatelessWidget { return child; } } + +class _TitleBar extends StatelessWidget implements PreferredSizeWidget { + const _TitleBar({required this.title}); + + final Widget title; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + SizedBox( + width: kPaneWidth, + child: YaruWindowTitleBar( + style: YaruTitleBarStyle.undecorated, + border: BorderSide.none, + backgroundColor: YaruMasterDetailTheme.of(context).sideBarColor, + ), + ), + const SizedBox( + height: kYaruTitleBarHeight, + child: VerticalDivider(), + ), + Expanded( + child: YaruWindowTitleBar( + border: BorderSide.none, + backgroundColor: Colors.transparent, + title: title, + ), + ), + ], + ); + } + + @override + Size get preferredSize => const Size(0, kYaruTitleBarHeight); +}