diff --git a/lib/views/globalsettingsview.dart b/lib/views/globalsettingsview.dart index f64ddf5d..25850553 100644 --- a/lib/views/globalsettingsview.dart +++ b/lib/views/globalsettingsview.dart @@ -230,7 +230,7 @@ class _GlobalSettingsViewState extends State { EnvironmentConfig.debugLog("Font Scaling: $value"); }, min: 0.5, - divisions: 6, + divisions: 12, max: 2.0, activeColor: settings.current().defaultButtonColor, thumbColor: settings.current().mainTextColor, @@ -467,6 +467,7 @@ class _GlobalSettingsViewState extends State { testKey: Key("DownloadFolderPicker"), label: AppLocalizations.of(context)!.settingDownloadFolder, initialValue: settings.downloadPath, + textStyle: settings.scaleFonts(defaultDropDownMenuItemTextStyle), description: AppLocalizations.of(context)!.fileSharingSettingsDownloadFolderDescription, tooltip: AppLocalizations.of(context)!.fileSharingSettingsDownloadFolderTooltip, onSave: (newVal) { diff --git a/lib/views/messageview.dart b/lib/views/messageview.dart index f294aa59..f0c8a989 100644 --- a/lib/views/messageview.dart +++ b/lib/views/messageview.dart @@ -14,6 +14,7 @@ import 'package:cwtch/models/message_draft.dart'; import 'package:cwtch/models/messagecache.dart'; import 'package:cwtch/models/messages/quotedmessage.dart'; import 'package:cwtch/models/profile.dart'; +import 'package:cwtch/themes/opaque.dart'; import 'package:cwtch/third_party/linkify/flutter_linkify.dart'; import 'package:cwtch/widgets/malformedbubble.dart'; import 'package:cwtch/widgets/messageloadingbubble.dart'; @@ -619,11 +620,9 @@ class _MessageViewState extends State { maxLengthEnforcement: MaxLengthEnforcement.enforced, maxLines: 3, onFieldSubmitted: _sendMessage, - style: TextStyle( - fontFamily: "Inter", - fontSize: 12.0 * Provider.of(context).fontScaling, - fontWeight: FontWeight.w300, - ), + style: Provider.of(context).scaleFonts(defaultMessageTextStyle).copyWith( + fontWeight: FontWeight.w500, + ), enabled: true, // always allow editing... onChanged: (String x) { @@ -633,7 +632,8 @@ class _MessageViewState extends State { }, decoration: InputDecoration( hintText: AppLocalizations.of(context)!.placeholderEnterMessage, - hintStyle: TextStyle(fontFamily: "Inter", fontSize: 10.0 * Provider.of(context).fontScaling, color: Provider.of(context).theme.sendHintTextColor), + hintStyle: + Provider.of(context).scaleFonts(defaultMessageTextStyle).copyWith(color: Provider.of(context).theme.sendHintTextColor, fontWeight: FontWeight.bold), enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, enabled: true, diff --git a/lib/widgets/buttontextfield.dart b/lib/widgets/buttontextfield.dart index b5c24847..0307b367 100644 --- a/lib/widgets/buttontextfield.dart +++ b/lib/widgets/buttontextfield.dart @@ -14,6 +14,7 @@ class CwtchButtonTextField extends StatefulWidget { this.labelText, this.testKey, this.onChanged, + this.textStyle, }); final TextEditingController controller; final Function()? onPressed; @@ -22,6 +23,7 @@ class CwtchButtonTextField extends StatefulWidget { final String tooltip; final bool readonly; final Key? testKey; + final TextStyle? textStyle; String? labelText; @override @@ -56,7 +58,7 @@ class _CwtchButtonTextFieldState extends State { enableIMEPersonalizedLearning: false, onChanged: widget.onChanged, maxLines: 1, - style: TextStyle(overflow: TextOverflow.clip), + style: widget.textStyle == null ? TextStyle(overflow: TextOverflow.clip) : widget.textStyle, decoration: InputDecoration( labelText: widget.labelText, labelStyle: TextStyle(color: theme.current().mainTextColor, backgroundColor: theme.current().textfieldBackgroundColor), diff --git a/lib/widgets/folderpicker.dart b/lib/widgets/folderpicker.dart index d34335fb..6051db43 100644 --- a/lib/widgets/folderpicker.dart +++ b/lib/widgets/folderpicker.dart @@ -14,7 +14,8 @@ class CwtchFolderPicker extends StatefulWidget { final String description; final Function(String)? onSave; final Key? testKey; - const CwtchFolderPicker({Key? key, this.testKey, this.label = "", this.tooltip = "", this.initialValue = "", this.onSave, this.description = ""}) : super(key: key); + final TextStyle? textStyle; + const CwtchFolderPicker({Key? key, this.testKey, this.textStyle, this.label = "", this.tooltip = "", this.initialValue = "", this.onSave, this.description = ""}) : super(key: key); @override _CwtchFolderPickerState createState() => _CwtchFolderPickerState(); @@ -40,6 +41,7 @@ class _CwtchFolderPickerState extends State { child: CwtchButtonTextField( testKey: widget.testKey, controller: ctrlrVal, + textStyle: widget.textStyle, readonly: Platform.isAndroid, onPressed: Provider.of(context).disableFilePicker ? null diff --git a/lib/widgets/remoteserverrow.dart b/lib/widgets/remoteserverrow.dart index b19b837d..113ad060 100644 --- a/lib/widgets/remoteserverrow.dart +++ b/lib/widgets/remoteserverrow.dart @@ -3,6 +3,7 @@ import 'package:cwtch/models/profile.dart'; import 'package:cwtch/models/profileservers.dart'; import 'package:cwtch/models/remoteserver.dart'; import 'package:cwtch/models/servers.dart'; +import 'package:cwtch/themes/opaque.dart'; import 'package:cwtch/views/addeditservers.dart'; import 'package:cwtch/views/remoteserverview.dart'; import 'package:cwtch/widgets/profileimage.dart'; @@ -50,7 +51,9 @@ class _RemoteServerRowState extends State { Text( description, semanticsLabel: description, - style: TextStyle(fontFamily: "Inter", fontSize: 10.0 * Provider.of(context).fontScaling, fontWeight: FontWeight.bold) + style: Provider.of(context) + .scaleFonts(defaultFormLabelTextStyle) + .copyWith(fontWeight: FontWeight.bold) .apply(color: running ? Provider.of(context).theme.portraitOnlineBorderColor : Provider.of(context).theme.portraitOfflineBorderColor), softWrap: true, overflow: TextOverflow.ellipsis, diff --git a/lib/widgets/serverrow.dart b/lib/widgets/serverrow.dart index 49ad3af0..dd402d0a 100644 --- a/lib/widgets/serverrow.dart +++ b/lib/widgets/serverrow.dart @@ -1,7 +1,6 @@ -import 'package:cwtch/main.dart'; import 'package:cwtch/models/servers.dart'; +import 'package:cwtch/themes/opaque.dart'; import 'package:cwtch/views/addeditservers.dart'; -import 'package:cwtch/widgets/profileimage.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:provider/provider.dart'; @@ -43,7 +42,8 @@ class _ServerRowState extends State { Text( server.description, semanticsLabel: server.description, - style: TextStyle(fontFamily: "Inter", fontSize: 10.0 * Provider.of(context).fontScaling) + style: Provider.of(context) + .scaleFonts(defaultFormLabelTextStyle) .apply(color: server.running ? Provider.of(context).theme.portraitOnlineBorderColor : Provider.of(context).theme.portraitOfflineBorderColor), softWrap: true, overflow: TextOverflow.ellipsis, @@ -55,7 +55,9 @@ class _ServerRowState extends State { server.onion, softWrap: true, overflow: TextOverflow.ellipsis, - style: TextStyle(color: server.running ? Provider.of(context).theme.portraitOnlineBorderColor : Provider.of(context).theme.portraitOfflineBorderColor), + style: Provider.of(context) + .scaleFonts(defaultFormLabelTextStyle) + .copyWith(color: server.running ? Provider.of(context).theme.portraitOnlineBorderColor : Provider.of(context).theme.portraitOfflineBorderColor), ))) ], )),