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

Unified Diff: chrome/browser/chromeos/status/status_area_view.cc

Issue 6904160: Implement new gray mock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed power test Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/status/status_area_view.cc
diff --git a/chrome/browser/chromeos/status/status_area_view.cc b/chrome/browser/chromeos/status/status_area_view.cc
index 81dd39eb80b66db033f2ad3e3b928bf86eb123e0..605dcfe688fe7b064644fe19acf4ff9c3542b0e5 100644
--- a/chrome/browser/chromeos/status/status_area_view.cc
+++ b/chrome/browser/chromeos/status/status_area_view.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,12 +12,16 @@
#include "chrome/browser/chromeos/status/power_menu_button.h"
#include "chrome/browser/chromeos/status/status_area_host.h"
#include "chrome/browser/chromeos/status/window_switcher_button.h"
+#include "grit/theme_resources.h"
+#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
+#include "views/border.h"
+#include "views/controls/image_view.h"
namespace chromeos {
// Number of pixels to separate each icon.
-const int kSeparation = 1;
+const int kSeparation = 5;
StatusAreaView::StatusAreaView(StatusAreaHost* host)
: host_(host),
@@ -31,6 +35,7 @@ StatusAreaView::StatusAreaView(StatusAreaHost* host)
void StatusAreaView::Init() {
// Clock.
clock_view_ = new ClockMenuButton(host_);
+ clock_view_->set_border(views::Border::CreateEmptyBorder(0, 1, 0, 0));
AddChildView(clock_view_);
// InputMethod.
@@ -42,7 +47,7 @@ void StatusAreaView::Init() {
AddChildView(network_view_);
// Power.
- power_view_ = new PowerMenuButton();
+ power_view_ = new PowerMenuButton(host_);
AddChildView(power_view_);
// Window Switcher.
@@ -53,9 +58,11 @@ void StatusAreaView::Init() {
gfx::Size StatusAreaView::GetPreferredSize() {
int result_w = kSeparation;
int result_h = 0;
+ int visible_count = 0;
for (int i = 0; i < child_count(); i++) {
views::View* cur = GetChildViewAt(i);
if (cur->IsVisible()) {
+ visible_count++;
gfx::Size cur_size = cur->GetPreferredSize();
// Add each width.
result_w += cur_size.width() + kSeparation;
@@ -63,6 +70,8 @@ gfx::Size StatusAreaView::GetPreferredSize() {
result_h = std::max(result_h, cur_size.height());
}
}
+ if (visible_count > 0)
+ result_w -= kSeparation;
return gfx::Size(result_w, result_h);
}

Powered by Google App Engine
This is Rietveld 408576698