-
Notifications
You must be signed in to change notification settings - Fork 1k
Improve clipboard ring display in toolbox #5746
Conversation
|
Failure appears to be unrelated |
|
|
||
| clipboardRing.Add (newNode ?? CreateClipboardToolboxItem (text)); | ||
|
|
||
| while (clipboardRing.Count > clipboardRingSize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int overflow = clipboardRing.Count - clipboardRingSize;
if (overflow > 0) {
clipboardRing.RemoveRange (0, overflow);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is old code, but good point
| var item = new ClipboardToolboxNode (text); | ||
|
|
||
| string [] lines = text.Split ('\n'); | ||
| for (int i = 0; i < 3 && i < lines.Length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a reusable stringbuilder from the cache to build the description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, old code but this is redundant now since I added the custom tooltip
d3087e0 to
2d5606d
Compare
Therzok
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
22caba1 to
317c37b
Compare
The toolbox ellipsizes now, so this code no longer needs to. Also reduce allocations.
Apply feedback from @Therzok Remove redundant code, and use a more efficient overflow removal (even though it should never be needed)
317c37b to
5b7d0c1
Compare
Fixes #5709. Item titles are no longer ellipsized to 16 chars, and the tooltip shows a decent sized snippet.