Skip to content
This repository was archived by the owner on May 2, 2021. It is now read-only.

Commit 52e8bfe

Browse files
author
Tae Won Ha
committedAug 30, 2013
#10 fixed test and implemented link size computation
1 parent 45b412e commit 52e8bfe

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎Qmind/QMCellSizeManager.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ - (NSSize)sizeOfCell:(QMCell *)cell {
3636
}
3737
}
3838

39+
if (cell.link != nil) {
40+
CGFloat linkDrawSize = [self.settings floatForKey:qSettingLinkIconDrawSize] + [self.settings floatForKey:qSettingLinkIconHorizontalMargin];
41+
result.width += linkDrawSize;
42+
result.height = MAX(linkDrawSize, result.height);
43+
}
44+
3945
if (trivialStringValue && countOfIcons == 0) {
4046
result.width = [self.settings floatForKey:qSettingNodeMinWidth];
4147
result.height = [self.settings floatForKey:qSettingNodeMinHeight];

‎QmindTest/QMCellSizeManagerTest.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ - (void)testSize8 {
200200

201201
cell.link = [NSURL URLWithString:@"http://qvacua.com"];
202202

203-
assertThatSize([manager sizeOfCell:cell], equalToSize(NewSize(1 * sizeOfLinkIcon + 1 * linkIconMargin + 4 * sizeOfIcon + 3 * interIconDist + iconTextDist + 2 * horPadding + 5, MAX(sizeOfIcon, sizeOfLinkIcon) + 2 * vertPadding)));
203+
assertThatSize([manager sizeOfCell:cell], equalToSize(NewSize(1 * sizeOfLinkIcon + 1 * linkIconMargin + 4 * sizeOfIcon + 3 * interIconDist + iconTextDist + 2 * horPadding + 5, 50 + 2 * vertPadding)));
204204
}
205205

206206
- (void)testSize9 {

0 commit comments

Comments
 (0)
This repository has been archived.