Permalink
Browse files

Update with fixes from R. Boucher

  • Loading branch information...
1 parent 7f4bfc5 commit 8d9d934b7f91a13e134eae371808e74f64f4ea3b @hlship committed Sep 14, 2009
Showing with 8 additions and 32 deletions.
  1. +4 −5 src/main/webapp/app/TwitView.j
  2. +4 −27 src/main/webapp/app/TwitterController.j
View
9 src/main/webapp/app/TwitView.j
@@ -13,15 +13,14 @@
_label = [[CPTextField alloc] initWithFrame:CGRectMakeZero()];
[_label setFont:[CPFont systemFontOfSize:12]];
[_label setTextColor:[CPColor whiteColor]];
- [_label setAutoresizingMask:CPViewWidthSizable];
+ [_label setAutoresizingMask:CPViewWidthSizable|CPViewHeightSizable];
+ [_label setFrame:[self bounds]];
+ [_label setLineBreakMode:CPLineBreakByWordWrapping];
+
[self addSubview:_label];
}
[_label setStringValue:obj.text];
-
- [_label setFrameSize:CGSizeMake(200, 60)];
-
- [_label setLineBreakMode:CPLineBreakByWordWrapping];
}
- (void)setSelected:(BOOL)isSelected
View
31 src/main/webapp/app/TwitterController.j
@@ -49,7 +49,7 @@
[itemPrototype setView:[[TwitView alloc] initWithFrame:CGRectMakeZero()]];
_timelineView = [[CPCollectionView alloc] initWithFrame:CGRectMake(0, 0,
- CGRectGetWidth(scrollViewBounds), 60)];
+ CGRectGetWidth(scrollViewBounds), 0)];
[_timelineView setItemPrototype:itemPrototype];
[_timelineView setDelegate:self];
[_timelineView setMaxNumberOfColumns:1];
@@ -58,35 +58,17 @@
[_scrollView setDocumentView:_timelineView];
- [[CPNotificationCenter defaultCenter]
- addObserver:self
- selector:@selector(scrollViewDidResize:)
- name:CPViewFrameDidChangeNotification
- object:_scrollView];
-
- // Will fire an initial notification because the value changed.
- [_scrollView setPostsFrameChangedNotifications:YES];
-
[content addSubview:label];
[content addSubview:_field];
[content addSubview:_scrollView];
+ [_timelineView setMinItemSize:CGSizeMake(200, 50)];
+ [_timelineView setMaxItemSize:CGSizeMake(100000, 50)];
+
return self;
}
-- (void)scrollViewDidResize:(id)notification
-{
- var bounds = [_scrollView bounds];
-
- CPLog.debug("new size: " + CPRectGetWidth(bounds) + " x " + CPRectGetHeight(bounds));
-
- var newSize = CGSizeMake(CPRectGetWidth(bounds), 60);
-
- [_timelineView setMinItemSize:newSize];
- [_timelineView setMaxItemSize:newSize];
-}
-
- (void)show
{
[_panel orderFront:self];
@@ -117,9 +99,4 @@
CPLog.error(error);
}
-- (void)adjustTimelineSize
-{
-
-}
-
@end

0 comments on commit 8d9d934

Please sign in to comment.