mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-04 23:57:54 +00:00
fix: align extension search with compact toolbar controls
This commit is contained in:
1 parent
a834ca0d74
commit
47db539d91
3 files changed
+6
-2
No files matched your search
@@ -633,6 +633,7 @@ class _Toolbar extends StatelessWidget {
|
||||
final search = AppTextField(
|
||||
key: const ValueKey('extension-search-input'),
|
||||
controller: searchController,
|
||||
padding: MediaQuery.sizeOf(context).width >= Breakpoints.mobile ? AppDesignTokens.compactTextFieldPadding : null,
|
||||
placeholder: Text(context.l10n.searchExtensions, style: TextStyle(color: palette.searchHint)),
|
||||
features: [shad.InputFeature.leading(Icon(Icons.search_rounded, size: 16, color: palette.textMuted))],
|
||||
onSubmitted: onSearch,
|
||||
|
||||
@@ -22,6 +22,7 @@ class AppDesignTokens {
|
||||
static const double settingsNumberControlWidth = 168;
|
||||
static const double settingsItemMinLabelWidth = 160;
|
||||
static const EdgeInsets textFieldPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 11);
|
||||
static const EdgeInsets compactTextFieldPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 6);
|
||||
static const EdgeInsets numberTextFieldPadding = EdgeInsets.symmetric(horizontal: 12, vertical: 10);
|
||||
|
||||
static const EdgeInsets pagePadding = EdgeInsets.symmetric(horizontal: 32);
|
||||
|
||||
@@ -414,7 +414,7 @@ void main() {
|
||||
child: shad.ShadcnApp(
|
||||
theme: AppTheme.light(),
|
||||
materialTheme: AppTheme.materialLight(),
|
||||
home: const ExtensionsPage(),
|
||||
home: const AppComponentThemes(child: ExtensionsPage()),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -434,6 +434,7 @@ void main() {
|
||||
final cardRect = tester.getRect(find.byKey(const ValueKey('extension-card-extension-0')));
|
||||
final rightmostCardRect = tester.getRect(find.byKey(const ValueKey('extension-card-extension-2')));
|
||||
final appMarkRect = tester.getRect(find.byKey(const ValueKey('primary-rail-app-mark')));
|
||||
expect(searchRect.height, closeTo(sortRect.height, 0.01));
|
||||
expect(searchRect.width, 240);
|
||||
expect(searchRect.width, lessThan(cardRect.width));
|
||||
expect(sortRect.left - searchRect.right, closeTo(10, 0.01));
|
||||
@@ -466,6 +467,7 @@ void main() {
|
||||
expect(find.byType(PrimaryRail), findsOneWidget);
|
||||
final compactSearchRect = tester.getRect(find.byKey(const ValueKey('extension-search-field-container')));
|
||||
expect(compactSearchRect.width, lessThan(240));
|
||||
expect(compactSearchRect.height, closeTo(sortRect.height, 0.01));
|
||||
expect(
|
||||
tester.getRect(find.byKey(const ValueKey('extension-sort-control'))).center.dy,
|
||||
closeTo(compactSearchRect.center.dy, 0.01),
|
||||
@@ -710,7 +712,7 @@ void main() {
|
||||
child: shad.ShadcnApp(
|
||||
theme: AppTheme.light(),
|
||||
materialTheme: AppTheme.materialLight(),
|
||||
home: const ExtensionsPage(),
|
||||
home: const AppComponentThemes(child: ExtensionsPage()),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user