Skip to content

Commit 1086a85

Browse files
kawaijoePante
andauthored
Fix issue where icon theme is not being propogated (#643)
* Fix implemented * Update changelog * Prepare Forui for review * Fixed issue with progress * Prepare Forui for review * Update macos-latest goldens * Update windows-latest goldens * Update forui/CHANGELOG.md --------- Co-authored-by: Matthias Ngeo <[email protected]>
1 parent 74e5c08 commit 1086a85

File tree

19 files changed

+68
-28
lines changed

19 files changed

+68
-28
lines changed

forui/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ We've done a pass over the controllers in Forui to make them more consistent and
4141
* **Breaking** Change `FTappableStyle.mouseCursor` to `MouseCursor.defer`. See https://ux.stackexchange.com/questions/105024/why-dont-button-html-elements-have-a-css-cursor-pointer-by-default
4242
for our rationale behind this change.
4343

44+
* Fix `FProgress.circularIcon()` using incorrect color.
45+
* Fix `FScaffold` not propagating `IconTheme` from `FStyle.iconStyle`.
4446
* Fix `FTabs` throwing an assertion error if `FTabController` is provided with a `initialIndex` > 0.
4547

4648

forui/bin/commands/style/style.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

forui/example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class _ApplicationState extends State<Application> with SingleTickerProviderStat
3939
locale: const Locale('en', 'US'),
4040
localizationsDelegates: FLocalizations.localizationsDelegates,
4141
supportedLocales: FLocalizations.supportedLocales,
42-
theme: FThemes.zinc.light.toApproximateMaterialTheme(),
42+
// theme: FThemes.zinc.light.toApproximateMaterialTheme(),
4343
builder: (context, child) => FTheme(data: FThemes.zinc.light, child: child!),
4444
home: Builder(
4545
builder: (context) {

forui/example/lib/sandbox.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class _SandboxState extends State<Sandbox> with SingleTickerProviderStateMixin {
2929

3030
@override
3131
Widget build(BuildContext context) {
32-
return Center(
33-
child: FAutocomplete(label: Text('Autocomplete'), hint: 'What can it do?', items: features),
34-
);
32+
return Center(child: const FProgress.circularIcon());
3533
}
3634
}

forui/lib/src/widgets/progress.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ class FProgressStyles with Diagnosticable, _$FProgressStylesFunctions {
258258
/// Creates a [FProgressStyles] that inherits its properties.
259259
FProgressStyles.inherit({required FColors colors, required FStyle style})
260260
: linearProgressStyle = FLinearProgressStyle.inherit(colors: colors, style: style),
261-
circularIconProgressStyle = IconThemeData(color: colors.mutedForeground, size: 20);
261+
circularIconProgressStyle = IconThemeData(color: style.iconStyle.color, size: 20);
262262
}
263263

264264
/// A linear [FProgress]'s style.

forui/lib/src/widgets/scaffold.dart

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -109,30 +109,34 @@ class FScaffold extends StatelessWidget {
109109

110110
return AnnotatedRegion<SystemUiOverlayStyle>(
111111
value: style.systemOverlayStyle,
112-
child: FSheets(
113-
child: FToaster(
114-
style: toasterStyle?.call(context.theme.toasterStyle) ?? context.theme.toasterStyle,
115-
child: Row(
116-
children: [
117-
if (sidebar != null) ColoredBox(color: style.sidebarBackgroundColor, child: sidebar),
118-
Expanded(
119-
child: ColoredBox(
120-
color: style.backgroundColor,
121-
child: _RenderScaffoldWidget(
122-
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
123-
children: [
124-
Column(
125-
children: [
126-
if (header != null) DecoratedBox(decoration: style.headerDecoration, child: header!),
127-
Expanded(child: child),
128-
],
129-
),
130-
footer,
131-
],
112+
child: IconTheme(
113+
// TODO: Move to ForuiApp.
114+
data: context.theme.style.iconStyle,
115+
child: FSheets(
116+
child: FToaster(
117+
style: toasterStyle?.call(context.theme.toasterStyle) ?? context.theme.toasterStyle,
118+
child: Row(
119+
children: [
120+
if (sidebar != null) ColoredBox(color: style.sidebarBackgroundColor, child: sidebar),
121+
Expanded(
122+
child: ColoredBox(
123+
color: style.backgroundColor,
124+
child: _RenderScaffoldWidget(
125+
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
126+
children: [
127+
Column(
128+
children: [
129+
if (header != null) DecoratedBox(decoration: style.headerDecoration, child: header!),
130+
Expanded(child: child),
131+
],
132+
),
133+
footer,
134+
],
135+
),
132136
),
133137
),
134-
),
135-
],
138+
],
139+
),
136140
),
137141
),
138142
),
128 Bytes
Loading
87 Bytes
Loading
66 Bytes
Loading
80 Bytes
Loading

0 commit comments

Comments
 (0)