diff options
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); |