fix(flutter): respect fixed remote canvas margin

This commit is contained in:
Galygious 2026-03-16 06:31:44 -05:00
parent 83241e97ff
commit 43f70329cb

View file

@ -1126,6 +1126,8 @@ class _DisplayMenuState extends State<_DisplayMenu> {
final groupValue = data['scrollStyle'] as String;
final edgeScrollEdgeThickness = data['edgeScrollEdgeThickness'] as int;
final remoteCanvasMargin = data['remoteCanvasMargin'] as double;
final isRemoteCanvasMarginFixed =
isOptionFixed(kOptionRemoteCanvasMargin);
onChangeScrollStyle(String? value) async {
if (value == null) return;
@ -1145,7 +1147,7 @@ class _DisplayMenuState extends State<_DisplayMenu> {
}
onChangeRemoteCanvasMargin(double? value) async {
if (value == null) return;
if (value == null || isRemoteCanvasMarginFixed) return;
await bind.mainSetUserDefaultOption(
key: kOptionRemoteCanvasMargin, value: value.round().toString());
await widget.ffi.canvasModel.updateViewStyle();
@ -1203,7 +1205,9 @@ class _DisplayMenuState extends State<_DisplayMenu> {
value: remoteCanvasMargin,
min: 0,
max: 400,
onChanged: onChangeRemoteCanvasMargin,
onChanged: isRemoteCanvasMarginFixed
? null
: onChangeRemoteCanvasMargin,
colorScheme: colorScheme,
),
),