fix: LocalizationUIModel _cfgFile dir

This commit is contained in:
2024-03-30 15:07:32 +08:00
parent 4d2c0c20d5
commit bb48504016
3 changed files with 27 additions and 10 deletions

View File

@ -149,24 +149,31 @@ class HomeUI extends HookConsumerWidget {
onPressed: homeState.webLocalizationVersionsData == null
? null
: () => model.launchRSI(context),
style: homeState.isCurGameRunning
? null
: ButtonStyle(
backgroundColor:
ButtonState.resolveWith(_getRunButtonColor),
),
child: Padding(
padding: const EdgeInsets.all(6),
child: Icon(
homeState.isCurGameRunning
? FluentIcons.stop_solid
: FluentIcons.play,
: FluentIcons.play_solid,
color: homeState.isCurGameRunning
? Colors.red.withOpacity(.8)
: null,
: Colors.white,
),
)),
const SizedBox(width: 12),
Button(
onPressed: () =>
SystemHelper.openDir("\"${homeState.scInstalledPath}\""),
child: const Padding(
padding: EdgeInsets.all(6),
child: Icon(FluentIcons.folder_open),
),
onPressed: () => SystemHelper.openDir(homeState.scInstalledPath),
),
const SizedBox(width: 12),
Button(
@ -801,6 +808,16 @@ class HomeUI extends HookConsumerWidget {
context.push("/index/$key");
}
}
Color? _getRunButtonColor(Set<ButtonStates> states) {
if (states.isPressing) {
return const Color.fromRGBO(49, 227, 88, .5);
}
if (states.isHovering) {
return const Color.fromRGBO(47, 213, 84, 1.0);
}
return const Color.fromRGBO(49, 227, 88, .8);
}
}
class _HomeItemData {