Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/shared/widgets/querya_icon_button.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart' as material;
import 'package:shadcn_flutter/shadcn_flutter.dart';
import 'package:querya_desktop/core/theme/querya_theme_scope.dart';
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';
import 'package:querya_desktop/core/ui/querya_tooltip.dart';
Expand Down Expand Up @@ -90,7 +89,7 @@ class _QueryaIconButtonState extends material.State<QueryaIconButton> {
final isDestructive = widget.isDestructive;
final color = widget.color;
final activeColor = widget.activeColor;
final cs = Theme.of(context).colorScheme;
final cs = context.colors;
final workbench = QueryaThemeScope.maybeOf(context)?.workbench;
final radius = widget.borderRadius ??
material.BorderRadius.circular(controlSize.scaledRadius(context));
Expand Down Expand Up @@ -236,7 +235,7 @@ class _QueryaToolbarButtonState extends material.State<QueryaToolbarButton> {
QueryaControlSize.of(context);
final isActive = widget.isActive;
final isDestructive = widget.isDestructive;
final cs = Theme.of(context).colorScheme;
final cs = context.colors;
final workbench = QueryaThemeScope.maybeOf(context)?.workbench;
final isEnabled = onPressed != null;

Expand Down Expand Up @@ -273,7 +272,7 @@ class _QueryaToolbarButtonState extends material.State<QueryaToolbarButton> {
),
child: icon,
),
Gap(controlSize.scaledIconGap(context)),
material.SizedBox(width: controlSize.scaledIconGap(context)),
],
material.Text(
label,
Expand All @@ -284,7 +283,7 @@ class _QueryaToolbarButtonState extends material.State<QueryaToolbarButton> {
),
),
if (shortcutHint != null) ...[
const Gap(6),
const material.SizedBox(width: 6),
material.Container(
padding: const material.EdgeInsets.symmetric(horizontal: 4, vertical: 1),
decoration: material.BoxDecoration(
Expand Down
11 changes: 5 additions & 6 deletions lib/shared/widgets/querya_search_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:async';

import 'package:flutter/material.dart' as material;
import 'package:flutter/services.dart';
import 'package:shadcn_flutter/shadcn_flutter.dart';
import 'package:querya_desktop/core/theme/querya_theme_scope.dart';
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';

Expand Down Expand Up @@ -33,10 +32,10 @@ class QueryaSearchField extends material.StatefulWidget {
final String placeholder;

/// Callback fired after debounce duration when input text changes.
final ValueChanged<String>? onChanged;
final material.ValueChanged<String>? onChanged;

/// Callback fired immediately upon Enter / submit.
final ValueChanged<String>? onSubmitted;
final material.ValueChanged<String>? onSubmitted;

/// Debounce delay. Set to [Duration.zero] for immediate invocation.
final Duration debounceDuration;
Expand Down Expand Up @@ -136,7 +135,7 @@ class _QueryaSearchFieldState extends material.State<QueryaSearchField> {

@override
material.Widget build(material.BuildContext context) {
final cs = Theme.of(context).colorScheme;
final cs = context.colors;
final workbench = QueryaThemeScope.maybeOf(context)?.workbench;
final controlSize = widget.size ?? QueryaControlSize.of(context);
final fieldHeight = widget.height ?? controlSize.scaledHeight(context);
Expand Down Expand Up @@ -171,9 +170,9 @@ class _QueryaSearchFieldState extends material.State<QueryaSearchField> {
),
),
material.Expanded(
child: CallbackShortcuts(
child: material.CallbackShortcuts(
bindings: {
const SingleActivator(LogicalKeyboardKey.escape): () {
const material.SingleActivator(LogicalKeyboardKey.escape): () {
if (_hasText) {
_clear();
} else {
Expand Down
28 changes: 19 additions & 9 deletions lib/shared/widgets/querya_tab_strip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import 'package:querya_desktop/core/motion/querya_motion.dart';
import 'package:querya_desktop/core/motion/querya_motion_context.dart';
import 'package:querya_desktop/core/motion/querya_spring.dart';
import 'package:querya_desktop/core/motion/querya_spring_controller.dart';
import 'package:querya_desktop/core/theme/querya_theme_scope.dart';
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';
import 'package:querya_desktop/core/ui/querya_tooltip.dart';
import 'package:shadcn_flutter/shadcn_flutter.dart';

/// A compact, keyboard-operable tab strip using Querya's motion and theme.
///
Expand Down Expand Up @@ -254,7 +254,7 @@ class QueryaTabStripState extends material.State<QueryaTabStrip>

@override
material.Widget build(material.BuildContext context) {
final colors = Theme.of(context).colorScheme;
final colors = context.colors;
final controlSize = widget.size ??
(widget.dense
? QueryaControlSize.sm
Expand Down Expand Up @@ -320,12 +320,22 @@ class QueryaTabStripState extends material.State<QueryaTabStrip>
children: [
// The tab's own node carries the label.
material.ExcludeSemantics(
child: selected
? Text(label).small().semiBold()
: Text(label).small().muted(),
child: material.Text(
label,
style: material.TextStyle(
fontSize: 14,
height: 20 / 14,
fontWeight: selected
? material.FontWeight.w600
: material.FontWeight.w400,
color: selected
? colors.foreground
: colors.mutedForeground,
),
),
),
if (showClose) ...[
const Gap(2),
const material.SizedBox(width: 2),
material.Tooltip(
message: 'Close $label tab',
waitDuration: kQueryaTooltipWait,
Expand Down Expand Up @@ -376,7 +386,7 @@ class QueryaTabStripState extends material.State<QueryaTabStrip>
);
}),
if (widget.onAdd != null) ...[
const Gap(4),
const material.SizedBox(width: 4),
material.MouseRegion(
cursor: material.SystemMouseCursors.click,
child: material.GestureDetector(
Expand Down Expand Up @@ -463,8 +473,8 @@ class _TabStripIndicator extends material.StatelessWidget {

@override
material.Widget build(material.BuildContext context) {
return ListenableBuilder(
listenable: Listenable.merge([left, width]),
return material.ListenableBuilder(
listenable: material.Listenable.merge([left, width]),
builder: (context, __) {
final w = width.value;
if (w <= 0) return const material.SizedBox.shrink();
Expand Down
3 changes: 0 additions & 3 deletions test/guards/shared_does_not_import_shadcn_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ void main() {
'lib/shared/widgets/querya_dialog_card.dart',
'lib/shared/widgets/querya_dropdown.dart',
'lib/shared/widgets/querya_empty_state.dart',
'lib/shared/widgets/querya_icon_button.dart',
'lib/shared/widgets/querya_modal_dialog.dart',
'lib/shared/widgets/querya_search_field.dart',
'lib/shared/widgets/querya_tab_strip.dart',
'lib/shared/widgets/widgets.dart',
};

Expand Down
Loading