Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Unified Diff: ui/app_list/cocoa/app_list_view_controller.mm

Issue 14999013: Allow pages on the OSX app launcher to be turned while dragging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests! Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/app_list/cocoa/app_list_view_controller.mm
diff --git a/ui/app_list/cocoa/app_list_view_controller.mm b/ui/app_list/cocoa/app_list_view_controller.mm
index e9d5ed193f9dacb2606856f820b720b77631fe6d..d0f82e70c31edea0ad0c3e370afd4eaac8f7d1df 100644
--- a/ui/app_list/cocoa/app_list_view_controller.mm
+++ b/ui/app_list/cocoa/app_list_view_controller.mm
@@ -18,8 +18,6 @@ const CGFloat kBubbleCornerRadius = 3;
// Height of the pager.
const CGFloat kPagerPreferredHeight = 57;
-// Padding between the bottom of the grid and the bottom of the view.
-const CGFloat kViewGridOffsetY = 41;
// Padding between the top of the grid and the top of the view.
// TODO(tapted): Update padding when the search entry control is added.
@@ -52,6 +50,10 @@ const CGFloat kMaxSegmentWidth = 80;
[NSGraphicsContext restoreGraphicsState];
}
+- (BOOL)isFlipped {
tapted 2013/05/17 04:24:15 note: this keeps things consistent w.r.t. the drag
+ return YES;
+}
+
@end
@interface AppListViewController ()
@@ -105,16 +107,15 @@ const CGFloat kMaxSegmentWidth = 80;
[pagerControl_ setTarget:appsGridController_];
[pagerControl_ setAction:@selector(onPagerClicked:)];
- [[appsGridController_ view] setFrameOrigin:NSMakePoint(0, kViewGridOffsetY)];
+ [[appsGridController_ view] setFrameOrigin:NSMakePoint(0, kTopPadding)];
NSRect backgroundRect = [[appsGridController_ view] bounds];
- backgroundRect.size.height += kViewGridOffsetY + kTopPadding;
+ backgroundRect.size.height += kPagerPreferredHeight;
scoped_nsobject<BackgroundView> backgroundView(
[[BackgroundView alloc] initWithFrame:backgroundRect]);
NSRect searchInputRect =
- NSMakeRect(0, NSMaxY(backgroundRect) - kSearchInputHeight,
- backgroundRect.size.width, kSearchInputHeight);
+ NSMakeRect(0, 0, backgroundRect.size.width, kSearchInputHeight);
scoped_nsobject<NSTextField> searchInput(
[[NSTextField alloc] initWithFrame:searchInputRect]);
[searchInput setDelegate:self];
@@ -145,7 +146,7 @@ const CGFloat kMaxSegmentWidth = 80;
[pagerControl_ sizeToFit];
[pagerControl_ setFrame:
NSMakeRect(NSMidX(viewFrame) - NSMidX([pagerControl_ bounds]),
- 0,
+ viewFrame.size.height - kPagerPreferredHeight,
[pagerControl_ bounds].size.width,
kPagerPreferredHeight)];
}
@@ -158,6 +159,10 @@ const CGFloat kMaxSegmentWidth = 80;
[pagerControl_ setNeedsDisplay:YES];
}
+- (NSInteger)pagerSegmentAtLocation:(NSPoint)locationInWindow {
+ return [pagerControl_ getSegmentAndHighlight:locationInWindow];
+}
+
- (BOOL)control:(NSControl*)control
textView:(NSTextView*)textView
doCommandBySelector:(SEL)command {

Powered by Google App Engine
This is Rietveld 408576698