chore: Minor lable fixes

This commit is contained in:
Krille 2022-12-30 17:45:58 +01:00
parent ee3351f643
commit 7436cb4aa8
3 changed files with 3 additions and 25 deletions

View File

@ -25,39 +25,17 @@ class NewPrivateChatController extends State<NewPrivateChat> {
final formKey = GlobalKey<FormState>();
bool loading = false;
bool _hideFab = false;
// remove leading matrix.to from text field in order to simplify pasting
final List<TextInputFormatter> removeMatrixToFormatters = [
FilteringTextInputFormatter.deny(NewPrivateChatController.prefix),
FilteringTextInputFormatter.deny(NewPrivateChatController.prefixNoProtocol),
];
bool get hideFab => _hideFab;
static const Set<String> supportedSigils = {'@', '!', '#'};
static const String prefix = 'https://matrix.to/#/';
static const String prefixNoProtocol = 'matrix.to/#/';
void setHideFab() {
if (textFieldFocus.hasFocus != _hideFab) {
setState(() => _hideFab = textFieldFocus.hasFocus);
}
}
@override
void initState() {
super.initState();
textFieldFocus.addListener(setHideFab);
}
@override
void dispose() {
textFieldFocus.removeListener(setHideFab);
super.dispose();
}
void submitAction([_]) async {
controller.text = controller.text.trim();
if (!formKey.currentState!.validate()) return;

View File

@ -109,7 +109,7 @@ class NewPrivateChatView extends StatelessWidget {
],
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: PlatformInfos.isMobile && !controller.hideFab
floatingActionButton: PlatformInfos.isMobile
? Padding(
padding: const EdgeInsets.only(bottom: 64.0),
child: FloatingActionButton.extended(

View File

@ -28,13 +28,13 @@ class SettingsSecurityController extends State<SettingsSecurity> {
cancelLabel: L10n.of(context)!.cancel,
textFields: [
DialogTextField(
hintText: L10n.of(context)!.pleaseEnterYourPassword,
hintText: L10n.of(context)!.chooseAStrongPassword,
obscureText: true,
minLines: 1,
maxLines: 1,
),
DialogTextField(
hintText: L10n.of(context)!.chooseAStrongPassword,
hintText: L10n.of(context)!.repeatPassword,
obscureText: true,
minLines: 1,
maxLines: 1,