Skip to content

Commit 71355b0

Browse files
committed
Update UI elements and alignment in multiple components
The changes include icon button styling, navigation alignment, UI colors, and component replacements throughout the app UI.
1 parent 0dfe247 commit 71355b0

File tree

8 files changed

+36
-27
lines changed

8 files changed

+36
-27
lines changed

apps/biyi_app/lib/app/home/desktop_popup.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ class _DesktopPopupPageState extends State<DesktopPopupPage>
865865

866866
PreferredSizeWidget _buildAppBar(BuildContext context) {
867867
return PreferredSize(
868-
preferredSize: const Size.fromHeight(34),
868+
preferredSize: const Size.fromHeight(40),
869869
child: Container(
870870
padding: const EdgeInsets.symmetric(horizontal: 4),
871871
child: Row(

apps/biyi_app/lib/app/home/toolbar_item_always_on_top.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,26 +25,26 @@ class _ToolbarItemAlwaysOnTopState extends State<ToolbarItemAlwaysOnTop> {
2525

2626
@override
2727
Widget build(BuildContext context) {
28-
return AnimatedContainer(
29-
duration: const Duration(milliseconds: 200),
30-
curve: Curves.fastOutSlowIn,
31-
transformAlignment: Alignment.center,
32-
transform: Matrix4.rotationZ(
33-
_isAlwaysOnTop ? 0 : -0.8,
34-
),
35-
child: Button(
36-
style:
37-
_isAlwaysOnTop ? ButtonVariance.primary : ButtonVariance.secondary,
38-
onPressed: () {
39-
setState(() {
40-
_isAlwaysOnTop = !_isAlwaysOnTop;
41-
});
42-
windowManager.setAlwaysOnTop(_isAlwaysOnTop);
43-
},
28+
final ThemeData themeData = Theme.of(context);
29+
return IconButton.text(
30+
onPressed: () {
31+
setState(() {
32+
_isAlwaysOnTop = !_isAlwaysOnTop;
33+
});
34+
windowManager.setAlwaysOnTop(_isAlwaysOnTop);
35+
},
36+
icon: AnimatedContainer(
37+
duration: const Duration(milliseconds: 200),
38+
curve: Curves.fastOutSlowIn,
39+
transformAlignment: Alignment.center,
40+
transform: Matrix4.rotationZ(
41+
_isAlwaysOnTop ? 0 : -0.8,
42+
),
4443
child: Icon(
4544
_isAlwaysOnTop
4645
? FluentIcons.pin_20_filled
4746
: FluentIcons.pin_20_regular,
47+
color: _isAlwaysOnTop ? themeData.colorScheme.primary : null,
4848
),
4949
),
5050
);

apps/biyi_app/lib/app/home/toolbar_item_settings.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ class _ToolbarItemSettingsState extends State<ToolbarItemSettings> {
2929

3030
@override
3131
Widget build(BuildContext context) {
32-
return Button(
33-
style: ButtonVariance.secondary,
32+
return IconButton.text(
3433
onPressed: _handleClick,
35-
child: const Icon(
34+
icon: const Icon(
3635
FluentIcons.settings_20_regular,
3736
),
3837
);

apps/biyi_app/lib/app/home/translation_input_view.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import 'package:biyi_app/models/settings_base.dart';
55
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
66
import 'package:flutter_spinkit/flutter_spinkit.dart';
77
import 'package:screen_capturer/screen_capturer.dart';
8-
import 'package:uikit/uikit.dart' hide Tooltip;
9-
import 'package:flutter/material.dart' show Tooltip;
8+
import 'package:uikit/uikit.dart';
109

1110
class TranslationInputView extends StatelessWidget {
1211
const TranslationInputView({
@@ -142,7 +141,7 @@ class TranslationInputView extends StatelessWidget {
142141
),
143142
ConstrainedBox(
144143
constraints: const BoxConstraints(minWidth: 56),
145-
child: Button.secondary(
144+
child: Button.primary(
146145
onPressed: onButtonTappedTrans,
147146
child: Text(t.app.home.btn_trans),
148147
),

apps/biyi_app/lib/app/settings/layout.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,30 +155,35 @@ class _SettingsLayoutState extends State<SettingsLayout> with WindowListener {
155155
Text(t.app.settings.kLayout.navgroup.client).semiBold().muted(),
156156
),
157157
NavigationItem(
158+
alignment: Alignment.centerLeft,
158159
selected: _selectedDestination == PageId.settingsGeneral,
159160
label: Text(t.app.settings.general.title),
160161
child: const Icon(FluentIcons.app_generic_20_regular),
161162
// onTap: () => _handleDestinationSelected(PageId.settingsGeneral),
162163
),
163164
NavigationItem(
165+
alignment: Alignment.centerLeft,
164166
selected: _selectedDestination == PageId.settingsAppearance,
165167
label: Text(t.app.settings.appearance.title),
166168
child: const Icon(FluentIcons.style_guide_20_regular),
167169
// onTap: () => _handleDestinationSelected(PageId.settingsAppearance),
168170
),
169171
NavigationItem(
172+
alignment: Alignment.centerLeft,
170173
selected: _selectedDestination == PageId.settingsKeybinds,
171174
label: Text(t.app.settings.keybinds.title),
172175
child: const Icon(FluentIcons.keyboard_20_regular),
173176
// onTap: () => _handleDestinationSelected(PageId.settingsKeybinds),
174177
),
175178
NavigationItem(
179+
alignment: Alignment.centerLeft,
176180
selected: _selectedDestination == PageId.settingsLanguage,
177181
label: Text(t.app.settings.language.title),
178182
child: const Icon(FluentIcons.local_language_20_regular),
179183
// onTap: () => _handleDestinationSelected(PageId.settingsLanguage),
180184
),
181185
NavigationItem(
186+
alignment: Alignment.centerLeft,
182187
selected: _selectedDestination == PageId.settingsAdvanced,
183188
label: Text(t.app.settings.advanced.title),
184189
child: const Icon(FluentIcons.settings_20_regular),
@@ -191,12 +196,14 @@ class _SettingsLayoutState extends State<SettingsLayout> with WindowListener {
191196
.muted(),
192197
),
193198
NavigationItem(
199+
alignment: Alignment.centerLeft,
194200
selected: _selectedDestination == PageId.settingsOcrEngines,
195201
label: Text(t.app.settings.ocr_engines.title),
196202
child: const Icon(FluentIcons.scan_20_regular),
197203
// onTap: () => _handleDestinationSelected(PageId.settingsOcrEngines),
198204
),
199205
NavigationItem(
206+
alignment: Alignment.centerLeft,
200207
selected: _selectedDestination == PageId.settingsTranslationEngines,
201208
label: Text(
202209
t.app.settings.translation_engines.title,
@@ -213,6 +220,7 @@ class _SettingsLayoutState extends State<SettingsLayout> with WindowListener {
213220
.muted(),
214221
),
215222
NavigationItem(
223+
alignment: Alignment.centerLeft,
216224
selected: _selectedDestination == PageId.settingsAbout,
217225
label: Text(t.app.settings.about.title),
218226
child: const Icon(FluentIcons.info_20_regular),

packages/uikit/lib/src/banner.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ class _BannerState extends State<Banner> {
4747
foregroundDecoration: BoxDecoration(
4848
border: Border.all(),
4949
),
50-
decoration: BoxDecoration(),
50+
decoration: const BoxDecoration(
51+
color: Colors.orange,
52+
),
5153
child: GappedRow(
5254
gap: 8,
5355
crossAxisAlignment: CrossAxisAlignment.start,

packages/uikit/lib/src/preference_list_item.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'package:flutter/cupertino.dart';
1+
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
22
import 'package:shadcn_flutter/shadcn_flutter.dart';
33

44
class PreferenceListItem extends StatelessWidget {
@@ -110,7 +110,7 @@ class RadioListTile<T> extends StatelessWidget {
110110
},
111111
additionalInfo: useCheckmarkStyle
112112
? isChecked
113-
? const Icon(Icons.check_circle)
113+
? const Icon(FluentIcons.checkmark_circle_20_filled)
114114
: null
115115
: Radio(value: isChecked),
116116
);
@@ -167,7 +167,7 @@ class ListTileChevron extends StatelessWidget {
167167
Widget build(BuildContext context) {
168168
final themeData = Theme.of(context);
169169
return Icon(
170-
CupertinoIcons.chevron_right,
170+
FluentIcons.chevron_right_20_regular,
171171
size: 18.0,
172172
color: themeData.colorScheme.border,
173173
);

packages/uikit/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ environment:
77
sdk: ">=3.8.0 <4.0.0"
88

99
dependencies:
10+
fluentui_system_icons: ^1.1.255
1011
flutter:
1112
sdk: flutter
1213
gap: ^3.0.1

0 commit comments

Comments
 (0)