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