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
27 changes: 13 additions & 14 deletions lib/core/editor/querya_code_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,19 @@ class _QueryaCodeEditorState extends State<QueryaCodeEditor> {
final controller = _effectiveController;

if (widget.variant == QueryaCodeEditorVariant.material) {
return material.TextField(
controller: controller,
focusNode: widget.focusNode,
autofocus: widget.autofocus,
readOnly: widget.readOnly,
maxLines: widget.expands ? null : widget.maxLines,
expands: widget.expands,
style: style,
textAlignVertical: _verticalAlignment,
decoration: material.InputDecoration(
border: material.InputBorder.none,
hintText: widget.hintText,
contentPadding:
widget.contentPadding ?? const material.EdgeInsets.all(12),
return material.Padding(
padding: widget.contentPadding ?? const material.EdgeInsets.all(12),
child: QueryaTextField(
framed: false,
controller: controller,
focusNode: widget.focusNode,
autofocus: widget.autofocus,
readOnly: widget.readOnly,
maxLines: widget.expands ? null : widget.maxLines,
expands: widget.expands,
style: style,
textAlignVertical: _verticalAlignment,
placeholder: widget.hintText,
),
);
}
Expand Down
32 changes: 6 additions & 26 deletions lib/features/connections/connections_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ import 'package:flutter/material.dart' as material
ClampingScrollPhysics,
CallbackShortcuts,
SingleActivator,
TextField,
InputDecoration,
InputBorder,
TextEditingController,
FocusNode;
import 'package:flutter/services.dart'
Expand Down Expand Up @@ -255,23 +252,15 @@ class TreeObjectFilterBar extends material.StatelessWidget {
),
const Gap(5),
material.Expanded(
child: material.TextField(
child: QueryaTextField(
framed: false,
controller: controller,
onChanged: onChanged,
style: material.TextStyle(
fontSize: 11,
color: colors.foreground,
),
decoration: material.InputDecoration(
hintText: hintText,
hintStyle: material.TextStyle(
fontSize: 11,
color: colors.mutedForeground.withValues(alpha: 0.6),
),
border: material.InputBorder.none,
isDense: true,
contentPadding: material.EdgeInsets.zero,
),
placeholder: hintText,
),
),
if (isFiltered) ...[
Expand Down Expand Up @@ -1228,7 +1217,8 @@ class ConnectionsPanelState extends State<ConnectionsPanel> {
),
const Gap(6),
material.Expanded(
child: material.TextField(
child: QueryaTextField(
framed: false,
controller: _searchController,
focusNode: _searchFocusNode,
onChanged: (val) => _searchDebouncer.run(() {
Expand All @@ -1238,17 +1228,7 @@ class ConnectionsPanelState extends State<ConnectionsPanel> {
fontSize: 12,
color: colors.foreground,
),
decoration: material.InputDecoration(
hintText: 'Filter connections... (Ctrl+F)',
hintStyle: material.TextStyle(
fontSize: 12,
color: colors.mutedForeground
.withValues(alpha: 0.6),
),
border: material.InputBorder.none,
isDense: true,
contentPadding: material.EdgeInsets.zero,
),
placeholder: 'Filter connections… (Ctrl+F)',
),
),
material.ValueListenableBuilder<material.TextEditingValue>(
Expand Down
8 changes: 2 additions & 6 deletions lib/features/extensions/extension_table_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -496,13 +496,9 @@ class _ExtensionTableViewState extends material.State<ExtensionTableView> {
const material.Text('WHERE ').semiBold().small(),
const Gap(8),
material.Expanded(
child: material.TextField(
child: QueryaTextField(
controller: _filterController,
decoration: const material.InputDecoration(
hintText: "e.g. id > 100 AND status = 'active'",
isDense: true,
border: material.OutlineInputBorder(),
),
placeholder: "e.g. id > 100 AND status = 'active'",
onSubmitted: (_) {
final st = _genericKey.currentState;
if (st != null) _applyFilter(st);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,11 @@ class _ExtensionSideloadDialogState
),
),
const material.SizedBox(height: 12),
material.TextField(
const Text('SHA-256 checksum (optional)').small().semiBold(),
const Gap(6),
QueryaTextField(
controller: _checksumController,
decoration: const material.InputDecoration(
labelText: 'SHA-256 checksum (optional)',
hintText: '64-character hex digest from publisher',
),
placeholder: '64-character hex digest from publisher',
autocorrect: false,
),
],
Expand Down
29 changes: 14 additions & 15 deletions lib/features/mongodb/mongo_aggregation_workspace.dart
Original file line number Diff line number Diff line change
Expand Up @@ -649,22 +649,21 @@ class _StageCardState extends material.State<_StageCard> {
borderRadius: material.BorderRadius.circular(6),
color: cs.background,
),
child: material.TextField(
controller: _textController,
maxLines: null,
minLines: 3,
style: const material.TextStyle(
fontFamily: QueryaTypography.mono,
fontFamilyFallback: QueryaTypography.monoFontFamilyFallback,
fontSize: 12.5,
height: 1.4,
),
decoration: const material.InputDecoration(
isDense: true,
border: material.InputBorder.none,
contentPadding: material.EdgeInsets.all(10),
child: material.Padding(
padding: const material.EdgeInsets.all(10),
child: QueryaTextField(
framed: false,
controller: _textController,
maxLines: null,
minLines: 3,
style: const material.TextStyle(
fontFamily: QueryaTypography.mono,
fontFamilyFallback: QueryaTypography.monoFontFamilyFallback,
fontSize: 12.5,
height: 1.4,
),
onChanged: widget.onQueryChanged,
),
onChanged: widget.onQueryChanged,
),
),
if (syntaxError != null) ...[
Expand Down
45 changes: 10 additions & 35 deletions lib/features/mongodb/mongo_create_index_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,9 @@ class _MongoCreateIndexDialogState
children: [
material.Expanded(
flex: 3,
child: material.TextField(
child: QueryaTextField(
controller: _fields[i].controller,
decoration: const material.InputDecoration(
hintText: 'Field name (e.g. email)',
isDense: true,
border: material.OutlineInputBorder(),
contentPadding: material.EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
),
style: const material.TextStyle(fontSize: 13),
placeholder: 'Field name (e.g. email)',
onChanged: (_) => setState(() {}),
),
),
Expand Down Expand Up @@ -337,36 +328,20 @@ class _MongoCreateIndexDialogState
),
const Gap(8),
// TTL
material.TextField(
const Text('TTL: expire after seconds (optional)').small().semiBold(),
const Gap(6),
QueryaTextField(
controller: _ttlController,
keyboardType: material.TextInputType.number,
decoration: const material.InputDecoration(
labelText: 'TTL: Expire After Seconds (optional)',
hintText: 'e.g. 86400 (24 hours)',
isDense: true,
border: material.OutlineInputBorder(),
contentPadding: material.EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
),
style: const material.TextStyle(fontSize: 13),
placeholder: 'e.g. 86400 (24 hours)',
),
const Gap(12),
// Index Name
material.TextField(
const Text('Index name (optional)').small().semiBold(),
const Gap(6),
QueryaTextField(
controller: _nameController,
decoration: material.InputDecoration(
labelText: 'Index Name (optional)',
hintText: _computedIndexName(),
isDense: true,
border: const material.OutlineInputBorder(),
contentPadding: const material.EdgeInsets.symmetric(
horizontal: 10,
vertical: 8,
),
),
style: const material.TextStyle(fontSize: 13),
placeholder: _computedIndexName(),
),
],
),
Expand Down
23 changes: 11 additions & 12 deletions lib/features/redis/editors/redis_string_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,17 @@ class RedisStringEditor extends material.StatelessWidget {
color: colors.border.withValues(alpha: 0.3)),
borderRadius: material.BorderRadius.circular(8),
),
child: material.TextField(
controller: controller,
readOnly: isReadOnly,
maxLines: null,
style: const material.TextStyle(
fontSize: 13,
fontFamily: QueryaTypography.mono,
fontFamilyFallback: QueryaTypography.monoFontFamilyFallback,
),
decoration: const material.InputDecoration(
border: material.InputBorder.none,
contentPadding: material.EdgeInsets.all(12),
child: material.Padding(
padding: const material.EdgeInsets.all(12),
child: QueryaTextField(
framed: false,
controller: controller,
readOnly: isReadOnly,
maxLines: null,
style: const material.TextStyle(
fontFamily: QueryaTypography.mono,
fontFamilyFallback: QueryaTypography.monoFontFamilyFallback,
),
),
),
),
Expand Down
19 changes: 3 additions & 16 deletions lib/features/redis/redis_keys_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -537,29 +537,16 @@ class _RedisKeysViewState extends material.State<RedisKeysView> {
material.SizedBox(
width: 36,
height: 28,
child: material.TextField(
child: QueryaTextField(
controller: _delimiterController,
size: QueryaControlSize.sm,
textAlign: material.TextAlign.center,
contentPadding: material.EdgeInsets.zero,
style: const material.TextStyle(
fontSize: 13,
fontFamily: QueryaTypography.mono,
fontFamilyFallback:
QueryaTypography.monoFontFamilyFallback,
),
decoration: material.InputDecoration(
contentPadding: material.EdgeInsets.zero,
isDense: true,
border: material.OutlineInputBorder(
borderRadius: material.BorderRadius.circular(6),
borderSide: material.BorderSide(
color: cs.border.withValues(alpha: 0.4),
),
),
focusedBorder: material.OutlineInputBorder(
borderRadius: material.BorderRadius.circular(6),
borderSide: material.BorderSide(color: cs.primary),
),
),
onChanged: (_) => setState(() {}),
),
),
Expand Down
15 changes: 3 additions & 12 deletions lib/features/settings/preferences_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ class PreferencesDialogContentState
),
const Gap(8),
material.Expanded(
child: material.TextField(
child: QueryaTextField(
framed: false,
controller: _searchController,
focusNode: _searchFocusNode,
onChanged: (val) {
Expand All @@ -333,17 +334,7 @@ class PreferencesDialogContentState
fontSize: 12,
color: theme.foreground,
),
decoration: material.InputDecoration(
hintText: 'Filter preferences... (Ctrl+F)',
hintStyle: material.TextStyle(
fontSize: 12,
color: theme.mutedForeground
.withValues(alpha: 0.6),
),
border: material.InputBorder.none,
isDense: true,
contentPadding: material.EdgeInsets.zero,
),
placeholder: 'Filter preferences… (Ctrl+F)',
),
),
if (_searchQuery.isNotEmpty)
Expand Down
42 changes: 4 additions & 38 deletions lib/features/settings/theme_picker_button.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';

import 'package:flutter/material.dart' as material;
import 'package:querya_desktop/shared/widgets/querya_text_field.dart';
import 'package:querya_desktop/core/theme/querya_theme_scope.dart';
import 'package:querya_desktop/core/theme/querya_ui_colors.dart';
import 'package:querya_desktop/core/layout/ui_scale.dart';
Expand Down Expand Up @@ -300,7 +301,6 @@ class _ThemePickerButtonState extends material.State<ThemePickerButton> {
material.Widget _buildMenuPanel(
material.BuildContext context, QueryaUiColors cs) {
final filteredThemes = _filteredThemes;
final radius = context.scaled(QueryaDropdownTokens.menuBorderRadius);

return material.Column(
children: [
Expand All @@ -311,44 +311,10 @@ class _ThemePickerButtonState extends material.State<ThemePickerButton> {
context.scaled(8),
context.scaled(4),
),
child: material.TextField(
child: QueryaTextField(
controller: _searchController,
style: material.TextStyle(
fontSize: context.scaled(QueryaDropdownTokens.fontSize),
color: cs.popoverForeground,
),
decoration: material.InputDecoration(
isDense: true,
hintText: 'Search themes…',
hintStyle: material.TextStyle(color: cs.mutedForeground),
prefixIcon: material.Icon(
material.Icons.search,
size: context.scaled(18),
color: cs.mutedForeground,
),
prefixIconConstraints: material.BoxConstraints(
minWidth: context.scaled(36),
minHeight: context.scaled(32),
),
contentPadding: material.EdgeInsets.symmetric(
horizontal: context.scaled(8),
vertical: context.scaled(8),
),
filled: true,
fillColor: cs.muted.withValues(alpha: 0.18),
border: material.OutlineInputBorder(
borderRadius: material.BorderRadius.circular(radius),
borderSide: material.BorderSide(color: cs.border),
),
enabledBorder: material.OutlineInputBorder(
borderRadius: material.BorderRadius.circular(radius),
borderSide: material.BorderSide(color: cs.border),
),
focusedBorder: material.OutlineInputBorder(
borderRadius: material.BorderRadius.circular(radius),
borderSide: material.BorderSide(color: cs.ring),
),
),
placeholder: 'Search themes…',
leading: const material.Icon(material.Icons.search),
),
),
if (widget.onPreviewTheme != null)
Expand Down
Loading
Loading