mobile add new input map mode radio
This commit is contained in:
		
							parent
							
								
									77fcf2d4fa
								
							
						
					
					
						commit
						6b664d0965
					
				| @ -817,8 +817,10 @@ class PermissionManager { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| RadioListTile<T> getRadio<T>( | RadioListTile<T> getRadio<T>( | ||||||
|     String name, T toValue, T curValue, void Function(T?) onChange) { |     String name, T toValue, T curValue, void Function(T?) onChange, | ||||||
|  |     {EdgeInsetsGeometry? contentPadding}) { | ||||||
|   return RadioListTile<T>( |   return RadioListTile<T>( | ||||||
|  |     contentPadding: contentPadding, | ||||||
|     controlAffinity: ListTileControlAffinity.trailing, |     controlAffinity: ListTileControlAffinity.trailing, | ||||||
|     title: Text(translate(name)), |     title: Text(translate(name)), | ||||||
|     value: toValue, |     value: toValue, | ||||||
|  | |||||||
| @ -584,6 +584,9 @@ class _RemotePageState extends State<RemotePage> { | |||||||
|           child: Text(translate('Reset canvas')), value: 'reset_canvas')); |           child: Text(translate('Reset canvas')), value: 'reset_canvas')); | ||||||
|     } |     } | ||||||
|     if (perms['keyboard'] != false) { |     if (perms['keyboard'] != false) { | ||||||
|  |       more.add(PopupMenuItem<String>( | ||||||
|  |           child: Text(translate('Physical Keyboard Input Mode')), | ||||||
|  |           value: 'input-mode')); | ||||||
|       if (pi.platform == 'Linux' || pi.sasEnabled) { |       if (pi.platform == 'Linux' || pi.sasEnabled) { | ||||||
|         more.add(PopupMenuItem<String>( |         more.add(PopupMenuItem<String>( | ||||||
|             child: Text('${translate('Insert')} Ctrl + Alt + Del'), |             child: Text('${translate('Insert')} Ctrl + Alt + Del'), | ||||||
| @ -616,6 +619,8 @@ class _RemotePageState extends State<RemotePage> { | |||||||
|       ); |       ); | ||||||
|       if (value == 'cad') { |       if (value == 'cad') { | ||||||
|         bind.sessionCtrlAltDel(id: widget.id); |         bind.sessionCtrlAltDel(id: widget.id); | ||||||
|  |       } else if (value == 'input-mode') { | ||||||
|  |         changePhysicalKeyboardInputMode(); | ||||||
|       } else if (value == 'lock') { |       } else if (value == 'lock') { | ||||||
|         bind.sessionLockScreen(id: widget.id); |         bind.sessionLockScreen(id: widget.id); | ||||||
|       } else if (value == 'block-input') { |       } else if (value == 'block-input') { | ||||||
| @ -675,6 +680,26 @@ class _RemotePageState extends State<RemotePage> { | |||||||
|             })); |             })); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |   void changePhysicalKeyboardInputMode() async { | ||||||
|  |     var current = await bind.sessionGetKeyboardName(id: widget.id); | ||||||
|  |     gFFI.dialogManager.show((setState, close) { | ||||||
|  |       void setMode(String? v) async { | ||||||
|  |         await bind.sessionSetKeyboardMode(id: widget.id, keyboardMode: v ?? ''); | ||||||
|  |         setState(() => current = v ?? ''); | ||||||
|  |         Future.delayed(Duration(milliseconds: 300), close); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       return CustomAlertDialog( | ||||||
|  |           title: Text(translate('Physical Keyboard Input Mode')), | ||||||
|  |           content: Column(mainAxisSize: MainAxisSize.min, children: [ | ||||||
|  |             getRadio('Legacy mode', 'legacy', current, setMode, | ||||||
|  |                 contentPadding: EdgeInsets.zero), | ||||||
|  |             getRadio('Map mode', 'map', current, setMode, | ||||||
|  |                 contentPadding: EdgeInsets.zero), | ||||||
|  |           ])); | ||||||
|  |     }, clickMaskDismiss: true); | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|   Widget getHelpTools() { |   Widget getHelpTools() { | ||||||
|     final keyboard = isKeyboardShown(); |     final keyboard = isKeyboardShown(); | ||||||
|     if (!keyboard) { |     if (!keyboard) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user