diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 532de3bd..582f55f7 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -359,7 +359,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 256; + CURRENT_PROJECT_VERSION = 260; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -367,7 +367,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.256; + MARKETING_VERSION = 1.0.260; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -490,7 +490,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 256; + CURRENT_PROJECT_VERSION = 260; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -498,7 +498,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.256; + MARKETING_VERSION = 1.0.260; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -515,7 +515,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 256; + CURRENT_PROJECT_VERSION = 260; DEVELOPMENT_TEAM = BA88US33G6; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Runner/Info-$(CONFIGURATION).plist"; @@ -523,7 +523,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.256; + MARKETING_VERSION = 1.0.260; PRODUCT_BUNDLE_IDENTIFIER = com.lollipopkit.toolbox; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/lib/data/res/build_data.dart b/lib/data/res/build_data.dart index b10df114..a850c52a 100644 --- a/lib/data/res/build_data.dart +++ b/lib/data/res/build_data.dart @@ -2,9 +2,8 @@ class BuildData { static const String name = "ServerBox"; - static const int build = 256; - static const String engine = - "Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 2ad6cd72c0 (4 weeks ago) • 2023-03-08 09:41:59 -0800\nEngine • revision 1837b5be5f\nTools • Dart 2.19.4 • DevTools 2.20.1\n"; - static const String buildAt = "2023-04-05 15:16:00.949501"; - static const int modifications = 2; + static const int build = 260; + static const String engine = "Flutter 3.7.7 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision 2ad6cd72c0 (6 weeks ago) • 2023-03-08 09:41:59 -0800\nEngine • revision 1837b5be5f\nTools • Dart 2.19.4 • DevTools 2.20.1\n"; + static const String buildAt = "2023-04-16 22:22:23.410508"; + static const int modifications = 3; } diff --git a/lib/data/res/virtual_key.dart b/lib/data/res/virtual_key.dart index d7e8b282..d8870b5c 100644 --- a/lib/data/res/virtual_key.dart +++ b/lib/data/res/virtual_key.dart @@ -9,17 +9,18 @@ var virtualKeys = [ VirtualKey('Home', key: TerminalKey.home), VirtualKey('Up', key: TerminalKey.arrowUp, icon: Icons.arrow_upward), VirtualKey('End', key: TerminalKey.end), - // VirtualKey( - // 'Del', - // key: TerminalKey.delete, - // ), - //VirtualKey('Paste', func: VirtualKeyFunc.paste, icon: Icons.paste), + VirtualKey( + 'Del', + key: TerminalKey.delete, + icon: Icons.backspace, + ), VirtualKey('Snippet', func: VirtualKeyFunc.snippet, icon: Icons.code), VirtualKey('Tab', key: TerminalKey.tab), VirtualKey('Ctrl', key: TerminalKey.control, toggleable: true), VirtualKey('Left', key: TerminalKey.arrowLeft, icon: Icons.arrow_back), VirtualKey('Down', key: TerminalKey.arrowDown, icon: Icons.arrow_downward), VirtualKey('Right', key: TerminalKey.arrowRight, icon: Icons.arrow_forward), + VirtualKey('Paste', func: VirtualKeyFunc.paste, icon: Icons.paste), VirtualKey( 'IME', func: VirtualKeyFunc.toggleIME, diff --git a/lib/view/page/ssh.dart b/lib/view/page/ssh.dart index 21c87d4f..2bb436e0 100644 --- a/lib/view/page/ssh.dart +++ b/lib/view/page/ssh.dart @@ -42,6 +42,9 @@ class _SSHPageState extends State { late TextStyle _menuTextStyle; late TerminalColors _termColors; late S _s; + late TerminalStyle _terminalStyle; + late TerminalUITheme _termUITheme; + late TerminalTheme _terminalTheme; var _isDark = false; @@ -50,6 +53,8 @@ class _SSHPageState extends State { super.initState(); final termColorIdx = _setting.termColorIdx.fetch()!; _termColors = TerminalColorsPlatform.values[termColorIdx].colors; + final ts = TextStyle(fontFamily: getFileName(_setting.fontPath.fetch())); + _terminalStyle = TerminalStyle.fromTextStyle(ts); initTerminal(); } @@ -60,6 +65,8 @@ class _SSHPageState extends State { _media = MediaQuery.of(context); _menuTextStyle = TextStyle(color: contentColor.resolve(context)); _s = S.of(context)!; + _termUITheme = _isDark ? termDarkTheme : termLightTheme; + _terminalTheme = _termUITheme.toTerminalTheme(_termColors); } @override @@ -125,11 +132,10 @@ class _SSHPageState extends State { @override Widget build(BuildContext context) { - final termTheme = _isDark ? termDarkTheme : termLightTheme; Widget child = Scaffold( - backgroundColor: termTheme.background, - body: _buildBody(termTheme.toTerminalTheme(_termColors)), - bottomNavigationBar: _buildBottom(termTheme.background), + backgroundColor: _termUITheme.background, + body: _buildBody(), + bottomNavigationBar: _buildBottom(), ); if (isIOS) { child = AnnotatedRegion( @@ -140,7 +146,7 @@ class _SSHPageState extends State { return child; } - Widget _buildBody(TerminalTheme termTheme) { + Widget _buildBody() { return SizedBox( height: _media.size.height - _virtualKeyboardHeight - @@ -150,9 +156,8 @@ class _SSHPageState extends State { _terminal, controller: _terminalController, keyboardType: TextInputType.visiblePassword, - textStyle: TerminalStyle.fromTextStyle( - TextStyle(fontFamily: getFileName(_setting.fontPath.fetch()))), - theme: termTheme, + textStyle: _terminalStyle, + theme: _terminalTheme, deleteDetection: isIOS, onTapUp: _onTapUp, autoFocus: true, @@ -161,14 +166,14 @@ class _SSHPageState extends State { ); } - Widget _buildBottom(Color bgColor) { + Widget _buildBottom() { return SafeArea( child: AnimatedPadding( padding: _media.viewInsets, duration: const Duration(milliseconds: 23), curve: Curves.fastOutSlowIn, child: Container( - color: bgColor, + color: _termUITheme.background, height: _virtualKeyboardHeight, child: Consumer( builder: (_, __, ___) => _buildVirtualKey(), @@ -218,7 +223,7 @@ class _SSHPageState extends State { item.text, style: TextStyle( color: selected ? primaryColor : null, - fontSize: 17, + fontSize: 15, ), ); @@ -306,27 +311,27 @@ class _SSHPageState extends State { } final selected = terminalSelected; if (selected.trim().isEmpty) { - _menuController.show( - context: context, - contextMenuBuilder: (context) { - return TextSelectionToolbar( - anchorAbove: details.globalPosition, - anchorBelow: details.globalPosition, - children: [ - TextButton( - child: Text( - _s.paste, - style: _menuTextStyle, - ), - onPressed: () async { - _paste(); - _menuController.remove(); - }, - ) - ], - ); - }, - ); + // _menuController.show( + // context: context, + // contextMenuBuilder: (context) { + // return TextSelectionToolbar( + // anchorAbove: details.globalPosition, + // anchorBelow: details.globalPosition, + // children: [ + // TextButton( + // child: Text( + // _s.paste, + // style: _menuTextStyle, + // ), + // onPressed: () async { + // _paste(); + // _menuController.remove(); + // }, + // ) + // ], + // ); + // }, + // ); return; } _menuController.show( diff --git a/pubspec.lock b/pubspec.lock index 07719ab1..4d7a7c31 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1006,11 +1006,9 @@ packages: xterm: dependency: "direct main" description: - path: "." - ref: master - resolved-ref: "8039a582d855428cec49b23641bcfcafd6682574" - url: "https://github.com/lollipopkit/xterm.dart" - source: git + path: "../xterm.dart" + relative: true + source: path version: "3.4.1" yaml: dependency: transitive diff --git a/pubspec.yaml b/pubspec.yaml index c5217d4f..829f7fe6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -57,10 +57,10 @@ dependencies: share_plus_web: ^3.1.0 # xterm: ^3.4.1 xterm: - # path: ../xterm.dart - git: - ref: master - url: https://github.com/lollipopkit/xterm.dart + path: ../xterm.dart + # git: + # ref: master + # url: https://github.com/lollipopkit/xterm.dart file_picker: ^5.2.5 plain_notification_token: ^0.0.4