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

Side by Side Diff: views/controls/scrollbar/native_scroll_bar_gtk.cc

Issue 6462022: It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/scrollbar/native_scroll_bar_gtk.h" 5 #include "views/controls/scrollbar/native_scroll_bar_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "ui/base/keycodes/keyboard_codes_posix.h" 9 #include "ui/base/keycodes/keyboard_codes_posix.h"
10 #include "views/controls/scrollbar/native_scroll_bar.h" 10 #include "views/controls/scrollbar/native_scroll_bar.h"
(...skipping 10 matching lines...) Expand all
21 set_focus_view(scroll_bar); 21 set_focus_view(scroll_bar);
22 } 22 }
23 23
24 NativeScrollBarGtk::~NativeScrollBarGtk() { 24 NativeScrollBarGtk::~NativeScrollBarGtk() {
25 } 25 }
26 26
27 //////////////////////////////////////////////////////////////////////////////// 27 ////////////////////////////////////////////////////////////////////////////////
28 // NativeScrollBarGtk, View overrides: 28 // NativeScrollBarGtk, View overrides:
29 29
30 void NativeScrollBarGtk::Layout() { 30 void NativeScrollBarGtk::Layout() {
31 SetBoundsRect(native_scroll_bar_->GetContentsBounds()); 31 SetBoundsRect(native_scroll_bar_->GetLocalBounds());
32 NativeControlGtk::Layout(); 32 NativeControlGtk::Layout();
33 } 33 }
34 34
35 gfx::Size NativeScrollBarGtk::GetPreferredSize() { 35 gfx::Size NativeScrollBarGtk::GetPreferredSize() {
36 if (native_scroll_bar_->IsHorizontal()) 36 if (native_scroll_bar_->IsHorizontal())
37 return gfx::Size(0, GetHorizontalScrollBarHeight()); 37 return gfx::Size(0, GetHorizontalScrollBarHeight());
38 return gfx::Size(GetVerticalScrollBarWidth(), 0); 38 return gfx::Size(GetVerticalScrollBarWidth(), 0);
39 } 39 }
40 40
41 // TODO(oshima|jcampan): key/mouse events are not delievered and 41 // TODO(oshima|jcampan): key/mouse events are not delievered and
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 return 20; 208 return 20;
209 } 209 }
210 210
211 // static 211 // static
212 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() { 212 int NativeScrollBarWrapper::GetVerticalScrollBarWidth() {
213 // TODO(oshima): get this from gtk's widget property "slider-width". 213 // TODO(oshima): get this from gtk's widget property "slider-width".
214 return 20; 214 return 20;
215 } 215 }
216 216
217 } // namespace views 217 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698