chore: Adjust colors

This commit is contained in:
Krille Fear 2021-11-15 07:59:51 +01:00
parent b587827589
commit 97e644b64a
4 changed files with 20 additions and 13 deletions

View File

@ -75,6 +75,8 @@ class MessageContent extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final fontSize = AppConfig.messageFontSize * AppConfig.fontSizeFactor; final fontSize = AppConfig.messageFontSize * AppConfig.fontSizeFactor;
final buttonTextColor =
event.senderId == Matrix.of(context).client.userID ? textColor : null;
switch (event.type) { switch (event.type) {
case EventTypes.Message: case EventTypes.Message:
case EventTypes.Encrypted: case EventTypes.Encrypted:
@ -165,7 +167,7 @@ class MessageContent extends StatelessWidget {
case MessageTypes.BadEncrypted: case MessageTypes.BadEncrypted:
case EventTypes.Encrypted: case EventTypes.Encrypted:
return _ButtonContent( return _ButtonContent(
textColor: textColor, textColor: buttonTextColor,
onPressed: () => _verifyOrRequestKey(context), onPressed: () => _verifyOrRequestKey(context),
icon: const Icon(Icons.lock_outline), icon: const Icon(Icons.lock_outline),
label: L10n.of(context).encrypted, label: L10n.of(context).encrypted,
@ -215,7 +217,7 @@ class MessageContent extends StatelessWidget {
onPressed: () => launch(event.body), onPressed: () => launch(event.body),
icon: const Icon(Icons.phone_outlined, color: Colors.green), icon: const Icon(Icons.phone_outlined, color: Colors.green),
label: L10n.of(context).videoCall, label: L10n.of(context).videoCall,
textColor: textColor, textColor: buttonTextColor,
); );
} }
if (event.redacted) { if (event.redacted) {
@ -223,7 +225,7 @@ class MessageContent extends StatelessWidget {
label: L10n.of(context) label: L10n.of(context)
.redactedAnEvent(event.sender.calcDisplayname()), .redactedAnEvent(event.sender.calcDisplayname()),
icon: const Icon(Icons.delete_outlined), icon: const Icon(Icons.delete_outlined),
textColor: textColor, textColor: buttonTextColor,
onPressed: () => onInfoTab(event), onPressed: () => onInfoTab(event),
); );
} }
@ -252,7 +254,7 @@ class MessageContent extends StatelessWidget {
label: L10n.of(context) label: L10n.of(context)
.userSentUnknownEvent(event.sender.calcDisplayname(), event.type), .userSentUnknownEvent(event.sender.calcDisplayname(), event.type),
icon: const Icon(Icons.info_outlined), icon: const Icon(Icons.info_outlined),
textColor: textColor, textColor: buttonTextColor,
onPressed: () => onInfoTab(event), onPressed: () => onInfoTab(event),
); );
} }
@ -280,6 +282,7 @@ class _ButtonContent extends StatelessWidget {
onPressed: onPressed, onPressed: onPressed,
icon: icon, icon: icon,
label: Text(label, overflow: TextOverflow.ellipsis), label: Text(label, overflow: TextOverflow.ellipsis),
style: TextButton.styleFrom(primary: textColor),
); );
} }
} }

View File

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:matrix/matrix.dart'; import 'package:matrix/matrix.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/event_extension.dart'; import 'package:fluffychat/utils/matrix_sdk_extensions.dart/event_extension.dart';
import 'package:fluffychat/widgets/matrix.dart';
class MessageDownloadContent extends StatelessWidget { class MessageDownloadContent extends StatelessWidget {
final Event event; final Event event;
@ -24,6 +25,9 @@ class MessageDownloadContent extends StatelessWidget {
onPressed: () => event.saveFile(context), onPressed: () => event.saveFile(context),
icon: const Icon(Icons.download_outlined), icon: const Icon(Icons.download_outlined),
label: Text(filename), label: Text(filename),
style: event.senderId == Matrix.of(context).client.userID
? TextButton.styleFrom(primary: textColor)
: null,
), ),
if (event.sizeString != null) if (event.sizeString != null)
Text( Text(

View File

@ -51,12 +51,13 @@ class SettingsStyleController extends State<SettingsStyle> {
AdaptiveThemeMode currentTheme; AdaptiveThemeMode currentTheme;
static List<Color> get customColors => [ static final List<Color> customColors = [
AppConfig.primaryColor, AppConfig.primaryColor,
HSLColor.fromColor(AppConfig.primaryColor).withHue(200).toColor(), Colors.blue.shade800,
HSLColor.fromColor(AppConfig.primaryColor).withHue(130).toColor(), Colors.green.shade800,
HSLColor.fromColor(AppConfig.primaryColor).withHue(65).toColor(), Colors.orange.shade900,
HSLColor.fromColor(AppConfig.primaryColor).withHue(8).toColor(), Colors.pink.shade700,
Colors.blueGrey.shade600,
]; ];
void switchTheme(AdaptiveThemeMode newTheme) { void switchTheme(AdaptiveThemeMode newTheme) {

View File

@ -14,9 +14,8 @@ class EmptyPage extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
elevation: 0, elevation: 0,
backgroundColor: Theme.of(context).colorScheme.surface, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
), ),
backgroundColor: Theme.of(context).colorScheme.surface,
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
body: Column( body: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,