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");
},
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<GlobalSettingsView> {
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) {

View File

@ -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<MessageView> {
maxLengthEnforcement: MaxLengthEnforcement.enforced,
maxLines: 3,
onFieldSubmitted: _sendMessage,
style: TextStyle(
fontFamily: "Inter",
fontSize: 12.0 * Provider.of<Settings>(context).fontScaling,
fontWeight: FontWeight.w300,
),
style: Provider.of<Settings>(context).scaleFonts(defaultMessageTextStyle).copyWith(
fontWeight: FontWeight.w500,
),
enabled: true, // always allow editing...
onChanged: (String x) {
@ -633,7 +632,8 @@ class _MessageViewState extends State<MessageView> {
},
decoration: InputDecoration(
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,
focusedBorder: InputBorder.none,
enabled: true,

View File

@ -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<CwtchButtonTextField> {
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),

View File

@ -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<CwtchFolderPicker> {
child: CwtchButtonTextField(
testKey: widget.testKey,
controller: ctrlrVal,
textStyle: widget.textStyle,
readonly: Platform.isAndroid,
onPressed: Provider.of<AppState>(context).disableFilePicker
? null

View File

@ -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<RemoteServerRow> {
Text(
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),
softWrap: true,
overflow: TextOverflow.ellipsis,

View File

@ -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<ServerRow> {
Text(
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),
softWrap: true,
overflow: TextOverflow.ellipsis,
@ -55,7 +55,9 @@ class _ServerRowState extends State<ServerRow> {
server.onion,
softWrap: true,
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),
)))
],
)),