mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 22:42:33 +01:00
feat: Send on enter
This commit is contained in:
parent
7ffd895ee1
commit
54aacc1c35
@ -174,6 +174,7 @@
|
||||
"supportedVersions": {}
|
||||
}
|
||||
},
|
||||
"sendOnEnter": "Send on enter",
|
||||
"badServerVersionsException": "The homeserver supports the Spec versions:\n{serverVersions}\nBut this app supports only {supportedVersions}",
|
||||
"@badServerVersionsException": {
|
||||
"type": "text",
|
||||
|
@ -30,6 +30,7 @@ abstract class AppConfig {
|
||||
static bool hideRedactedEvents = false;
|
||||
static bool hideUnknownEvents = true;
|
||||
static bool autoplayImages = true;
|
||||
static bool sendOnEnter = false;
|
||||
static const bool hideTypingUsernames = false;
|
||||
static const bool hideAllStateEvents = false;
|
||||
static const String inviteLinkPrefix = 'https://matrix.to/#/';
|
||||
|
@ -21,4 +21,5 @@ abstract class SettingKeys {
|
||||
static const String dontAskForBootstrapKey =
|
||||
'chat.fluffychat.dont_ask_bootstrap';
|
||||
static const String autoplayImages = 'chat.fluffy.autoplay_images';
|
||||
static const String sendOnEnter = 'chat.fluffy.send_on_enter';
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:emoji_picker_flutter/emoji_picker_flutter.dart';
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:fluffychat/pages/chat.dart';
|
||||
import 'package:fluffychat/widgets/avatar.dart';
|
||||
@ -697,7 +698,9 @@ class ChatView extends StatelessWidget {
|
||||
minLines: 1,
|
||||
maxLines: 8,
|
||||
autofocus: !PlatformInfos.isMobile,
|
||||
keyboardType: TextInputType.multiline,
|
||||
keyboardType: AppConfig.sendOnEnter
|
||||
? null
|
||||
: TextInputType.multiline,
|
||||
onSubmitted:
|
||||
controller.onInputBarSubmitted,
|
||||
focusNode: controller.inputFocus,
|
||||
|
@ -1,5 +1,6 @@
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/config/setting_keys.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:fluffychat/widgets/layouts/max_width_body.dart';
|
||||
import 'package:fluffychat/widgets/settings_switch_list_tile.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -55,6 +56,13 @@ class SettingsChatView extends StatelessWidget {
|
||||
storeKey: SettingKeys.autoplayImages,
|
||||
defaultValue: AppConfig.autoplayImages,
|
||||
),
|
||||
if (PlatformInfos.isMobile)
|
||||
SettingsSwitchListTile(
|
||||
title: L10n.of(context).sendOnEnter,
|
||||
onChanged: (b) => AppConfig.sendOnEnter = b,
|
||||
storeKey: SettingKeys.sendOnEnter,
|
||||
defaultValue: AppConfig.sendOnEnter,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -419,6 +419,9 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
store
|
||||
.getItemBool(SettingKeys.autoplayImages, AppConfig.autoplayImages)
|
||||
.then((value) => AppConfig.autoplayImages = value);
|
||||
store
|
||||
.getItemBool(SettingKeys.sendOnEnter, AppConfig.sendOnEnter)
|
||||
.then((value) => AppConfig.sendOnEnter = value);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user