From b53e47b023958ab58965dc679bfc8a538f214ba1 Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Thu, 26 May 2022 20:00:42 -0400 Subject: [PATCH] Tweak section headers (#90) --- lib/screens/channel/chat/details/chat_users_list.dart | 2 -- .../channel/chat/emote_menu/recent_emotes_panel.dart | 1 - lib/screens/channel/stores/chat_store.dart | 3 ++- lib/screens/home/search/search.dart | 3 +++ lib/screens/settings/sections/chat_settings.dart | 9 +++++++-- lib/widgets/section_header.dart | 6 +++--- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/screens/channel/chat/details/chat_users_list.dart b/lib/screens/channel/chat/details/chat_users_list.dart index 46c4f37e..9b888d6e 100644 --- a/lib/screens/channel/chat/details/chat_users_list.dart +++ b/lib/screens/channel/chat/details/chat_users_list.dart @@ -47,8 +47,6 @@ class _ChattersListState extends State { @override Widget build(BuildContext context) { - const textStyle = TextStyle(fontWeight: FontWeight.bold); - const headers = [ 'Broadcaster', 'Staff', diff --git a/lib/screens/channel/chat/emote_menu/recent_emotes_panel.dart b/lib/screens/channel/chat/emote_menu/recent_emotes_panel.dart index 3416491f..e0001bb3 100644 --- a/lib/screens/channel/chat/emote_menu/recent_emotes_panel.dart +++ b/lib/screens/channel/chat/emote_menu/recent_emotes_panel.dart @@ -63,7 +63,6 @@ class _RecentEmotesPanelState extends State { 'CLEAR', style: TextStyle( letterSpacing: 0.5, - fontSize: 12.0, fontWeight: FontWeight.w500, ), ), diff --git a/lib/screens/channel/stores/chat_store.dart b/lib/screens/channel/stores/chat_store.dart index 0bad1baf..1d822d9e 100644 --- a/lib/screens/channel/stores/chat_store.dart +++ b/lib/screens/channel/stores/chat_store.dart @@ -104,7 +104,8 @@ abstract class ChatStoreBase with Store { _messages.add(IRCMessage.createNotice(message: 'Connecting to chat...')); if (settings.chatDelay > 0) { - _messages.add(IRCMessage.createNotice(message: 'Waiting ${settings.chatDelay.toInt()} seconds due to chat delay setting...')); + _messages.add(IRCMessage.createNotice( + message: 'Waiting ${settings.chatDelay.toInt()} ${settings.chatDelay == 1.0 ? 'second' : 'seconds'} due to message delay setting...')); } connectToChat(); diff --git a/lib/screens/home/search/search.dart b/lib/screens/home/search/search.dart index c787373e..df78ee82 100644 --- a/lib/screens/home/search/search.dart +++ b/lib/screens/home/search/search.dart @@ -66,6 +66,7 @@ class _SearchState extends State { if (_searchStore.searchHistory.isNotEmpty) const SectionHeader( 'History', + fontSize: 12.0, padding: headerPadding, ), Expanded( @@ -101,6 +102,7 @@ class _SearchState extends State { const SliverToBoxAdapter( child: SectionHeader( 'Channels', + fontSize: 12.0, padding: headerPadding, ), ), @@ -111,6 +113,7 @@ class _SearchState extends State { const SliverToBoxAdapter( child: SectionHeader( 'Categories', + fontSize: 12.0, padding: headerPadding, ), ), diff --git a/lib/screens/settings/sections/chat_settings.dart b/lib/screens/settings/sections/chat_settings.dart index dfe4ca31..23efe074 100644 --- a/lib/screens/settings/sections/chat_settings.dart +++ b/lib/screens/settings/sections/chat_settings.dart @@ -21,13 +21,14 @@ class _ChatSettingsState extends State { Widget build(BuildContext context) { const timestamps = ['Disabled', '12-Hour', '24-Hour']; - const sectionPadding = EdgeInsets.only(left: 15.0, bottom: 5.0, top: 30.0); + const sectionPadding = EdgeInsets.only(left: 16.0, bottom: 5.0, top: 30.0); final settingsStore = widget.settingsStore; return Observer( builder: (context) => ExpansionTile( expandedCrossAxisAlignment: CrossAxisAlignment.start, + childrenPadding: const EdgeInsets.symmetric(vertical: 10.0), leading: const Icon(Icons.chat), title: const Text( 'Chat', @@ -42,7 +43,7 @@ class _ChatSettingsState extends State { children: [ const Text('Message Delay'), const Spacer(), - Text('${settingsStore.chatDelay.toInt()} seconds'), + Text('${settingsStore.chatDelay.toInt()} ${settingsStore.chatDelay == 1.0 ? 'second' : 'seconds'}'), ], ), subtitle: Slider.adaptive( @@ -55,6 +56,7 @@ class _ChatSettingsState extends State { ), const SectionHeader( 'Layout', + fontSize: 12.0, padding: sectionPadding, ), SwitchListTile.adaptive( @@ -86,6 +88,7 @@ class _ChatSettingsState extends State { ), const SectionHeader( 'Emotes', + fontSize: 12.0, padding: sectionPadding, ), SwitchListTile.adaptive( @@ -104,6 +107,7 @@ class _ChatSettingsState extends State { ), const SectionHeader( 'Message Appearance', + fontSize: 12.0, padding: sectionPadding, ), SwitchListTile.adaptive( @@ -144,6 +148,7 @@ class _ChatSettingsState extends State { ), const SectionHeader( 'Message Sizing', + fontSize: 12.0, padding: sectionPadding, ), ExpansionTile( diff --git a/lib/widgets/section_header.dart b/lib/widgets/section_header.dart index 9653f8ea..bef8a5fa 100644 --- a/lib/widgets/section_header.dart +++ b/lib/widgets/section_header.dart @@ -3,13 +3,13 @@ import 'package:flutter/material.dart'; class SectionHeader extends StatelessWidget { final String text; final EdgeInsets padding; - final double fontSize; + final double? fontSize; const SectionHeader( this.text, { Key? key, this.padding = const EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 5.0), - this.fontSize = 12.0, + this.fontSize, }) : super(key: key); @override @@ -21,7 +21,7 @@ class SectionHeader extends StatelessWidget { style: TextStyle( color: DefaultTextStyle.of(context).style.color?.withOpacity(0.8), fontSize: fontSize, - fontWeight: FontWeight.w500, + fontWeight: FontWeight.w600, letterSpacing: 0.5, ), ),