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

Side by Side Diff: views/controls/table/table_view.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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) 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/table/table_view.h" 5 #include "views/controls/table/table_view.h"
6 6
7 #include <commctrl.h> 7 #include <commctrl.h>
8 #include <windowsx.h> 8 #include <windowsx.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 1537
1538 gfx::Rect TableView::GetAltTextBounds() { 1538 gfx::Rect TableView::GetAltTextBounds() {
1539 static const int kXOffset = 16; 1539 static const int kXOffset = 16;
1540 DCHECK(GetNativeControlHWND()); 1540 DCHECK(GetNativeControlHWND());
1541 RECT client_rect_rect; 1541 RECT client_rect_rect;
1542 GetClientRect(GetNativeControlHWND(), &client_rect_rect); 1542 GetClientRect(GetNativeControlHWND(), &client_rect_rect);
1543 gfx::Rect client_rect(client_rect_rect); 1543 gfx::Rect client_rect(client_rect_rect);
1544 gfx::Font font = GetAltTextFont(); 1544 gfx::Font font = GetAltTextFont();
1545 // Pad height by 2 for halo. 1545 // Pad height by 2 for halo.
1546 return gfx::Rect(kXOffset, content_offset(), client_rect.width() - kXOffset, 1546 return gfx::Rect(kXOffset, content_offset(), client_rect.width() - kXOffset,
1547 std::max(kImageSize, font.height() + 2)); 1547 std::max(kImageSize, font.GetHeight() + 2));
1548 } 1548 }
1549 1549
1550 gfx::Font TableView::GetAltTextFont() { 1550 gfx::Font TableView::GetAltTextFont() {
1551 return ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont); 1551 return ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont);
1552 } 1552 }
1553 1553
1554 void TableView::VisibilityChanged(View* starting_from, bool is_visible) { 1554 void TableView::VisibilityChanged(View* starting_from, bool is_visible) {
1555 // GetClientRect as used by ResetColumnSize to obtain the total width 1555 // GetClientRect as used by ResetColumnSize to obtain the total width
1556 // available to the columns only works when the native control is visible, so 1556 // available to the columns only works when the native control is visible, so
1557 // update the column sizes in case we become visible. This depends on 1557 // update the column sizes in case we become visible. This depends on
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 } 1597 }
1598 1598
1599 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { 1599 void TableSelectionIterator::UpdateModelIndexFromViewIndex() {
1600 if (view_index_ == -1) 1600 if (view_index_ == -1)
1601 model_index_ = -1; 1601 model_index_ = -1;
1602 else 1602 else
1603 model_index_ = table_view_->ViewToModel(view_index_); 1603 model_index_ = table_view_->ViewToModel(view_index_);
1604 } 1604 }
1605 1605
1606 } // namespace views 1606 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/tabbed_pane/native_tabbed_pane_win.cc ('k') | views/controls/textfield/gtk_views_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698