diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 10:50:48 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 10:50:48 +0000 |
commit | 9a3cc7af453ba2cfc5a938801bf95073a8808cd8 (patch) | |
tree | 988f842aa2b582ced05d13c5ad0accee4d5003d5 | |
parent | 45f18dc569f052b0e95f1abd22fcd90b5e8405f1 (diff) | |
download | chromium_src-9a3cc7af453ba2cfc5a938801bf95073a8808cd8.zip chromium_src-9a3cc7af453ba2cfc5a938801bf95073a8808cd8.tar.gz chromium_src-9a3cc7af453ba2cfc5a938801bf95073a8808cd8.tar.bz2 |
Revert 64225 - [cros] Fix UI issues on SignIn pod/user pod.
7. Textfield - focus border issue
9. Textfield - font size
11. Sign in - h padding
13,14 Link text & color.
Button minimal width - 90px.
BUG=chromium-os:8101
TEST=manual
Review URL: http://codereview.chromium.org/4179001
TBR=nkostylev@chromium.org
Review URL: http://codereview.chromium.org/4189005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64227 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/generated_resources.grd | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/existing_user_view.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/guest_user_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/helper.cc | 17 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/helper.h | 14 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/login_screen.cc | 10 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/message_bubble.cc | 3 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/network_selection_view.cc | 6 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/new_user_view.cc | 21 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/user_controller.cc | 5 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/user_image_view.cc | 2 | ||||
-rw-r--r-- | views/controls/link.cc | 2 |
12 files changed, 16 insertions, 76 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index f863d80..a0a9d15 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -8961,7 +8961,7 @@ Keep your key file in a safe place. You will need it to create new versions of y Can't access your account? </message> <message name="IDS_BROWSE_WITHOUT_SIGNING_IN_BUTTON"> - Skip sign-in and browse as Guest + Skip sign-in and go incognito </message> <message name="IDS_GO_INCOGNITO_BUTTON"> Go incognito diff --git a/chrome/browser/chromeos/login/existing_user_view.cc b/chrome/browser/chromeos/login/existing_user_view.cc index f24809a..919f530 100644 --- a/chrome/browser/chromeos/login/existing_user_view.cc +++ b/chrome/browser/chromeos/login/existing_user_view.cc @@ -5,7 +5,6 @@ #include "chrome/browser/chromeos/login/existing_user_view.h" #include "app/l10n_util.h" -#include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/user_controller.h" #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" #include "grit/generated_resources.h" @@ -63,7 +62,6 @@ void ExistingUserView::RecreateFields() { SetLayoutManager(new views::FillLayout); password_field_ = new UserEntryTextfield(user_controller_, views::Textfield::STYLE_PASSWORD); - login::CorrectTextfieldFontSize(password_field_); password_field_->SetFocusable(true); password_field_->SetController(user_controller_); AddChildView(password_field_); diff --git a/chrome/browser/chromeos/login/guest_user_view.cc b/chrome/browser/chromeos/login/guest_user_view.cc index 44dac3b22..c26db80 100644 --- a/chrome/browser/chromeos/login/guest_user_view.cc +++ b/chrome/browser/chromeos/login/guest_user_view.cc @@ -5,7 +5,6 @@ #include "chrome/browser/chromeos/login/guest_user_view.h" #include "app/l10n_util.h" -#include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/user_controller.h" #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" #include "grit/generated_resources.h" @@ -65,7 +64,6 @@ void GuestUserView::RecreateFields() { submit_button_ = new UserEntryButton( user_controller_, l10n_util::GetString(IDS_LOGIN_BUTTON)); - login::CorrectNativeButtonFontSize(submit_button_); AddChildView(submit_button_); Layout(); SchedulePaint(); @@ -104,13 +102,11 @@ void GuestUserView::OnLocaleChanged() { void GuestUserView::Layout() { gfx::Size submit_button_size = submit_button_->GetPreferredSize(); - int submit_button_width = std::max(login::kButtonMinWidth, - submit_button_size.width()); - int submit_button_x = (width() - submit_button_width) / 2; + int submit_button_x = (width() - submit_button_size.width()) / 2; int submit_button_y = (height() - submit_button_size.height()) / 2; submit_button_->SetBounds(submit_button_x, submit_button_y, - submit_button_width, + submit_button_size.width(), submit_button_size.height()); } diff --git a/chrome/browser/chromeos/login/helper.cc b/chrome/browser/chromeos/login/helper.cc index c3cec3e..d2da133 100644 --- a/chrome/browser/chromeos/login/helper.cc +++ b/chrome/browser/chromeos/login/helper.cc @@ -10,8 +10,6 @@ #include "googleurl/src/gurl.h" #include "grit/theme_resources.h" #include "third_party/skia/include/effects/SkGradientShader.h" -#include "views/controls/button/native_button.h" -#include "views/controls/textfield/textfield.h" #include "views/controls/throbber.h" #include "views/painter.h" #include "views/screen.h" @@ -20,13 +18,10 @@ namespace chromeos { namespace { -// Font size correction in points for login/oobe textfields/buttons. -const int kFontSizeCorrectionDelta = 2; - // Time in ms per throbber frame. const int kThrobberFrameMs = 60; -// Time in ms before smoothed throbber is shown. +// Time in ms before smothed throbber is shown. const int kThrobberStartDelayMs = 500; const SkColor kBackgroundCenterColor = SkColorSetRGB(41, 50, 67); @@ -99,16 +94,6 @@ gfx::Rect CalculateScreenBounds(const gfx::Size& size) { return bounds; } -void CorrectNativeButtonFontSize(views::NativeButton* button) { - if (button) - button->SetFont(button->font().DeriveFont(kFontSizeCorrectionDelta)); -} - -void CorrectTextfieldFontSize(views::Textfield* textfield) { - if (textfield) - textfield->SetFont(textfield->font().DeriveFont(kFontSizeCorrectionDelta)); -} - GURL GetAccountRecoveryHelpUrl() { return google_util::AppendGoogleLocaleParam(GURL(kAccountRecoveryHelpUrl)); } diff --git a/chrome/browser/chromeos/login/helper.h b/chrome/browser/chromeos/login/helper.h index 1dc4b02..ed700cd 100644 --- a/chrome/browser/chromeos/login/helper.h +++ b/chrome/browser/chromeos/login/helper.h @@ -18,9 +18,7 @@ class Size; } // namespace gfx namespace views { -class NativeButton; class Painter; -class Textfield; class Throbber; } // namespace views @@ -40,12 +38,6 @@ views::Painter* CreateBackgroundPainter(); // |size| is not empty. Otherwise the whole monitor is occupied. gfx::Rect CalculateScreenBounds(const gfx::Size& size); -// Corrects font size for NativeButton control. -void CorrectNativeButtonFontSize(views::NativeButton* button); - -// Corrects font size for Textfield control. -void CorrectTextfieldFontSize(views::Textfield* textfield); - // Returns URL used for account recovery. GURL GetAccountRecoveryHelpUrl(); @@ -58,9 +50,6 @@ enum Command { SIGN_OUT, }; -// Minimal width for the button. -const int kButtonMinWidth = 90; - // Gap between edge and image view, and image view and controls. const int kBorderSize = 6; @@ -73,9 +62,6 @@ const SkColor kBackgroundColor = SK_ColorWHITE; // Text color on the login controls. const SkColor kTextColor = SK_ColorWHITE; -// Default link color on login/OOBE controls. -const SkColor kLinkColor = 0xFF0066CC; - // Default size of the OOBE screen. Includes 10px shadow from each side. // See rounded_rect_painter.cc for border definitions. const int kWizardScreenWidth = 800; diff --git a/chrome/browser/chromeos/login/login_screen.cc b/chrome/browser/chromeos/login/login_screen.cc index 1f15775..ed838b0 100644 --- a/chrome/browser/chromeos/login/login_screen.cc +++ b/chrome/browser/chromeos/login/login_screen.cc @@ -27,18 +27,10 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" -namespace { - -// Considering 10px shadow from each side. -const int kLoginScreenWidth = 288; -const int kLoginScreenHeight = 318; - -} // anonymous namespace - namespace chromeos { LoginScreen::LoginScreen(WizardScreenDelegate* delegate) - : ViewScreen<NewUserView>(delegate, kLoginScreenWidth, kLoginScreenHeight), + : ViewScreen<NewUserView>(delegate), bubble_(NULL), authenticator_(NULL) { if (CrosLibrary::Get()->EnsureLoaded()) { diff --git a/chrome/browser/chromeos/login/message_bubble.cc b/chrome/browser/chromeos/login/message_bubble.cc index ab1ce1e..82cb775 100644 --- a/chrome/browser/chromeos/login/message_bubble.cc +++ b/chrome/browser/chromeos/login/message_bubble.cc @@ -6,7 +6,6 @@ #include "app/resource_bundle.h" #include "base/logging.h" -#include "chrome/browser/chromeos/login/helper.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "views/controls/button/image_button.h" @@ -79,8 +78,6 @@ MessageBubble::MessageBubble(views::WidgetGtk::Type type, layout->StartRowWithPadding(0, 1, 0, kBorderSize); help_link_ = new views::Link(help); help_link_->SetController(this); - help_link_->SetNormalColor(login::kLinkColor); - help_link_->SetHighlightedColor(login::kLinkColor); layout->AddView(help_link_); } } diff --git a/chrome/browser/chromeos/login/network_selection_view.cc b/chrome/browser/chromeos/login/network_selection_view.cc index cb8af46..62ca881 100644 --- a/chrome/browser/chromeos/login/network_selection_view.cc +++ b/chrome/browser/chromeos/login/network_selection_view.cc @@ -250,7 +250,9 @@ void NetworkSelectionView::InitLayout() { GridLayout::FIXED, dropdown_width, dropdown_width); column_set->AddPaddingColumn(1, kPaddingColumnWidth); - const int h_padding = 30; + const int h_padding = 30/*(screen_size.width() - 2 * kBorderSize - + connecting_network_label_->GetPreferredSize().width() - + throbber_->GetPreferredSize().width()) / 2*/; column_set = contents_layout->AddColumnSet(THROBBER_ROW); column_set->AddPaddingColumn(1, h_padding); column_set->AddColumn(GridLayout::TRAILING, GridLayout::CENTER, 0, @@ -329,8 +331,6 @@ void NetworkSelectionView::Init() { proxy_settings_link_->SetController(this); proxy_settings_link_->SetVisible(true); proxy_settings_link_->SetFocusable(true); - proxy_settings_link_->SetNormalColor(login::kLinkColor); - proxy_settings_link_->SetHighlightedColor(login::kLinkColor); UpdateLocalizedStrings(); } diff --git a/chrome/browser/chromeos/login/new_user_view.cc b/chrome/browser/chromeos/login/new_user_view.cc index 8e7fe7a..7c1b841 100644 --- a/chrome/browser/chromeos/login/new_user_view.cc +++ b/chrome/browser/chromeos/login/new_user_view.cc @@ -23,7 +23,6 @@ #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/rounded_rect_painter.h" #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" -#include "gfx/font.h" #include "grit/app_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -138,11 +137,9 @@ void NewUserView::Init() { AddChildView(splitter_); username_field_ = new UsernameField(); - login::CorrectTextfieldFontSize(username_field_); AddChildView(username_field_); password_field_ = new views::Textfield(views::Textfield::STYLE_PASSWORD); - login::CorrectTextfieldFontSize(password_field_); AddChildView(password_field_); throbber_ = CreateDefaultSmoothedThrobber(); @@ -167,7 +164,8 @@ void NewUserView::Init() { AddAccelerator(accel_login_off_the_record_); AddAccelerator(accel_enable_accessibility_); - OnLocaleChanged(); + UpdateLocalizedStrings(); + RequestFocus(); // Controller to handle events from textfields username_field_->SetController(this); @@ -212,8 +210,6 @@ void NewUserView::RecreatePeculiarControls() { // sized so delete and recreate the button on text update. delete sign_in_button_; sign_in_button_ = new views::NativeButton(this, std::wstring()); - ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - login::CorrectNativeButtonFontSize(sign_in_button_); UpdateSignInButtonState(); if (!CrosLibrary::Get()->EnsureLoaded()) @@ -290,10 +286,6 @@ void NewUserView::ViewHierarchyChanged(bool is_add, focus_grabber_factory_.NewRunnableMethod( &NewUserView::FocusFirstField)); WizardAccessibilityHelper::GetInstance()->MaybeEnableAccessibility(this); - } else if (is_add && (child == username_field_ || child == password_field_)) { - MessageLoop::current()->PostTask(FROM_HERE, - focus_grabber_factory_.NewRunnableMethod( - &NewUserView::Layout)); } } @@ -385,13 +377,8 @@ void NewUserView::Layout() { y += (setViewBounds(username_field_, x, y, width, true) + kRowPad); y += (setViewBounds(password_field_, x, y, width, true) + 3 * kRowPad); - int throbber_y = y; - int sign_in_button_width = - std::max(login::kButtonMinWidth, - sign_in_button_->GetPreferredSize().width()); - y += (setViewBounds(sign_in_button_, x, y, sign_in_button_width,true) + - kRowPad); + y += (setViewBounds(sign_in_button_, x, y, width, false) + kRowPad); setViewBounds(throbber_, x + width - throbber_->GetPreferredSize().width(), throbber_y + (sign_in_button_->GetPreferredSize().height() - @@ -526,8 +513,6 @@ void NewUserView::EnableInputControls(bool enabled) { void NewUserView::InitLink(views::Link** link) { *link = new views::Link(std::wstring()); (*link)->SetController(this); - (*link)->SetNormalColor(login::kLinkColor); - (*link)->SetHighlightedColor(login::kLinkColor); AddChildView(*link); } diff --git a/chrome/browser/chromeos/login/user_controller.cc b/chrome/browser/chromeos/login/user_controller.cc index 504ca84..fe63dc5 100644 --- a/chrome/browser/chromeos/login/user_controller.cc +++ b/chrome/browser/chromeos/login/user_controller.cc @@ -47,7 +47,7 @@ const int kUserNameGap = 4; // Approximate height of controls window, this constant is used in new user // case to make border window size close to existing users. -const int kControlsHeight = 28; +const int kControlsHeight = 26; // Widget that notifies window manager about clicking on itself. // Doesn't send anything if user is selected. @@ -365,11 +365,10 @@ WidgetGtk* UserController::CreateControlsWindow( if (is_new_user_) *height += kUserImageSize + kUserNameGap; - int width = kUserImageSize; WidgetGtk* window = new WidgetGtk(WidgetGtk::TYPE_WINDOW); ConfigureLoginWindow(window, index, - gfx::Rect(width, *height), + gfx::Rect(kUserImageSize, *height), WM_IPC_WINDOW_LOGIN_CONTROLS, control_view); return window; diff --git a/chrome/browser/chromeos/login/user_image_view.cc b/chrome/browser/chromeos/login/user_image_view.cc index 6256a62..755d143 100644 --- a/chrome/browser/chromeos/login/user_image_view.cc +++ b/chrome/browser/chromeos/login/user_image_view.cc @@ -33,6 +33,8 @@ const int kVerticalMargin = 10; const int kHorizontalPadding = 10; // Padding between vertically neighboring elements. const int kVerticalPadding = 10; +// Size for user image shown on the screen. +const int kUserImageSize = 256; // IDs of column sets for grid layout manager. enum ColumnSets { diff --git a/views/controls/link.cc b/views/controls/link.cc index b392902..141e5c4 100644 --- a/views/controls/link.cc +++ b/views/controls/link.cc @@ -179,7 +179,7 @@ std::string Link::GetClassName() const { } void Link::SetHighlightedColor(const SkColor& color) { - highlighted_color_ = color; + normal_color_ = color; ValidateStyle(); } |