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
15 changes: 7 additions & 8 deletions lib/features/settings/preferences_about_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class _PreferencesAboutSectionState

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);

return material.Column(
crossAxisAlignment: material.CrossAxisAlignment.start,
Expand All @@ -42,10 +41,10 @@ class _PreferencesAboutSectionState
material.Container(
padding: const material.EdgeInsets.all(16),
decoration: material.BoxDecoration(
color: theme.colorScheme.muted.withValues(alpha: 0.18),
color: context.colors.muted.withValues(alpha: 0.18),
borderRadius: material.BorderRadius.circular(8),
border: material.Border.all(
color: theme.colorScheme.border.withValues(alpha: 0.25),
color: context.colors.border.withValues(alpha: 0.25),
),
),
child: material.Row(
Expand All @@ -54,10 +53,10 @@ class _PreferencesAboutSectionState
width: 48,
height: 48,
decoration: material.BoxDecoration(
color: theme.colorScheme.primary.withValues(alpha: 0.12),
color: context.colors.primary.withValues(alpha: 0.12),
borderRadius: material.BorderRadius.circular(8),
border: material.Border.all(
color: theme.colorScheme.primary.withValues(alpha: 0.3),
color: context.colors.primary.withValues(alpha: 0.3),
),
),
child: material.Center(
Expand All @@ -69,7 +68,7 @@ class _PreferencesAboutSectionState
errorBuilder: (_, __, ___) => material.Icon(
QueryaIcons.database,
size: 24,
color: theme.colorScheme.primary,
color: context.colors.primary,
),
),
),
Expand Down Expand Up @@ -120,10 +119,10 @@ class _PreferencesAboutSectionState
margin: const material.EdgeInsets.only(bottom: 12),
padding: const material.EdgeInsets.all(12),
decoration: material.BoxDecoration(
color: theme.colorScheme.muted.withValues(alpha: 0.25),
color: context.colors.muted.withValues(alpha: 0.25),
borderRadius: material.BorderRadius.circular(6),
border: material.Border.all(
color: theme.colorScheme.primary.withValues(alpha: 0.3),
color: context.colors.primary.withValues(alpha: 0.3),
),
),
child: material.Row(
Expand Down
10 changes: 5 additions & 5 deletions lib/features/settings/preferences_appearance_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class _PreferencesAppearanceSectionState
c.selectedThemeLoadError!,
style: material.TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.destructive,
color: context.colors.destructive,
),
),
),
Expand Down Expand Up @@ -273,10 +273,10 @@ class _PreferencesAppearanceSectionState
material.Container(
padding: const material.EdgeInsets.all(14),
decoration: material.BoxDecoration(
color: Theme.of(context).colorScheme.muted.withValues(alpha: 0.14),
color: context.colors.muted.withValues(alpha: 0.14),
borderRadius: material.BorderRadius.circular(8),
border: material.Border.all(
color: Theme.of(context).colorScheme.border.withValues(alpha: 0.25),
color: context.colors.border.withValues(alpha: 0.25),
),
),
child: material.Column(
Expand Down Expand Up @@ -340,7 +340,7 @@ class _PreferencesAppearanceSectionState
_importError!,
style: material.TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.destructive,
color: context.colors.destructive,
),
),
],
Expand All @@ -350,7 +350,7 @@ class _PreferencesAppearanceSectionState
_folderOpenError!,
style: material.TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.destructive,
color: context.colors.destructive,
),
),
],
Expand Down
5 changes: 3 additions & 2 deletions lib/features/settings/preferences_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async' show unawaited;

