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

Unified Diff: chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm

Issue 2890233003: Dynamically Adjust Screen Item Size According To Item Count (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm
diff --git a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm
index 5a660e5ae02eb48254335505ca4a96028680c17b..28fcfc50ce807eb2ebbd54059e81663112d00775 100644
--- a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm
+++ b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm
@@ -40,6 +40,8 @@ const CGFloat kThumbnailWidth = 150;
const CGFloat kThumbnailHeight = 150;
const CGFloat kSingleScreenWidth = 300;
const CGFloat kSingleScreenHeight = 300;
+const CGFloat kMultipleScreenWidth = 220;
+const CGFloat kMultipleScreenHeight = 220;
const CGFloat kFramePadding = 20;
const CGFloat kControlSpacing = 10;
const CGFloat kExcessButtonPadding = 6;
@@ -601,7 +603,17 @@ NSString* const kTitleId = @"title";
// For screen source, if there is only one source, we can omit the label
// "Entire Screen", because it is redundant with tab label "Your Entire
// Screen".
- [item setTitleHidden:browser == screenBrowser_ && [items count] == 1];
+ if (browser == screenBrowser_) {
+ if ([items count] > 1) {
+ [item setTitleHidden:NO];
+ [screenBrowser_
+ setCellSize:NSMakeSize(kMultipleScreenWidth, kMultipleScreenHeight)];
+ } else {
+ [item setTitleHidden:YES];
+ [screenBrowser_
+ setCellSize:NSMakeSize(kSingleScreenWidth, kSingleScreenHeight)];
+ }
+ }
tapted 2017/05/22 04:54:47 what if bowser != screenBrowser_? The old code wou
qiangchen 2017/05/22 16:35:37 For those cases, we never setTitleHidden to YES at
return item;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698