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

Side by Side Diff: views/controls/menu/menu_scroll_view_container.cc

Issue 2812026: Auto-size the views version of the options dialog. (Closed)
Patch Set: Fix autosizing issue with gtk pref pages in chromeos options dialog. Created 10 years, 5 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 unified diff | Download patch
« no previous file with comments | « views/controls/button/native_button_win.cc ('k') | views/controls/native_control.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "views/controls/menu/menu_scroll_view_container.h" 5 #include "views/controls/menu/menu_scroll_view_container.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <uxtheme.h> 9 #include <uxtheme.h>
10 #include <Vssym32.h> 10 #include <Vssym32.h>
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 scroll_view_->SetBounds(x, scroll_view_y, width, content_height); 251 scroll_view_->SetBounds(x, scroll_view_y, width, content_height);
252 scroll_view_->Layout(); 252 scroll_view_->Layout();
253 } 253 }
254 254
255 void MenuScrollViewContainer::DidChangeBounds(const gfx::Rect& previous, 255 void MenuScrollViewContainer::DidChangeBounds(const gfx::Rect& previous,
256 const gfx::Rect& current) { 256 const gfx::Rect& current) {
257 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize(); 257 gfx::Size content_pref = scroll_view_->GetContents()->GetPreferredSize();
258 scroll_up_button_->SetVisible(content_pref.height() > height()); 258 scroll_up_button_->SetVisible(content_pref.height() > height());
259 scroll_down_button_->SetVisible(content_pref.height() > height()); 259 scroll_down_button_->SetVisible(content_pref.height() > height());
260 Layout();
260 } 261 }
261 262
262 gfx::Size MenuScrollViewContainer::GetPreferredSize() { 263 gfx::Size MenuScrollViewContainer::GetPreferredSize() {
263 gfx::Size prefsize = scroll_view_->GetContents()->GetPreferredSize(); 264 gfx::Size prefsize = scroll_view_->GetContents()->GetPreferredSize();
264 gfx::Insets insets = GetInsets(); 265 gfx::Insets insets = GetInsets();
265 prefsize.Enlarge(insets.width(), insets.height()); 266 prefsize.Enlarge(insets.width(), insets.height());
266 return prefsize; 267 return prefsize;
267 } 268 }
268 269
269 bool MenuScrollViewContainer::GetAccessibleRole( 270 bool MenuScrollViewContainer::GetAccessibleRole(
270 AccessibilityTypes::Role* role) { 271 AccessibilityTypes::Role* role) {
271 DCHECK(role); 272 DCHECK(role);
272 *role = AccessibilityTypes::ROLE_MENUPOPUP; 273 *role = AccessibilityTypes::ROLE_MENUPOPUP;
273 return true; 274 return true;
274 } 275 }
275 276
276 } // namespace views 277 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/button/native_button_win.cc ('k') | views/controls/native_control.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698