Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
fixed the title label being hidden with long content messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandra authored and Alexandra committed Nov 25, 2022
1 parent aceab59 commit de2d4fd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Tweak/Liddell.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ void override_NCNotificationShortLookView_didMoveToWindow(NCNotificationShortLoo
NCNotificationRequest* request;
if ([[[self nextResponder] nextResponder] nextResponder]) {
controller = (UIViewController *)[[[self nextResponder] nextResponder] nextResponder];
if ([controller isKindOfClass:objc_getClass("NCNotificationShortLookViewController")] && [((NCNotificationShortLookViewController *) controller) notificationRequest])
if ([controller isKindOfClass:objc_getClass("NCNotificationShortLookViewController")] && [((NCNotificationShortLookViewController *) controller) notificationRequest]) {
request = [((NCNotificationShortLookViewController *) controller) notificationRequest];
}
}

if (!request || ![request content]) {
Expand Down Expand Up @@ -220,9 +221,6 @@ void override_NCNotificationShortLookView_didMoveToWindow(NCNotificationShortLoo
}
}

// this fixes a bug which causes the app name to disappear on long notification messages
[[self liddellTitleLabel] layoutIfNeeded];


// content label
if (pfShowMessage && ![self liddellContentLabel]) {
Expand Down Expand Up @@ -286,6 +284,10 @@ void override_NCNotificationShortLookView_didMoveToWindow(NCNotificationShortLoo
]];
}
}

// the title is hidden behind the content label if the content label is too long
// bringing it to the front fixes that issue
[[self liddellView] bringSubviewToFront:[self liddellTitleLabel]];
}

void (* orig_NCNotificationShortLookView__setGrabberVisible)(NCNotificationShortLookView* self, SEL _cmd, BOOL visible);
Expand Down

0 comments on commit de2d4fd

Please sign in to comment.