Skip to content

Commit

Permalink
ui: 主题色重置按钮放在颜色块左侧
Browse files Browse the repository at this point in the history
  • Loading branch information
linyi102 committed Nov 3, 2024
1 parent 6e23266 commit e892379
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions lib/pages/settings/theme_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,25 @@ class _ThemePageState extends State<ThemePage> {
children: [
SettingCard(
title: '主题',
trailing: TextButton(
onPressed: () {
themeController.resetCustomPrimaryColor();
},
child: const Text('重置')),
children: [
ListTile(
title: const Text('选择主题色'),
trailing: _buildColorIndicator(),
title: const Row(
mainAxisSize: MainAxisSize.min,
children: [
Text('选择主题色'),
SizedBox(width: 8),
],
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
TextButton(
onPressed: themeController.resetCustomPrimaryColor,
child: const Text('重置'),
),
_buildColorIndicator(),
],
),
onTap: _showColorPicker,
),
if (!Responsive.isMobile(context)) ...[
Expand Down Expand Up @@ -162,8 +172,8 @@ class _ThemePageState extends State<ThemePage> {

Widget _buildColorIndicator() {
return Obx(() => ColorIndicator(
width: 32,
height: 32,
width: 24,
height: 24,
borderRadius: 99,
color: _getCurPrimaryColor(),
elevation: 1,
Expand Down

0 comments on commit e892379

Please sign in to comment.