Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix the title being covered #3976

Closed

Conversation

Allsochen
Copy link
Contributor

@Allsochen Allsochen commented Dec 13, 2024

fix the title being covered.

Before fixed:
image

After fixed:
image

@lwouis
Copy link
Owner

lwouis commented Dec 13, 2024

Hi @Allsochen,

Thank you for sharing another PR!

Could you please share a bit more context about this PR? I've worked a lot on #814 in the past. I couldn't find a solution. It seems that you just change the font size here, for the small size.

Is this a quick-win perhaps? If you have any input on #814, i would be very interested.

Thank you!

@Allsochen
Copy link
Contributor Author

Hi @Allsochen,

Thank you for sharing another PR!

Could you please share a bit more context about this PR? I've worked a lot on #814 in the past. I couldn't find a solution. It seems that you just change the font size here, for the small size.

Is this a quick-win perhaps? If you have any input on #814, i would be very interested.

Thank you!

I didn't notice the problem with #184 before, but the latest code I submitted has fixed the problem.

@Allsochen Allsochen changed the title fix: fix small window title being covered fix: fix title being covered Dec 16, 2024
@Allsochen Allsochen changed the title fix: fix title being covered fix: fix the title being covered Dec 16, 2024
@@ -37,6 +41,24 @@ class ThumbnailTitleView: BaseLabel {
return .byTruncatingHead
}

override func draw(_ dirtyRect: NSRect) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please share why this override is necessary? What does it change compared to the native implementation? We should probably add a comment to clarify this, so that reads can understand this change better 👍

@@ -60,7 +82,11 @@ class ThumbnailTitleView: BaseLabel {
return ceil(textSize.width)
}

static func extraLineSpacing(for fontSize: CGFloat) -> CGFloat {
return fontSize * 0.2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine that 20% margin comes from your testing? Less than 20% didn't work in your tests?
Thank you

@lwouis
Copy link
Owner

lwouis commented Dec 25, 2024

I've merged parts of this. I've also reworked the titles to use NSTextField instead of NSTextView. So it's a bit different now. I think the issue shown in your screenshot should be gone now.

Thank you

@lwouis lwouis closed this Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants