refactor(theme): route consumer reads through ClideSettings.theme (T-473)
Migrate ClideTheme.of(context) reads across the widget, feature, and shell layers to the unified ClideSettings.theme.of(context) facade (D-101), so theme/i18n/fonts/settings share one widget-facing entry. The facade delegates straight to ClideTheme, so behaviour is unchanged — goldens are unmoved. The low-level theme provider keeps its direct ClideTheme.of: the facade is built on it, and the two kernel sites (ClideTheme's own definition + the panels drag-resize widget) stay direct to avoid a widgets→kernel import cycle. Dead controller.dart/kernel.dart imports left by the sweep removed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -40,7 +40,7 @@ class _BacklinksViewState extends State<BacklinksView> {
|
||||
return ListenableBuilder(
|
||||
listenable: c,
|
||||
builder: (context, _) {
|
||||
final tokens = ClideTheme.of(context).surface;
|
||||
final tokens = ClideSettings.theme.of(context).surface;
|
||||
if (c.activePath == null) {
|
||||
return const Padding(padding: EdgeInsets.all(12), child: ClideText('Open a file to see its links.', muted: true));
|
||||
}
|
||||
@@ -110,7 +110,7 @@ class _LinkRow extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tokens = ClideTheme.of(context).surface;
|
||||
final tokens = ClideSettings.theme.of(context).surface;
|
||||
final target = link[pathKey] as String? ?? '';
|
||||
final alias = link['alias'] as String?;
|
||||
final display = alias ?? target;
|
||||
|
||||
@@ -97,7 +97,7 @@ class _PqlSearchBodyState extends State<PqlSearchBody> {
|
||||
return ListenableBuilder(
|
||||
listenable: c,
|
||||
builder: (context, _) {
|
||||
final tokens = ClideTheme.of(context).surface;
|
||||
final tokens = ClideSettings.theme.of(context).surface;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
@@ -174,7 +174,7 @@ class _SearchResultRow extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tokens = ClideTheme.of(context).surface;
|
||||
final tokens = ClideSettings.theme.of(context).surface;
|
||||
final path = entry['path'] as String? ?? '';
|
||||
final score = (entry['score'] as num?)?.toDouble() ?? 0;
|
||||
return Padding(
|
||||
@@ -242,7 +242,7 @@ class _FileRow extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tokens = ClideTheme.of(context).surface;
|
||||
final tokens = ClideSettings.theme.of(context).surface;
|
||||
final path = entry['path'] as String? ?? '';
|
||||
return Padding(
|
||||
key: focusKey,
|
||||
@@ -269,7 +269,7 @@ class _QueryResultRow extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tokens = ClideTheme.of(context).surface;
|
||||
final tokens = ClideSettings.theme.of(context).surface;
|
||||
final name = entry['name'] as String? ?? entry['path'] as String? ?? '';
|
||||
final values = entry.entries.where((e) => e.key != 'name' && e.key != 'path').map((e) => '${e.key}: ${e.value}').join(' · ');
|
||||
return Padding(
|
||||
|
||||
Reference in New Issue
Block a user