mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -218,27 +218,25 @@ class _UserInterfaceState extends State<_UserInterface>
|
||||
onChanged: (key) async {
|
||||
await bind.mainSetLocalOption(key: "lang", value: key);
|
||||
Get.forceAppUpdate();
|
||||
bind.mainChangeLanguage(lang: key);
|
||||
},
|
||||
).marginOnly(left: _kContentHMargin);
|
||||
});
|
||||
}
|
||||
|
||||
Widget theme() {
|
||||
var change = () {
|
||||
bool dark = !isDarkTheme();
|
||||
Get.changeTheme(dark ? MyTheme.darkTheme : MyTheme.lightTheme);
|
||||
Get.find<SharedPreferences>().setString("darkTheme", dark ? "Y" : "");
|
||||
Get.forceAppUpdate();
|
||||
};
|
||||
change() {
|
||||
MyTheme.changeTo(!isDarkTheme());
|
||||
}
|
||||
|
||||
return GestureDetector(
|
||||
onTap: change,
|
||||
child: Row(
|
||||
children: [
|
||||
Checkbox(value: isDarkTheme(), onChanged: (_) => change()),
|
||||
Expanded(child: Text(translate('Dark Theme'))),
|
||||
],
|
||||
).marginOnly(left: _kCheckBoxLeftMargin),
|
||||
onTap: change,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ class _DesktopTabPageState extends State<DesktopTabPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final dark = isDarkTheme();
|
||||
RxBool fullscreen = false.obs;
|
||||
Get.put(fullscreen, tag: 'fullscreen');
|
||||
return Obx(() => DragToResizeArea(
|
||||
|
||||
@@ -70,45 +70,38 @@ class _PortForwardPageState extends State<PortForwardPage>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Overlay(initialEntries: [
|
||||
OverlayEntry(builder: (context) {
|
||||
_ffi.dialogManager.setOverlayState(Overlay.of(context));
|
||||
return Scaffold(
|
||||
backgroundColor: MyTheme.color(context).grayBg,
|
||||
body: FutureBuilder(future: () async {
|
||||
if (!isRdp) {
|
||||
refreshTunnelConfig();
|
||||
}
|
||||
}(), builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 20, color: MyTheme.color(context).grayBg!)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
buildPrompt(context),
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MyTheme.color(context).bg,
|
||||
border:
|
||||
Border.all(width: 1, color: MyTheme.border)),
|
||||
child: widget.isRDP
|
||||
? buildRdp(context)
|
||||
: buildTunnel(context),
|
||||
),
|
||||
),
|
||||
],
|
||||
return Scaffold(
|
||||
backgroundColor: MyTheme.color(context).grayBg,
|
||||
body: FutureBuilder(future: () async {
|
||||
if (!isRdp) {
|
||||
refreshTunnelConfig();
|
||||
}
|
||||
}(), builder: (context, snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 20, color: MyTheme.color(context).grayBg!)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
buildPrompt(context),
|
||||
Flexible(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: MyTheme.color(context).bg,
|
||||
border: Border.all(width: 1, color: MyTheme.border)),
|
||||
child:
|
||||
widget.isRDP ? buildRdp(context) : buildTunnel(context),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
return const Offstage();
|
||||
}),
|
||||
);
|
||||
})
|
||||
]);
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
return const Offstage();
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
buildPrompt(BuildContext context) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/consts.dart';
|
||||
import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart';
|
||||
import 'package:flutter_hbb/mobile/pages/chat_page.dart';
|
||||
import 'package:flutter_hbb/models/chat_model.dart';
|
||||
@@ -63,20 +64,15 @@ class _DesktopServerPageState extends State<DesktopServerPage>
|
||||
border: Border.all(color: MyTheme.color(context).border!)),
|
||||
child: Scaffold(
|
||||
backgroundColor: MyTheme.color(context).bg,
|
||||
body: Overlay(initialEntries: [
|
||||
OverlayEntry(builder: (context) {
|
||||
gFFI.dialogManager.setOverlayState(Overlay.of(context));
|
||||
return Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(child: ConnectionManager()),
|
||||
SizedBox.fromSize(size: Size(0, 15.0)),
|
||||
],
|
||||
),
|
||||
);
|
||||
})
|
||||
]),
|
||||
body: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(child: ConnectionManager()),
|
||||
SizedBox.fromSize(size: Size(0, 15.0)),
|
||||
],
|
||||
),
|
||||
),
|
||||
))));
|
||||
}
|
||||
|
||||
@@ -111,7 +107,7 @@ class ConnectionManagerState extends State<ConnectionManager> {
|
||||
return serverModel.clients.isEmpty
|
||||
? Column(
|
||||
children: [
|
||||
buildTitleBar(Offstage()),
|
||||
buildTitleBar(),
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Text(translate("Waiting")),
|
||||
@@ -134,20 +130,27 @@ class ConnectionManagerState extends State<ConnectionManager> {
|
||||
]));
|
||||
}
|
||||
|
||||
Widget buildTitleBar(Widget middle) {
|
||||
return GestureDetector(
|
||||
onPanDown: (d) {
|
||||
windowManager.startDragging();
|
||||
},
|
||||
Widget buildTitleBar() {
|
||||
return SizedBox(
|
||||
height: kDesktopRemoteTabBarHeight,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
_AppIcon(),
|
||||
Expanded(child: middle),
|
||||
const _AppIcon(),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onPanStart: (d) {
|
||||
windowManager.startDragging();
|
||||
},
|
||||
child: Container(
|
||||
color: MyTheme.color(context).bg,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 4.0,
|
||||
),
|
||||
_CloseButton()
|
||||
const _CloseButton()
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -209,15 +212,16 @@ class _CloseButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Ink(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
windowManager.close();
|
||||
},
|
||||
child: Icon(
|
||||
Icons.close,
|
||||
size: 30,
|
||||
)),
|
||||
return IconButton(
|
||||
onPressed: () {
|
||||
windowManager.close();
|
||||
},
|
||||
icon: const Icon(
|
||||
IconFont.close,
|
||||
size: 18,
|
||||
),
|
||||
splashColor: Colors.transparent,
|
||||
hoverColor: Colors.transparent,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user