Skip to content
Snippets Groups Projects
Commit 0aae5e7c authored by George Nachman's avatar George Nachman
Browse files

Fix bug where tags weren't visible in toolbelt profiles list because the cells...

Fix bug where tags weren't visible in toolbelt profiles list because the cells weren't tall enough because nstableview is a big old mess. Issue 6056
parent 3f99c189
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -477,15 +477,22 @@ const CGFloat kDefaultTagsWidth = 80;
- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)rowIndex {
NSAttributedString *attributedString = [self tableView:tableView objectValueForTableColumn:tableColumn_ row:rowIndex];
// tableview is a mess. Add some points so it works. Who knows why.
CGFloat height = [attributedString heightForWidth:tableColumn_.width] + [self extraHeight];
Profile *profile = [dataSource_ profileAtIndex:rowIndex];
const BOOL hasTags = ([profile[KEY_TAGS] count] > 0);
CGFloat height = [attributedString heightForWidth:tableColumn_.width] + [self extraHeightWithTags:hasTags];
 
_savedHeights[@(rowIndex)] = @(height);
return height;
}
 
- (CGFloat)extraHeight {
- (CGFloat)extraHeightWithTags:(BOOL)hasTags {
if (self.mainFont.pointSize <= [NSFont smallSystemFontSize]) {
return 1;
if (hasTags) {
return 2;
} else {
return 1;
}
} else {
return 2;
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment