custom android
This commit is contained in:
parent
990c05fc3d
commit
bdf8bbe26f
@ -3106,6 +3106,27 @@ Color? disabledTextColor(BuildContext context, bool enabled) {
|
|||||||
: Theme.of(context).textTheme.titleLarge?.color?.withOpacity(0.6);
|
: Theme.of(context).textTheme.titleLarge?.color?.withOpacity(0.6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget loadPowered(BuildContext context) {
|
||||||
|
return MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
launchUrl(Uri.parse('https://rustdesk.com'));
|
||||||
|
},
|
||||||
|
child: Opacity(
|
||||||
|
opacity: 0.5,
|
||||||
|
child: Text(
|
||||||
|
translate("powered_by_me"),
|
||||||
|
overflow: TextOverflow.clip,
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.bodySmall
|
||||||
|
?.copyWith(fontSize: 9, decoration: TextDecoration.underline),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
).marginOnly(top: 6);
|
||||||
|
}
|
||||||
|
|
||||||
// max 300 x 60
|
// max 300 x 60
|
||||||
Widget loadLogo() {
|
Widget loadLogo() {
|
||||||
return FutureBuilder<ByteData>(
|
return FutureBuilder<ByteData>(
|
||||||
|
@ -115,22 +115,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
|
|||||||
if (bind.isCustomClient())
|
if (bind.isCustomClient())
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: MouseRegion(
|
child: loadPowered(context),
|
||||||
cursor: SystemMouseCursors.click,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
launchUrl(Uri.parse('https://rustdesk.com'));
|
|
||||||
},
|
|
||||||
child: Opacity(
|
|
||||||
opacity: 0.5,
|
|
||||||
child: Text(
|
|
||||||
translate("powered_by_me"),
|
|
||||||
overflow: TextOverflow.clip,
|
|
||||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
|
||||||
fontSize: 9, decoration: TextDecoration.underline),
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
).marginOnly(top: 6),
|
|
||||||
),
|
),
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
|
@ -45,7 +45,7 @@ class HomePageState extends State<HomePage> {
|
|||||||
void initPages() {
|
void initPages() {
|
||||||
_pages.clear();
|
_pages.clear();
|
||||||
if (!bind.isIncomingOnly()) _pages.add(ConnectionPage());
|
if (!bind.isIncomingOnly()) _pages.add(ConnectionPage());
|
||||||
if (isAndroid) {
|
if (isAndroid && !bind.isOutgoingOnly()) {
|
||||||
_pages.addAll([ChatPage(type: ChatPageType.mobileMain), ServerPage()]);
|
_pages.addAll([ChatPage(type: ChatPageType.mobileMain), ServerPage()]);
|
||||||
}
|
}
|
||||||
_pages.add(SettingsPage());
|
_pages.add(SettingsPage());
|
||||||
|
@ -27,7 +27,7 @@ class SettingsPage extends StatefulWidget implements PageShape {
|
|||||||
final icon = Icon(Icons.settings);
|
final icon = Icon(Icons.settings);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
final appBarActions = [ScanButton()];
|
final appBarActions = bind.isDisableSettings() ? [] : [ScanButton()];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<SettingsPage> createState() => _SettingsState();
|
State<SettingsPage> createState() => _SettingsState();
|
||||||
@ -218,6 +218,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Provider.of<FfiModel>(context);
|
Provider.of<FfiModel>(context);
|
||||||
|
final outgoingOnly = bind.isOutgoingOnly();
|
||||||
final List<AbstractSettingsTile> enhancementsTiles = [];
|
final List<AbstractSettingsTile> enhancementsTiles = [];
|
||||||
final List<AbstractSettingsTile> shareScreenTiles = [
|
final List<AbstractSettingsTile> shareScreenTiles = [
|
||||||
SettingsTile.switchTile(
|
SettingsTile.switchTile(
|
||||||
@ -448,8 +449,10 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
gFFI.invokeMethod(AndroidChannel.kSetStartOnBootOpt, toValue);
|
gFFI.invokeMethod(AndroidChannel.kSetStartOnBootOpt, toValue);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return SettingsList(
|
final disabledSettings = bind.isDisableSettings();
|
||||||
|
final settings = SettingsList(
|
||||||
sections: [
|
sections: [
|
||||||
|
if (!bind.isDisableAccount())
|
||||||
SettingsSection(
|
SettingsSection(
|
||||||
title: Text(translate('Account')),
|
title: Text(translate('Account')),
|
||||||
tiles: [
|
tiles: [
|
||||||
@ -469,6 +472,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
SettingsSection(title: Text(translate("Settings")), tiles: [
|
SettingsSection(title: Text(translate("Settings")), tiles: [
|
||||||
|
if (!disabledSettings)
|
||||||
SettingsTile(
|
SettingsTile(
|
||||||
title: Text(translate('ID/Relay Server')),
|
title: Text(translate('ID/Relay Server')),
|
||||||
leading: Icon(Icons.cloud),
|
leading: Icon(Icons.cloud),
|
||||||
@ -494,7 +498,7 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
]),
|
]),
|
||||||
if (isAndroid)
|
if (isAndroid && !outgoingOnly)
|
||||||
SettingsSection(
|
SettingsSection(
|
||||||
title: Text(translate("Recording")),
|
title: Text(translate("Recording")),
|
||||||
tiles: [
|
tiles: [
|
||||||
@ -523,13 +527,13 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (isAndroid)
|
if (isAndroid && !disabledSettings && !outgoingOnly)
|
||||||
SettingsSection(
|
SettingsSection(
|
||||||
title: Text(translate("Share Screen")),
|
title: Text(translate("Share Screen")),
|
||||||
tiles: shareScreenTiles,
|
tiles: shareScreenTiles,
|
||||||
),
|
),
|
||||||
defaultDisplaySection(),
|
if (!bind.isIncomingOnly()) defaultDisplaySection(),
|
||||||
if (isAndroid)
|
if (isAndroid && !disabledSettings && !outgoingOnly)
|
||||||
SettingsSection(
|
SettingsSection(
|
||||||
title: Text(translate("Enhancements")),
|
title: Text(translate("Enhancements")),
|
||||||
tiles: enhancementsTiles,
|
tiles: enhancementsTiles,
|
||||||
@ -578,6 +582,20 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
if (bind.isCustomClient())
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: loadPowered(context),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: loadLogo(),
|
||||||
|
),
|
||||||
|
settings
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> canStartOnBoot() async {
|
Future<bool> canStartOnBoot() async {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user