do not show scroll options when scale adaptive

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2022-11-26 10:46:57 +08:00
parent e8a836e449
commit 56ee947e2c

View File

@ -751,31 +751,6 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
dismissOnClicked: true,
),
MenuEntryDivider<String>(),
MenuEntryRadios<String>(
text: translate('Scroll Style'),
optionsGetter: () => [
MenuEntryRadioOption(
text: translate('ScrollAuto'),
value: kRemoteScrollStyleAuto,
dismissOnClicked: true,
),
MenuEntryRadioOption(
text: translate('Scrollbar'),
value: kRemoteScrollStyleBar,
dismissOnClicked: true,
),
],
curOptionGetter: () async =>
// null means peer id is not found, which there's no need to care about
await bind.sessionGetScrollStyle(id: widget.id) ?? '',
optionSetter: (String oldValue, String newValue) async {
await bind.sessionSetScrollStyle(id: widget.id, value: newValue);
widget.ffi.canvasModel.updateScrollStyle();
},
padding: padding,
dismissOnClicked: true,
),
MenuEntryDivider<String>(),
MenuEntryRadios<String>(
text: translate('Image Quality'),
optionsGetter: () => [
@ -955,6 +930,36 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
MenuEntryDivider<String>(),
];
if (widget.state.viewStyle.value == kRemoteViewStyleOriginal) {
displayMenu.insert(
2,
MenuEntryRadios<String>(
text: translate('Scroll Style'),
optionsGetter: () => [
MenuEntryRadioOption(
text: translate('ScrollAuto'),
value: kRemoteScrollStyleAuto,
dismissOnClicked: true,
),
MenuEntryRadioOption(
text: translate('Scrollbar'),
value: kRemoteScrollStyleBar,
dismissOnClicked: true,
),
],
curOptionGetter: () async =>
// null means peer id is not found, which there's no need to care about
await bind.sessionGetScrollStyle(id: widget.id) ?? '',
optionSetter: (String oldValue, String newValue) async {
await bind.sessionSetScrollStyle(id: widget.id, value: newValue);
widget.ffi.canvasModel.updateScrollStyle();
},
padding: padding,
dismissOnClicked: true,
));
displayMenu.insert(3, MenuEntryDivider<String>());
}
if (_isWindowCanBeAdjusted(remoteCount)) {
displayMenu.insert(
0,