import 'package:flutter/material.dart' as material;
import 'package:flutter/services.dart';
import 'package:querya_desktop/core/theme/querya_theme_scope.dart';
import 'package:querya_desktop/core/layout/ui_scale_controller.dart';
import 'package:querya_desktop/core/layout/ui_scale.dart';
import 'package:querya_desktop/core/storage/app_settings.dart';
Expand All @@ -17,7 +18,7 @@ class PreferencesHint extends StatelessWidget {

@override
Widget build(BuildContext context) {
final cs = Theme.of(context).colorScheme;
final cs = context.colors;
return Text(
text,
style: TextStyle(
Expand Down Expand Up @@ -289,7 +290,7 @@ class _InterfaceScaleSliderState extends material.State<InterfaceScaleSlider> {

@override
material.Widget build(material.BuildContext context) {
final cs = Theme.of(context).colorScheme;
final cs = context.colors;
final displayScale = _displayScale;
final pct = (displayScale * 100).round();
final fine = _fineControl;
Expand Down
15 changes: 8 additions & 7 deletions lib/features/settings/preferences_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';

import 'package:flutter/material.dart' as material;
import 'package:flutter/services.dart' show LogicalKeyboardKey;
import 'package:querya_desktop/core/theme/querya_ui_colors.dart';
import 'package:querya_desktop/core/layout/ui_scale.dart';
import 'package:querya_desktop/core/layout/window_layout.dart';
import 'package:querya_desktop/core/storage/app_settings.dart';
Expand Down Expand Up @@ -237,7 +238,7 @@ class PreferencesDialogContentState
@override
material.Widget build(material.BuildContext context) {
_visited.add(_selectedCategory);
final theme = Theme.of(context).colorScheme;
final theme = context.colors;
final onPopover = theme.popoverForeground;

return material.CallbackShortcuts(
Expand Down Expand Up @@ -437,7 +438,7 @@ class PreferencesDialogContentState
);
}

material.Widget _buildPaneHost(PreferencesCategory cat, ColorScheme theme) {
material.Widget _buildPaneHost(PreferencesCategory cat, QueryaUiColors theme) {
final selected = cat == _selectedCategory;
return material.Offstage(
key: material.ValueKey('preferences_pane_${cat.name}'),
Expand All @@ -460,7 +461,7 @@ class PreferencesDialogContentState

material.Widget _buildCategoryRailTile(
PreferencesCategory cat,
ColorScheme theme,
QueryaUiColors theme,
) {
final isSelected = _selectedCategory == cat;
final matches = _matchCountForCategory(cat);
Expand Down Expand Up @@ -535,7 +536,7 @@ class PreferencesDialogContentState
);
}

material.Widget _buildPane(PreferencesCategory cat, ColorScheme theme) {
material.Widget _buildPane(PreferencesCategory cat, QueryaUiColors theme) {
switch (cat) {
case PreferencesCategory.general:
return _buildGeneralSection(theme);
Expand All @@ -556,7 +557,7 @@ class PreferencesDialogContentState
}
}

material.Widget _buildGeneralSection(ColorScheme theme) {
material.Widget _buildGeneralSection(QueryaUiColors theme) {
return material.Column(
crossAxisAlignment: material.CrossAxisAlignment.start,
children: [
Expand Down Expand Up @@ -609,7 +610,7 @@ class PreferencesDialogContentState
);
}

material.Widget _buildSqlSection(ColorScheme theme) {
material.Widget _buildSqlSection(QueryaUiColors theme) {
return material.Column(
crossAxisAlignment: material.CrossAxisAlignment.start,
children: [
Expand Down Expand Up @@ -701,7 +702,7 @@ class PreferencesDialogContentState
);
}

material.Widget _buildDataGridSection(ColorScheme theme) {
material.Widget _buildDataGridSection(QueryaUiColors theme) {
return material.Column(
crossAxisAlignment: material.CrossAxisAlignment.start,
children: [
Expand Down
26 changes: 13 additions & 13 deletions lib/features/settings/preferences_shortcuts_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ class _PreferencesShortcutsSectionState
),
decoration: material.BoxDecoration(
color: _selectedCategory == cat
? theme.colorScheme.primary.withValues(alpha: 0.16)
: theme.colorScheme.muted.withValues(alpha: 0.3),
? context.colors.primary.withValues(alpha: 0.16)
: context.colors.muted.withValues(alpha: 0.3),
borderRadius: material.BorderRadius.circular(16),
border: material.Border.all(
color: _selectedCategory == cat
? theme.colorScheme.primary.withValues(alpha: 0.5)
: theme.colorScheme.border.withValues(alpha: 0.25),
? context.colors.primary.withValues(alpha: 0.5)
: context.colors.border.withValues(alpha: 0.25),
),
),
child: material.Row(
Expand All @@ -270,8 +270,8 @@ class _PreferencesShortcutsSectionState
? material.FontWeight.w600
: material.FontWeight.w400,
color: _selectedCategory == cat
? theme.colorScheme.primary
: theme.colorScheme.foreground,
? context.colors.primary
: context.colors.foreground,
),
),
const material.SizedBox(width: 4),
Expand All @@ -280,8 +280,8 @@ class _PreferencesShortcutsSectionState
style: material.TextStyle(
fontSize: 10,
color: _selectedCategory == cat
? theme.colorScheme.primary.withValues(alpha: 0.8)
: theme.colorScheme.mutedForeground,
? context.colors.primary.withValues(alpha: 0.8)
: context.colors.mutedForeground,
),
),
],
Expand Down Expand Up @@ -333,10 +333,10 @@ class _PreferencesShortcutsSectionState
),
material.Container(
decoration: material.BoxDecoration(
color: theme.colorScheme.muted.withValues(alpha: 0.16),
color: context.colors.muted.withValues(alpha: 0.16),
borderRadius: material.BorderRadius.circular(8),
border: material.Border.all(
color: theme.colorScheme.border.withValues(alpha: 0.25),
color: context.colors.border.withValues(alpha: 0.25),
),
),
child: material.Column(
Expand All @@ -345,7 +345,7 @@ class _PreferencesShortcutsSectionState
if (i > 0)
QueryaDivider(
height: 1,
color: theme.colorScheme.border.withValues(alpha: 0.18),
color: context.colors.border.withValues(alpha: 0.18),
),
_buildShortcutRow(context, entry.value[i], theme),
],
Expand Down Expand Up @@ -426,7 +426,7 @@ class _PreferencesShortcutsSectionState
color: wb.surface,
borderRadius: material.BorderRadius.circular(4),
border: material.Border.all(
color: theme.colorScheme.border.withValues(alpha: 0.4),
color: context.colors.border.withValues(alpha: 0.4),
),
boxShadow: [
material.BoxShadow(
Expand All @@ -443,7 +443,7 @@ class _PreferencesShortcutsSectionState
fontFamilyFallback: QueryaTypography.monoFontFamilyFallback,
fontSize: 11,
fontWeight: material.FontWeight.w600,
color: theme.colorScheme.foreground,
color: context.colors.foreground,
),
),
),
Expand Down
9 changes: 4 additions & 5 deletions lib/features/settings/theme_editor_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class _ThemeEditorDialogState extends material.State<ThemeEditorDialog> {
try {
initial = currentHex != null
? parseQueryaThemeColor(currentHex)
: Theme.of(context).colorScheme.primary;
: context.colors.primary;
} on FormatException {
initial = Theme.of(context).colorScheme.primary;
initial = context.colors.primary;
}

final picked = await showThemeColorPickerDialog(
Expand Down Expand Up @@ -147,8 +147,7 @@ class _ThemeEditorDialogState extends material.State<ThemeEditorDialog> {

@override
material.Widget build(material.BuildContext context) {
final theme = Theme.of(context);
final cs = theme.colorScheme;
final cs = context.colors;

return QueryaModalDialog(
constraints: WindowLayout.dialogConstraints(
Expand Down Expand Up @@ -294,7 +293,7 @@ class _ThemeEditorColorRow extends material.StatelessWidget {

@override
material.Widget build(material.BuildContext context) {
final cs = Theme.of(context).colorScheme;
final cs = context.colors;
Color? swatchColor;
if (hex != null) {
try {
Expand Down
3 changes: 1 addition & 2 deletions lib/features/settings/theme_editor_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class ThemeEditorSection extends material.StatelessWidget {

@override
material.Widget build(material.BuildContext context) {
final theme = Theme.of(context);
final cs = theme.colorScheme;
final cs = context.colors;

return material.Container(
margin: const material.EdgeInsets.only(top: 12),
Expand Down
Loading
Loading