Fix up a few fonts. Add more scaling options
continuous-integration/drone/pr Build is pending Details

This commit is contained in:
Sarah Jamie Lewis 2023-08-02 10:26:09 -07:00
parent 1b35f8a32b
commit 388257bbff
6 changed files with 24 additions and 14 deletions

View File

@ -230,7 +230,7 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
EnvironmentConfig.debugLog("Font Scaling: $value"); EnvironmentConfig.debugLog("Font Scaling: $value");
}, },
min: 0.5, min: 0.5,
divisions: 6, divisions: 12,
max: 2.0, max: 2.0,
activeColor: settings.current().defaultButtonColor, activeColor: settings.current().defaultButtonColor,
thumbColor: settings.current().mainTextColor, thumbColor: settings.current().mainTextColor,
@ -467,6 +467,7 @@ class _GlobalSettingsViewState extends State<GlobalSettingsView> {
testKey: Key("DownloadFolderPicker"), testKey: Key("DownloadFolderPicker"),
label: AppLocalizations.of(context)!.settingDownloadFolder, label: AppLocalizations.of(context)!.settingDownloadFolder,
initialValue: settings.downloadPath, initialValue: settings.downloadPath,
textStyle: settings.scaleFonts(defaultDropDownMenuItemTextStyle),
description: AppLocalizations.of(context)!.fileSharingSettingsDownloadFolderDescription, description: AppLocalizations.of(context)!.fileSharingSettingsDownloadFolderDescription,
tooltip: AppLocalizations.of(context)!.fileSharingSettingsDownloadFolderTooltip, tooltip: AppLocalizations.of(context)!.fileSharingSettingsDownloadFolderTooltip,
onSave: (newVal) { onSave: (newVal) {

View File

@ -14,6 +14,7 @@ import 'package:cwtch/models/message_draft.dart';
import 'package:cwtch/models/messagecache.dart'; import 'package:cwtch/models/messagecache.dart';
import 'package:cwtch/models/messages/quotedmessage.dart'; import 'package:cwtch/models/messages/quotedmessage.dart';
import 'package:cwtch/models/profile.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/third_party/linkify/flutter_linkify.dart';
import 'package:cwtch/widgets/malformedbubble.dart'; import 'package:cwtch/widgets/malformedbubble.dart';
import 'package:cwtch/widgets/messageloadingbubble.dart'; import 'package:cwtch/widgets/messageloadingbubble.dart';
@ -619,11 +620,9 @@ class _MessageViewState extends State<MessageView> {
maxLengthEnforcement: MaxLengthEnforcement.enforced, maxLengthEnforcement: MaxLengthEnforcement.enforced,
maxLines: 3, maxLines: 3,
onFieldSubmitted: _sendMessage, onFieldSubmitted: _sendMessage,
style: TextStyle( style: Provider.of<Settings>(context).scaleFonts(defaultMessageTextStyle).copyWith(
fontFamily: "Inter", fontWeight: FontWeight.w500,
fontSize: 12.0 * Provider.of<Settings>(context).fontScaling, ),
fontWeight: FontWeight.w300,
),
enabled: true, // always allow editing... enabled: true, // always allow editing...
onChanged: (String x) { onChanged: (String x) {
@ -633,7 +632,8 @@ class _MessageViewState extends State<MessageView> {
}, },
decoration: InputDecoration( decoration: InputDecoration(
hintText: AppLocalizations.of(context)!.placeholderEnterMessage, hintText: AppLocalizations.of(context)!.placeholderEnterMessage,
hintStyle: TextStyle(fontFamily: "Inter", fontSize: 10.0 * Provider.of<Settings>(context).fontScaling, color: Provider.of<Settings>(context).theme.sendHintTextColor), hintStyle:
Provider.of<Settings>(context).scaleFonts(defaultMessageTextStyle).copyWith(color: Provider.of<Settings>(context).theme.sendHintTextColor, fontWeight: FontWeight.bold),
enabledBorder: InputBorder.none, enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
enabled: true, enabled: true,

View File

@ -14,6 +14,7 @@ class CwtchButtonTextField extends StatefulWidget {
this.labelText, this.labelText,
this.testKey, this.testKey,
this.onChanged, this.onChanged,
this.textStyle,
}); });
final TextEditingController controller; final TextEditingController controller;
final Function()? onPressed; final Function()? onPressed;
@ -22,6 +23,7 @@ class CwtchButtonTextField extends StatefulWidget {
final String tooltip; final String tooltip;
final bool readonly; final bool readonly;
final Key? testKey; final Key? testKey;
final TextStyle? textStyle;
String? labelText; String? labelText;
@override @override
@ -56,7 +58,7 @@ class _CwtchButtonTextFieldState extends State<CwtchButtonTextField> {
enableIMEPersonalizedLearning: false, enableIMEPersonalizedLearning: false,
onChanged: widget.onChanged, onChanged: widget.onChanged,
maxLines: 1, maxLines: 1,
style: TextStyle(overflow: TextOverflow.clip), style: widget.textStyle == null ? TextStyle(overflow: TextOverflow.clip) : widget.textStyle,
decoration: InputDecoration( decoration: InputDecoration(
labelText: widget.labelText, labelText: widget.labelText,
labelStyle: TextStyle(color: theme.current().mainTextColor, backgroundColor: theme.current().textfieldBackgroundColor), labelStyle: TextStyle(color: theme.current().mainTextColor, backgroundColor: theme.current().textfieldBackgroundColor),

View File

@ -14,7 +14,8 @@ class CwtchFolderPicker extends StatefulWidget {
final String description; final String description;
final Function(String)? onSave; final Function(String)? onSave;
final Key? testKey; 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 @override
_CwtchFolderPickerState createState() => _CwtchFolderPickerState(); _CwtchFolderPickerState createState() => _CwtchFolderPickerState();
@ -40,6 +41,7 @@ class _CwtchFolderPickerState extends State<CwtchFolderPicker> {
child: CwtchButtonTextField( child: CwtchButtonTextField(
testKey: widget.testKey, testKey: widget.testKey,
controller: ctrlrVal, controller: ctrlrVal,
textStyle: widget.textStyle,
readonly: Platform.isAndroid, readonly: Platform.isAndroid,
onPressed: Provider.of<AppState>(context).disableFilePicker onPressed: Provider.of<AppState>(context).disableFilePicker
? null ? null

View File

@ -3,6 +3,7 @@ import 'package:cwtch/models/profile.dart';
import 'package:cwtch/models/profileservers.dart'; import 'package:cwtch/models/profileservers.dart';
import 'package:cwtch/models/remoteserver.dart'; import 'package:cwtch/models/remoteserver.dart';
import 'package:cwtch/models/servers.dart'; import 'package:cwtch/models/servers.dart';
import 'package:cwtch/themes/opaque.dart';
import 'package:cwtch/views/addeditservers.dart'; import 'package:cwtch/views/addeditservers.dart';
import 'package:cwtch/views/remoteserverview.dart'; import 'package:cwtch/views/remoteserverview.dart';
import 'package:cwtch/widgets/profileimage.dart'; import 'package:cwtch/widgets/profileimage.dart';
@ -50,7 +51,9 @@ class _RemoteServerRowState extends State<RemoteServerRow> {
Text( Text(
description, description,
semanticsLabel: description, semanticsLabel: description,
style: TextStyle(fontFamily: "Inter", fontSize: 10.0 * Provider.of<Settings>(context).fontScaling, fontWeight: FontWeight.bold) style: Provider.of<Settings>(context)
.scaleFonts(defaultFormLabelTextStyle)
.copyWith(fontWeight: FontWeight.bold)
.apply(color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor), .apply(color: running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor),
softWrap: true, softWrap: true,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,

View File

@ -1,7 +1,6 @@
import 'package:cwtch/main.dart';
import 'package:cwtch/models/servers.dart'; import 'package:cwtch/models/servers.dart';
import 'package:cwtch/themes/opaque.dart';
import 'package:cwtch/views/addeditservers.dart'; import 'package:cwtch/views/addeditservers.dart';
import 'package:cwtch/widgets/profileimage.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -43,7 +42,8 @@ class _ServerRowState extends State<ServerRow> {
Text( Text(
server.description, server.description,
semanticsLabel: server.description, semanticsLabel: server.description,
style: TextStyle(fontFamily: "Inter", fontSize: 10.0 * Provider.of<Settings>(context).fontScaling) style: Provider.of<Settings>(context)
.scaleFonts(defaultFormLabelTextStyle)
.apply(color: server.running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor), .apply(color: server.running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor),
softWrap: true, softWrap: true,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
@ -55,7 +55,9 @@ class _ServerRowState extends State<ServerRow> {
server.onion, server.onion,
softWrap: true, softWrap: true,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: TextStyle(color: server.running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor), style: Provider.of<Settings>(context)
.scaleFonts(defaultFormLabelTextStyle)
.copyWith(color: server.running ? Provider.of<Settings>(context).theme.portraitOnlineBorderColor : Provider.of<Settings>(context).theme.portraitOfflineBorderColor),
))) )))
], ],
)), )),