mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.: only display virt keys on mobile devices
This commit is contained in:
@@ -47,8 +47,8 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
late TerminalStyle _terminalStyle;
|
late TerminalStyle _terminalStyle;
|
||||||
late TerminalTheme _terminalTheme;
|
late TerminalTheme _terminalTheme;
|
||||||
late TextInputType _keyboardType;
|
late TextInputType _keyboardType;
|
||||||
late double _virtKeyWidth;
|
double _virtKeyWidth = 0;
|
||||||
late double _virtKeysHeight;
|
double _virtKeysHeight = 0;
|
||||||
|
|
||||||
bool _isDark = false;
|
bool _isDark = false;
|
||||||
Timer? _virtKeyLongPressTimer;
|
Timer? _virtKeyLongPressTimer;
|
||||||
@@ -85,9 +85,12 @@ class _SSHPageState extends State<SSHPage> {
|
|||||||
_media = MediaQuery.of(context);
|
_media = MediaQuery.of(context);
|
||||||
_s = S.of(context)!;
|
_s = S.of(context)!;
|
||||||
_terminalTheme = _isDark ? termDarkTheme : termLightTheme;
|
_terminalTheme = _isDark ? termDarkTheme : termLightTheme;
|
||||||
// Calculate virtkey width / height
|
|
||||||
_virtKeyWidth = _media.size.width / 7;
|
// Because the virtual keyboard only displayed on mobile devices
|
||||||
_virtKeysHeight = _media.size.height * 0.043 * _virtKeysList.length;
|
if (isMobile) {
|
||||||
|
_virtKeyWidth = _media.size.width / 7;
|
||||||
|
_virtKeysHeight = _media.size.height * 0.043 * _virtKeysList.length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user