chans theme desktop selector fix and padding fixes

This commit is contained in:
julian 2023-03-17 13:12:09 -06:00
parent 968b93a41c
commit 3963f29318
2 changed files with 93 additions and 180 deletions
assets/svg
lib/pages_desktop_specific/settings/settings_menu

File diff suppressed because one or more lines are too long

Before

(image error) Size: 249 KiB

After

(image error) Size: 216 KiB

View file

@ -136,7 +136,7 @@ class _AppearanceOptionSettings
),
),
const Padding(
padding: EdgeInsets.all(10),
padding: EdgeInsets.all(2),
child: ThemeToggle(),
),
],
@ -186,100 +186,95 @@ class _ThemeToggle extends ConsumerState<ThemeToggle> {
runSpacing: 16,
children: [
for (int i = 0; i < ThemeType.values.length; i++)
Row(
mainAxisSize: MainAxisSize.min,
children: [
if (i > 0)
const SizedBox(
width: 10,
),
MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
if (ref.read(colorThemeProvider.state).state.themeType !=
ThemeType.values[i]) {
DB.instance.put<dynamic>(
boxName: DB.boxNameTheme,
key: "colorScheme",
value: ThemeType.values[i].name,
);
ref.read(colorThemeProvider.state).state =
StackColors.fromStackColorTheme(
ThemeType.values[i].colorTheme);
}
},
child: Container(
width: 200,
color: Colors.transparent,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
decoration: BoxDecoration(
border: Border.all(
width: 2.5,
color: ref
.read(colorThemeProvider.state)
.state
.themeType ==
ThemeType.values[i]
? Theme.of(context)
.extension<StackColors>()!
.infoItemIcons
: Theme.of(context)
.extension<StackColors>()!
.popupBG,
),
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: MouseRegion(
cursor: SystemMouseCursors.click,
child: GestureDetector(
onTap: () {
if (ref.read(colorThemeProvider.state).state.themeType !=
ThemeType.values[i]) {
DB.instance.put<dynamic>(
boxName: DB.boxNameTheme,
key: "colorScheme",
value: ThemeType.values[i].name,
);
ref.read(colorThemeProvider.state).state =
StackColors.fromStackColorTheme(
ThemeType.values[i].colorTheme);
}
},
child: Container(
width: 200,
color: Colors.transparent,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
decoration: BoxDecoration(
border: Border.all(
width: 2.5,
color: ref
.read(colorThemeProvider.state)
.state
.themeType ==
ThemeType.values[i]
? Theme.of(context)
.extension<StackColors>()!
.infoItemIcons
: Theme.of(context)
.extension<StackColors>()!
.popupBG,
),
child: SvgPicture.asset(
assetNameFor(ThemeType.values[i]),
borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius,
),
),
const SizedBox(
height: 12,
child: SvgPicture.asset(
assetNameFor(ThemeType.values[i]),
height: 160,
),
Row(
children: [
SizedBox(
width: 20,
height: 20,
child: Radio<ThemeType>(
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: ThemeType.values[i],
groupValue: ref
.read(colorThemeProvider.state)
.state
.themeType,
onChanged: (_) {},
),
),
const SizedBox(
height: 12,
),
Row(
children: [
SizedBox(
width: 20,
height: 20,
child: Radio<ThemeType>(
activeColor: Theme.of(context)
.extension<StackColors>()!
.radioButtonIconEnabled,
value: ThemeType.values[i],
groupValue: ref
.read(colorThemeProvider.state)
.state
.themeType,
onChanged: (_) {},
),
const SizedBox(
width: 14,
),
const SizedBox(
width: 14,
),
Text(
ThemeType.values[i].prettyName,
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
Text(
ThemeType.values[i].prettyName,
style: STextStyles.desktopTextExtraSmall(context)
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.textDark,
),
),
],
),
],
),
),
],
),
],
),
),
)
],
),
),
),
)
],
);
}