mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-29 16:49:10 +08:00
dark theme install page
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
6048efe02b
commit
6971f45fd0
@ -46,15 +46,19 @@ class _InstallPageState extends State<InstallPage> with WindowListener {
|
|||||||
final double em = 13;
|
final double em = 13;
|
||||||
final btnFontSize = 0.9 * em;
|
final btnFontSize = 0.9 * em;
|
||||||
final double button_radius = 6;
|
final double button_radius = 6;
|
||||||
|
final isDarkTheme = MyTheme.currentThemeMode() == ThemeMode.dark;
|
||||||
final buttonStyle = OutlinedButton.styleFrom(
|
final buttonStyle = OutlinedButton.styleFrom(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(button_radius)),
|
borderRadius: BorderRadius.all(Radius.circular(button_radius)),
|
||||||
));
|
));
|
||||||
final inputBorder = OutlineInputBorder(
|
final inputBorder = OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.zero,
|
borderRadius: BorderRadius.zero,
|
||||||
borderSide: BorderSide(color: Colors.black12));
|
borderSide:
|
||||||
|
BorderSide(color: isDarkTheme ? Colors.white70 : Colors.black12));
|
||||||
|
final textColor = isDarkTheme ? null : Colors.black87;
|
||||||
|
final dividerColor = isDarkTheme ? Colors.white70 : Colors.black87;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: null,
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@ -91,8 +95,7 @@ class _InstallPageState extends State<InstallPage> with WindowListener {
|
|||||||
style: buttonStyle,
|
style: buttonStyle,
|
||||||
child: Text(translate('Change Path'),
|
child: Text(translate('Change Path'),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black87,
|
color: textColor, fontSize: btnFontSize)))
|
||||||
fontSize: btnFontSize)))
|
|
||||||
.marginOnly(left: em))
|
.marginOnly(left: em))
|
||||||
],
|
],
|
||||||
).marginSymmetric(vertical: 2 * em),
|
).marginSymmetric(vertical: 2 * em),
|
||||||
@ -127,8 +130,7 @@ class _InstallPageState extends State<InstallPage> with WindowListener {
|
|||||||
)).marginOnly(top: 2 * em),
|
)).marginOnly(top: 2 * em),
|
||||||
Row(children: [Text(translate('agreement_tip'))])
|
Row(children: [Text(translate('agreement_tip'))])
|
||||||
.marginOnly(top: em),
|
.marginOnly(top: em),
|
||||||
Divider(color: Colors.black87)
|
Divider(color: dividerColor).marginSymmetric(vertical: 0.5 * em),
|
||||||
.marginSymmetric(vertical: 0.5 * em),
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -143,8 +145,7 @@ class _InstallPageState extends State<InstallPage> with WindowListener {
|
|||||||
style: buttonStyle,
|
style: buttonStyle,
|
||||||
child: Text(translate('Cancel'),
|
child: Text(translate('Cancel'),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black87,
|
color: textColor, fontSize: btnFontSize)))
|
||||||
fontSize: btnFontSize)))
|
|
||||||
.marginOnly(right: 2 * em)),
|
.marginOnly(right: 2 * em)),
|
||||||
Obx(() => ElevatedButton(
|
Obx(() => ElevatedButton(
|
||||||
onPressed: btnEnabled.value ? install : null,
|
onPressed: btnEnabled.value ? install : null,
|
||||||
@ -167,8 +168,7 @@ class _InstallPageState extends State<InstallPage> with WindowListener {
|
|||||||
style: buttonStyle,
|
style: buttonStyle,
|
||||||
child: Text(translate('Run without install'),
|
child: Text(translate('Run without install'),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.black87,
|
color: textColor, fontSize: btnFontSize)))
|
||||||
fontSize: btnFontSize)))
|
|
||||||
.marginOnly(left: 2 * em)),
|
.marginOnly(left: 2 * em)),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -291,7 +291,7 @@ void _runApp(
|
|||||||
void runInstallPage() async {
|
void runInstallPage() async {
|
||||||
await windowManager.ensureInitialized();
|
await windowManager.ensureInitialized();
|
||||||
await initEnv(kAppTypeMain);
|
await initEnv(kAppTypeMain);
|
||||||
_runApp('', const InstallPage(), ThemeMode.light);
|
_runApp('', const InstallPage(), MyTheme.currentThemeMode());
|
||||||
windowManager.waitUntilReadyToShow(
|
windowManager.waitUntilReadyToShow(
|
||||||
WindowOptions(size: Size(800, 600), center: true), () async {
|
WindowOptions(size: Size(800, 600), center: true), () async {
|
||||||
windowManager.show();
|
windowManager.show();
|
||||||
|
Loading…
Reference in New Issue
Block a user