perf: reduce idle backend work

This commit is contained in:
Tunglies
2026-08-24 18:42:49 +08:00
parent eb6c81b00f
commit 9085d907cd
3 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -101,7 +101,10 @@ fn apply_status_item_attributed_title(status_item: &NSStatusItem, text: &NSStrin
let attrs = build_attributes(button.bounds().size.height);
let attrs: &NSDictionary<NSString, AnyObject> = &attrs;
let attr_str = create_attributed_string(text, Some(attrs));
status_item.setLength(status_item_length_for_speed(&attr_str));
let length = status_item_length_for_speed(&attr_str);
if status_item.length() != length {
status_item.setLength(length);
}
attr_str
} else {
create_attributed_string(text, None)