diff options
author | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-14 05:32:24 +0000 |
---|---|---|
committer | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-14 05:32:24 +0000 |
commit | 1bb1a2b4618c1fdd457af425471737f67050aee3 (patch) | |
tree | 11205fcab2b834723c10b06168972a0ce8e56de6 /chrome/browser/chromeos/frame | |
parent | 397281fdb6003ab5b86ead542a46e3d82aa2be1f (diff) | |
download | chromium_src-1bb1a2b4618c1fdd457af425471737f67050aee3.zip chromium_src-1bb1a2b4618c1fdd457af425471737f67050aee3.tar.gz chromium_src-1bb1a2b4618c1fdd457af425471737f67050aee3.tar.bz2 |
Change the size of Keyboard Overlay and simplifies TrimMargins code.
The size is changed to the same size of the reference image.
I also modified TrimMargins because I found that I misused kRightMargin and kBottomMargin.
BUG=chromium-os:6268
TEST=manually on the netbook
Review URL: http://codereview.chromium.org/6482020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/frame')
-rw-r--r-- | chrome/browser/chromeos/frame/bubble_window.cc | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/chrome/browser/chromeos/frame/bubble_window.cc b/chrome/browser/chromeos/frame/bubble_window.cc index d295efa..6d3f3bb 100644 --- a/chrome/browser/chromeos/frame/bubble_window.cc +++ b/chrome/browser/chromeos/frame/bubble_window.cc @@ -56,13 +56,10 @@ void BubbleWindow::TrimMargins(int margin_left, int margin_right, int margin_top, int margin_bottom, int border_radius) { gfx::Size size = GetNonClientView()->GetPreferredSize(); - const int w = size.width(); - const int h = size.height(); - GdkRectangle rect0 = {0, border_radius, w - margin_right, - h - margin_bottom - 2 * border_radius}; - GdkRectangle rect1 = {border_radius, 0, - w - margin_right - 2 * border_radius, - h - margin_bottom}; + const int w = size.width() - margin_left - margin_right; + const int h = size.height() - margin_top - margin_bottom; + GdkRectangle rect0 = {0, border_radius, w, h - 2 * border_radius}; + GdkRectangle rect1 = {border_radius, 0, w - 2 * border_radius, h}; GdkRegion* region = gdk_region_rectangle(&rect0); gdk_region_union_with_rect(region, &rect1); @@ -76,9 +73,9 @@ void BubbleWindow::TrimMargins(int margin_left, int margin_right, } } // Top Right - for (int i = w - margin_right - border_radius - 1; i < w; ++i) { + for (int i = w - border_radius - 1; i < w; ++i) { for (int j = 0; j < border_radius; ++j) { - if (IsInsideCircle(i + 0.5, j + 0.5, w - margin_right - border_radius - 1, + if (IsInsideCircle(i + 0.5, j + 0.5, w - border_radius - 1, border_radius, border_radius)) { SetRegionUnionWithPoint(i, j, region); } @@ -86,20 +83,18 @@ void BubbleWindow::TrimMargins(int margin_left, int margin_right, } // Bottom Left for (int i = 0; i < border_radius; ++i) { - for (int j = h - margin_bottom - border_radius - 1; j < h; ++j) { - if (IsInsideCircle(i + 0.5, j + 0.5, border_radius, - h - margin_bottom - border_radius - 1, + for (int j = h - border_radius - 1; j < h; ++j) { + if (IsInsideCircle(i + 0.5, j + 0.5, border_radius, h - border_radius - 1, border_radius)) { SetRegionUnionWithPoint(i, j, region); } } } // Bottom Right - for (int i = w - margin_right - border_radius - 1; i < w; ++i) { - for (int j = h - margin_bottom - border_radius - 1; j < h; ++j) { - if (IsInsideCircle(i + 0.5, j + 0.5, w - margin_right - border_radius - 1, - h - margin_bottom - border_radius - 1, - border_radius)) { + for (int i = w - border_radius - 1; i < w; ++i) { + for (int j = h - border_radius - 1; j < h; ++j) { + if (IsInsideCircle(i + 0.5, j + 0.5, w - border_radius - 1, + h - border_radius - 1, border_radius)) { SetRegionUnionWithPoint(i, j, region); } } @@ -121,9 +116,9 @@ views::Window* BubbleWindow::Create( if (style == STYLE_XSHAPE) { const int kMarginLeft = 14; - const int kMarginRight = 28; + const int kMarginRight = 14; const int kMarginTop = 12; - const int kMarginBottom = 28; + const int kMarginBottom = 16; const int kBorderRadius = 8; window->TrimMargins(kMarginLeft, kMarginRight, kMarginTop, kMarginBottom, kBorderRadius); |