Merge pull request #1294 from 21pages/setting

optimize settings ui
This commit is contained in:
RustDesk
2022-08-17 15:37:30 +08:00
committed by GitHub
6 changed files with 651 additions and 308 deletions

View File

@@ -528,14 +528,14 @@ String translate(String name) {
return platformFFI.translate(name, localeName);
}
bool option2bool(String key, String value) {
bool option2bool(String option, String value) {
bool res;
if (key.startsWith("enable-")) {
if (option.startsWith("enable-")) {
res = value != "N";
} else if (key.startsWith("allow-") ||
key == "stop-service" ||
key == "direct-server" ||
key == "stop-rendezvous-service") {
} else if (option.startsWith("allow-") ||
option == "stop-service" ||
option == "direct-server" ||
option == "stop-rendezvous-service") {
res = value == "Y";
} else {
assert(false);
@@ -544,18 +544,18 @@ bool option2bool(String key, String value) {
return res;
}
String bool2option(String key, bool option) {
String bool2option(String option, bool b) {
String res;
if (key.startsWith('enable-')) {
res = option ? '' : 'N';
} else if (key.startsWith('allow-') ||
key == "stop-service" ||
key == "direct-server" ||
key == "stop-rendezvous-service") {
res = option ? 'Y' : '';
if (option.startsWith('enable-')) {
res = b ? '' : 'N';
} else if (option.startsWith('allow-') ||
option == "stop-service" ||
option == "direct-server" ||
option == "stop-rendezvous-service") {
res = b ? 'Y' : '';
} else {
assert(false);
res = option ? 'Y' : 'N';
res = b ? 'Y' : 'N';
}
return res;
}

File diff suppressed because it is too large Load Diff

View File

@@ -83,7 +83,7 @@ class DesktopTabBar extends StatelessWidget {
labelPadding: const EdgeInsets.symmetric(
vertical: 0, horizontal: 0),
isScrollable: true,
indicatorPadding: EdgeInsets.only(bottom: 2),
indicatorPadding: EdgeInsets.zero,
physics: BouncingScrollPhysics(),
controller: controller.value,
tabs: tabs.asMap().entries.map((e) {