Skip to content

Commit

Permalink
Fix various OLED color theme issues, community name format (#1347)
Browse files Browse the repository at this point in the history
* OLED color theme and UI alignment fixes

* Fix post editor community insert too

* Oops, use name instead of title

* Fix account page OLED colors

* formatting and typo
  • Loading branch information
CTalvio committed May 5, 2024
1 parent f60763a commit d909257
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 25 deletions.
1 change: 1 addition & 0 deletions lib/account/pages/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class _LoginPageState extends State<LoginPage> with SingleTickerProviderStateMix
),
],
child: Scaffold(
backgroundColor: theme.cardColor,
resizeToAvoidBottomInset: false,
body: Padding(
padding: EdgeInsets.only(
Expand Down
1 change: 1 addition & 0 deletions lib/account/widgets/profile_modal_body.dart
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class _ProfileSelectState extends State<ProfileSelect> {
return true;
},
child: Scaffold(
backgroundColor: theme.cardColor,
body: CustomScrollView(
slivers: [
SliverAppBar(
Expand Down
7 changes: 3 additions & 4 deletions lib/comment/view/create_comment_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ class _CreateCommentPageState extends State<CreateCommentPage> {
builder: (context, state) {
return KeyboardDismissOnTap(
child: Scaffold(
backgroundColor: theme.colorScheme.surface,
appBar: AppBar(
title: Text(widget.commentView != null ? l10n.editComment : l10n.createComment),
toolbarHeight: 70.0,
Expand Down Expand Up @@ -373,7 +372,7 @@ class _CreateCommentPageState extends State<CreateCommentPage> {
),
const Divider(height: 1),
Container(
padding: const EdgeInsets.symmetric(vertical: 4.0),
color: theme.cardColor,
child: Row(
children: [
Expanded(
Expand Down Expand Up @@ -407,7 +406,7 @@ class _CreateCommentPageState extends State<CreateCommentPage> {
MarkdownType.community: () {
showCommunityInputDialog(context, title: l10n.community, onCommunitySelected: (community) {
_bodyTextController.text = _bodyTextController.text.replaceRange(_bodyTextController.selection.end, _bodyTextController.selection.end,
'[@${community.community.title}@${fetchInstanceNameFromUrl(community.community.actorId)}](${community.community.actorId})');
'!${community.community.name}@${fetchInstanceNameFromUrl(community.community.actorId)}');
});
},
},
Expand All @@ -422,7 +421,7 @@ class _CreateCommentPageState extends State<CreateCommentPage> {
),
),
Padding(
padding: const EdgeInsets.only(bottom: 8.0, left: 8.0, right: 8.0),
padding: const EdgeInsets.only(bottom: 2.0, top: 2.0, left: 4.0, right: 8.0),
child: IconButton(
onPressed: () {
if (!showPreview) {
Expand Down
33 changes: 19 additions & 14 deletions lib/community/pages/create_post_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,13 @@ class _CreatePostPageState extends State<CreatePostPage> {
],
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
CommunitySelector(
communityId: communityId,
Expand Down Expand Up @@ -538,8 +538,13 @@ class _CreatePostPageState extends State<CreatePostPage> {
]),
),
),
const Divider(),
Row(
),
const Divider(
height: 1,
),
Container(
color: theme.cardColor,
child: Row(
children: [
Expanded(
child: MarkdownToolbar(
Expand Down Expand Up @@ -569,8 +574,8 @@ class _CreatePostPageState extends State<CreatePostPage> {
},
MarkdownType.community: () {
showCommunityInputDialog(context, title: l10n.community, onCommunitySelected: (community) {
_bodyTextController.text = _bodyTextController.text.replaceRange(_bodyTextController.selection.end, _bodyTextController.selection.end,
'[@${community.community.title}@${fetchInstanceNameFromUrl(community.community.actorId)}](${community.community.actorId})');
_bodyTextController.text = _bodyTextController.text.replaceRange(
_bodyTextController.selection.end, _bodyTextController.selection.end, '!${community.community.name}@${fetchInstanceNameFromUrl(community.community.actorId)}');
});
},
},
Expand All @@ -584,7 +589,7 @@ class _CreatePostPageState extends State<CreatePostPage> {
),
),
Padding(
padding: const EdgeInsets.only(bottom: 8.0, left: 8.0, right: 8.0),
padding: const EdgeInsets.only(bottom: 2.0, top: 2.0, left: 4.0, right: 8.0),
child: IconButton(
onPressed: () {
if (!showPreview) {
Expand All @@ -606,8 +611,8 @@ class _CreatePostPageState extends State<CreatePostPage> {
),
],
),
],
),
),
],
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/post/widgets/comment_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class _CommentCardState extends State<CommentCard> with SingleTickerProviderStat
),
),
child: Material(
color: highlightComment ? theme.highlightColor : theme.colorScheme.background,
color: highlightComment ? theme.highlightColor : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
Expand Down
4 changes: 1 addition & 3 deletions lib/user/pages/user_page_success.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ class _UserPageSuccessState extends State<UserPageSuccess> with TickerProviderSt
_selectedUserOption ??= widget.selectedUserOption ?? [true, false];
savedToggle ??= widget.savedToggle ?? PrimitiveWrapper<bool>(false);

final theme = Theme.of(context);
final DateTime now = DateTime.now().toUtc();
final int? currentUserId = context.read<AuthBloc>().state.account?.userId;

Expand Down Expand Up @@ -140,8 +139,7 @@ class _UserPageSuccessState extends State<UserPageSuccess> with TickerProviderSt
: const SizedBox(),
),
Container(
margin: const EdgeInsets.symmetric(vertical: 16, horizontal: 16),
color: theme.colorScheme.background,
margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expand Down
3 changes: 3 additions & 0 deletions lib/user/pages/user_settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
message: instance.domain,
preferBelow: false,
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(50),
onTap: () {
Expand Down Expand Up @@ -374,6 +375,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
message: generateCommunityFullName(context, community.name, fetchInstanceNameFromUrl(community.actorId) ?? '-'),
preferBelow: false,
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(50),
onTap: () {
Expand Down Expand Up @@ -428,6 +430,7 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
message: generateUserFullName(context, person.name, fetchInstanceNameFromUrl(person.actorId) ?? '-'),
preferBelow: false,
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: BorderRadius.circular(50),
onTap: () {
Expand Down
6 changes: 3 additions & 3 deletions lib/user/widgets/user_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class _UserSidebarState extends State<UserSidebar> {
},
child: personView.person.id != currentUserId ? BlockUserButton(personView: personView, isUserLoggedIn: authState.isLoggedIn) : null,
),
const SizedBox(height: 10.0),
const Divider(height: 1, thickness: 2),
if (personView.person.id != currentUserId) const SizedBox(height: 10.0),
if (personView.person.id != currentUserId) const Divider(height: 1, thickness: 2),
Container(
alignment: Alignment.topCenter,
padding: const EdgeInsets.symmetric(horizontal: 12.0),
Expand Down Expand Up @@ -287,7 +287,7 @@ class BlockUserButton extends StatelessWidget {
}

return Padding(
padding: EdgeInsets.only(top: blocked ? 10 : 4, left: 12, right: 12, bottom: 4),
padding: const EdgeInsets.only(top: 10, left: 12, right: 12, bottom: 4),
child: ElevatedButton(
onPressed: isUserLoggedIn
? () {
Expand Down

0 comments on commit d909257

Please sign in to comment.