12
167
Fork
You've already forked fnott
32

Ellipsis on truncation #197

Closed
opened 2025年07月17日 23:27:20 +02:00 by cccslater · 1 comment

Hi,

Firstly, thanks for fnott, it's really fab (and crucially the only notification daemon I've found where swayfx can draw corners on each notification)!

I wondered if, when text is truncated, an ellipsis could be inserted? I'd love to try adding it myself but I'd need some pointers and am not strong on C :-)
I wondered if it would go in the function notif_layout in the section 'Finally, lay out the glyphs'?

Thank you!

Hi, Firstly, thanks for fnott, it's really fab (and crucially the only notification daemon I've found where swayfx can draw corners on each notification)! I wondered if, when text is truncated, an ellipsis could be inserted? I'd love to try adding it myself but I'd need some pointers and am not strong on C :-) I wondered if it would go in the function `notif_layout` in the section 'Finally, lay out the glyphs'? Thank you!
Owner
Copy link

I wondered if, when text is truncated, an ellipsis could be inserted? I'd love to try adding it myself but I'd need some pointers and am not strong on C :-)
I wondered if it would go in the function notif_layout in the section 'Finally, lay out the glyphs'?

Shouldn't be too hard to do. Yes, it's in notify_layout(). Here's where the x/y limits are checked:

Lines 1588 to 1605 in d321728
if ((x > left_pad && conf->max_width > 0 &&
x + glyph->advance.x + dist + right_pad > conf->max_width) ||
wc == U'\n')
{
*width = max(*width, x + right_pad);
*height += fonts->regular->height;
x = left_pad;
y += fonts->regular->height;
if (isc32space(wc)) {
/* Don't render trailing whitespace */
continue;
}
}
if (max_y >= 0 && y + fonts->regular->height > max_y)
break;
> I wondered if, when text is truncated, an ellipsis could be inserted? I'd love to try adding it myself but I'd need some pointers and am not strong on C :-) > I wondered if it would go in the function notif_layout in the section 'Finally, lay out the glyphs'? Shouldn't be too hard to do. Yes, it's in `notify_layout()`. Here's where the x/y limits are checked: https://codeberg.org/dnkl/fnott/src/commit/d3217285f15e65e2b92f4e716a30de7253e32749/notification.c#L1588-L1605
Sign in to join this conversation.
No Branch/Tag specified
master
releases/1.8
releases/1.7
releases/1.6
releases/1.5
release/1.4
parse-font-apply-fontconfig-rules
releases/1.3
releases/1.2
releases/1.1
releases/1.0
1.8.0
1.7.1
1.7.0
1.6.0
1.5.0
1.4.1
1.4.0
1.3.0
1.2.1
1.2.0
1.1.2
1.1.1
1.1.0
1.0.1
1.0.0
0.0.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/fnott#197
Reference in a new issue
dnkl/fnott
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?