Merge pull request #6497 from 21pages/fix_os_password_click
fix mobile os password edit action
This commit is contained in:
		
						commit
						493ec07ff2
					
				| @ -92,18 +92,21 @@ List<TTextMenu> toolbarControls(BuildContext context, String id, FFI ffi) { | ||||
|     TTextMenu( | ||||
|       child: Row(children: [ | ||||
|         Text(translate(pi.isHeadless ? 'OS Account' : 'OS Password')), | ||||
|         Offstage( | ||||
|           offstage: isDesktop, | ||||
|           child: Icon(Icons.edit, color: MyTheme.accent).marginOnly(left: 12), | ||||
|         ) | ||||
|       ]), | ||||
|       trailingIcon: Transform.scale( | ||||
|         scale: 0.8, | ||||
|         child: InkWell( | ||||
|           onTap: () => pi.isHeadless | ||||
|               ? showSetOSAccount(sessionId, ffi.dialogManager) | ||||
|               : handleOsPasswordEditIcon(sessionId, ffi.dialogManager), | ||||
|           child: Icon(Icons.edit), | ||||
|         scale: isDesktop ? 0.8 : 1, | ||||
|         child: IconButton( | ||||
|           onPressed: () { | ||||
|             if (isMobile && Navigator.canPop(context)) { | ||||
|               Navigator.pop(context); | ||||
|             } | ||||
|             if (pi.isHeadless) { | ||||
|               showSetOSAccount(sessionId, ffi.dialogManager); | ||||
|             } else { | ||||
|               handleOsPasswordEditIcon(sessionId, ffi.dialogManager); | ||||
|             } | ||||
|           }, | ||||
|           icon: Icon(Icons.edit, color: isMobile ? MyTheme.accent : null), | ||||
|         ), | ||||
|       ), | ||||
|       onPressed: () => pi.isHeadless | ||||
|  | ||||
| @ -494,10 +494,23 @@ class _RemotePageState extends State<RemotePage> { | ||||
|     final x = 120.0; | ||||
|     final y = size.height; | ||||
|     final menus = toolbarControls(context, id, gFFI); | ||||
|     getChild(TTextMenu menu) { | ||||
|       if (menu.trailingIcon != null) { | ||||
|         return Row( | ||||
|             mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|             children: [ | ||||
|               menu.child, | ||||
|               menu.trailingIcon!, | ||||
|             ]); | ||||
|       } else { | ||||
|         return menu.child; | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
|     final more = menus | ||||
|         .asMap() | ||||
|         .entries | ||||
|         .map((e) => PopupMenuItem<int>(child: e.value.child, value: e.key)) | ||||
|         .map((e) => PopupMenuItem<int>(child: getChild(e.value), value: e.key)) | ||||
|         .toList(); | ||||
|     () async { | ||||
|       var index = await showMenu( | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user