mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-15 12:35:54 +00:00
flutter_desktop: menu bar, switch menu & shrink-stretch -> adaptive
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -315,29 +315,31 @@ abstract class MenuEntrySwitchBase<T> extends MenuEntryBase<T> {
|
||||
mod_menu.PopupMenuItem(
|
||||
padding: EdgeInsets.zero,
|
||||
height: conf.height,
|
||||
child: Obx(
|
||||
() => SwitchListTile(
|
||||
value: curOption.value,
|
||||
onChanged: (v) {
|
||||
setOption(v);
|
||||
},
|
||||
title: Container(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
constraints: BoxConstraints(minHeight: conf.height),
|
||||
child: Text(
|
||||
child: TextButton(
|
||||
child: Container(
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
height: conf.height,
|
||||
child: Row(children: [
|
||||
// const SizedBox(width: MenuConfig.midPadding),
|
||||
Text(
|
||||
text,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: MenuConfig.fontSize,
|
||||
fontWeight: FontWeight.normal),
|
||||
)),
|
||||
dense: true,
|
||||
visualDensity: const VisualDensity(
|
||||
horizontal: VisualDensity.minimumDensity,
|
||||
vertical: VisualDensity.minimumDensity,
|
||||
),
|
||||
contentPadding: const EdgeInsets.only(left: 8.0),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Obx(() => Switch(
|
||||
value: curOption.value,
|
||||
onChanged: (v) => setOption(v),
|
||||
)),
|
||||
))
|
||||
])),
|
||||
onPressed: () {
|
||||
setOption(!curOption.value);
|
||||
},
|
||||
),
|
||||
)
|
||||
];
|
||||
|
||||
@@ -406,14 +406,13 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
||||
MenuEntryRadios<String>(
|
||||
text: translate('Ratio'),
|
||||
optionsGetter: () => [
|
||||
Tuple2<String, String>(translate('Original'), 'original'),
|
||||
Tuple2<String, String>(translate('Shrink'), 'shrink'),
|
||||
Tuple2<String, String>(translate('Stretch'), 'stretch'),
|
||||
Tuple2<String, String>(translate('Scale original'), 'original'),
|
||||
Tuple2<String, String>(translate('Scale adaptive'), 'adaptive'),
|
||||
],
|
||||
curOptionGetter: () async {
|
||||
return await bind.sessionGetOption(
|
||||
id: widget.id, arg: 'view-style') ??
|
||||
'';
|
||||
'adaptive';
|
||||
},
|
||||
optionSetter: (String v) async {
|
||||
await bind.sessionPeerOption(
|
||||
|
||||
Reference in New Issue
Block a user