mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-27 23:19:02 +08:00
spelling: chosen
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
parent
c40ae690e3
commit
380a1670f0
@ -6,7 +6,7 @@ import 'package:flutter_hbb/models/platform_model.dart';
|
||||
|
||||
import '../../common.dart';
|
||||
|
||||
typedef KBChoosedCallback = Future<bool> Function(String);
|
||||
typedef KBChosenCallback = Future<bool> Function(String);
|
||||
|
||||
const double _kImageMarginVertical = 6.0;
|
||||
const double _kImageMarginHorizontal = 10.0;
|
||||
@ -25,12 +25,12 @@ const _kKBLayoutImageMap = {
|
||||
class _KBImage extends StatelessWidget {
|
||||
final String kbLayoutType;
|
||||
final double imageWidth;
|
||||
final RxString choosedType;
|
||||
final RxString chosenType;
|
||||
const _KBImage({
|
||||
Key? key,
|
||||
required this.kbLayoutType,
|
||||
required this.imageWidth,
|
||||
required this.choosedType,
|
||||
required this.chosenType,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@ -40,7 +40,7 @@ class _KBImage extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(_kBorderRadius),
|
||||
border: Border.all(
|
||||
color: choosedType.value == kbLayoutType
|
||||
color: chosenType.value == kbLayoutType
|
||||
? _kImageBorderColor
|
||||
: Colors.transparent,
|
||||
width: _kImageBoarderWidth,
|
||||
@ -66,13 +66,13 @@ class _KBImage extends StatelessWidget {
|
||||
class _KBChooser extends StatelessWidget {
|
||||
final String kbLayoutType;
|
||||
final double imageWidth;
|
||||
final RxString choosedType;
|
||||
final KBChoosedCallback cb;
|
||||
final RxString chosenType;
|
||||
final KBChosenCallback cb;
|
||||
const _KBChooser({
|
||||
Key? key,
|
||||
required this.kbLayoutType,
|
||||
required this.imageWidth,
|
||||
required this.choosedType,
|
||||
required this.chosenType,
|
||||
required this.cb,
|
||||
}) : super(key: key);
|
||||
|
||||
@ -81,7 +81,7 @@ class _KBChooser extends StatelessWidget {
|
||||
onChanged(String? v) async {
|
||||
if (v != null) {
|
||||
if (await cb(v)) {
|
||||
choosedType.value = v;
|
||||
chosenType.value = v;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -95,7 +95,7 @@ class _KBChooser extends StatelessWidget {
|
||||
child: _KBImage(
|
||||
kbLayoutType: kbLayoutType,
|
||||
imageWidth: imageWidth,
|
||||
choosedType: choosedType,
|
||||
chosenType: chosenType,
|
||||
),
|
||||
style: TextButton.styleFrom(padding: EdgeInsets.zero),
|
||||
),
|
||||
@ -105,7 +105,7 @@ class _KBChooser extends StatelessWidget {
|
||||
Obx(() => Radio(
|
||||
splashRadius: 0,
|
||||
value: kbLayoutType,
|
||||
groupValue: choosedType.value,
|
||||
groupValue: chosenType.value,
|
||||
onChanged: onChanged,
|
||||
)),
|
||||
Text(kbLayoutType),
|
||||
@ -121,14 +121,14 @@ class _KBChooser extends StatelessWidget {
|
||||
}
|
||||
|
||||
class KBLayoutTypeChooser extends StatelessWidget {
|
||||
final RxString choosedType;
|
||||
final RxString chosenType;
|
||||
final double width;
|
||||
final double height;
|
||||
final double dividerWidth;
|
||||
final KBChoosedCallback cb;
|
||||
final KBChosenCallback cb;
|
||||
KBLayoutTypeChooser({
|
||||
Key? key,
|
||||
required this.choosedType,
|
||||
required this.chosenType,
|
||||
required this.width,
|
||||
required this.height,
|
||||
required this.dividerWidth,
|
||||
@ -147,7 +147,7 @@ class KBLayoutTypeChooser extends StatelessWidget {
|
||||
_KBChooser(
|
||||
kbLayoutType: _kKBLayoutTypeISO,
|
||||
imageWidth: imageWidth,
|
||||
choosedType: choosedType,
|
||||
chosenType: chosenType,
|
||||
cb: cb,
|
||||
),
|
||||
VerticalDivider(
|
||||
@ -156,7 +156,7 @@ class KBLayoutTypeChooser extends StatelessWidget {
|
||||
_KBChooser(
|
||||
kbLayoutType: _kKBLayoutTypeNotISO,
|
||||
imageWidth: imageWidth,
|
||||
choosedType: choosedType,
|
||||
chosenType: chosenType,
|
||||
cb: cb,
|
||||
),
|
||||
],
|
||||
@ -208,7 +208,7 @@ showKBLayoutTypeChooser(
|
||||
title:
|
||||
Text('${translate('Select local keyboard type')} ($localPlatform)'),
|
||||
content: KBLayoutTypeChooser(
|
||||
choosedType: KBLayoutType,
|
||||
chosenType: KBLayoutType,
|
||||
width: 360,
|
||||
height: 200,
|
||||
dividerWidth: 4.0,
|
||||
|
Loading…
Reference in New Issue
Block a user