diff options
author | avayvod@chromium.org <avayvod@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 09:25:47 +0000 |
---|---|---|
committer | avayvod@chromium.org <avayvod@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 09:25:47 +0000 |
commit | df88db170b231a88d7318e650f4e23375fd0a911 (patch) | |
tree | 8e5a8300f9f7661959c7419aa56b01cf38df63df /chrome/browser/chromeos | |
parent | 551263e9ceac4ef7a022bec86c97276e6151f1ec (diff) | |
download | chromium_src-df88db170b231a88d7318e650f4e23375fd0a911.zip chromium_src-df88db170b231a88d7318e650f4e23375fd0a911.tar.gz chromium_src-df88db170b231a88d7318e650f4e23375fd0a911.tar.bz2 |
Fixed positions of label and border windows to avoid flickering on initial show of login screen.
BUG=cros:4356
TEST=Verify that no white rectangles flicker near user pods on initial show.
Review URL: http://codereview.chromium.org/2887002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51242 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
-rw-r--r-- | chrome/browser/chromeos/login/user_controller.cc | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/chrome/browser/chromeos/login/user_controller.cc b/chrome/browser/chromeos/login/user_controller.cc index a576f59..9187a2d 100644 --- a/chrome/browser/chromeos/login/user_controller.cc +++ b/chrome/browser/chromeos/login/user_controller.cc @@ -344,14 +344,14 @@ WidgetGtk* UserController::CreateControlsWindow(int index, int* height) { window->Init(NULL, gfx::Rect()); window->SetContentsView(control_view); window->SetWidgetDelegate(this); - *height = is_guest_ ? kUserImageSize + kControlsHeight - : control_view->GetPreferredSize().height(); std::vector<int> params; params.push_back(index); WmIpc::instance()->SetWindowType( window->GetNativeView(), WM_IPC_WINDOW_LOGIN_CONTROLS, ¶ms); + *height = is_guest_ ? kUserImageSize + kControlsHeight + : control_view->GetPreferredSize().height(); window->SetBounds(gfx::Rect(0, 0, kUserImageSize, *height)); window->Show(); return window; @@ -384,18 +384,18 @@ WidgetGtk* UserController::CreateImageWindow(int index) { void UserController::CreateBorderWindow(int index, int total_user_count, int controls_height) { + // Guest login controls window is much higher than exsisting user's controls + // window so window manager will place the control instead of image window. + int width = kUserImageSize + kBorderSize * 2; + int height = kBorderSize * 2 + controls_height; + if (!is_guest_) + height += kBorderSize + kUserImageSize; border_window_ = new WidgetGtk(WidgetGtk::TYPE_WINDOW); - border_window_->Init(NULL, gfx::Rect()); + border_window_->Init(NULL, gfx::Rect(0, 0, width, height)); border_window_->GetRootView()->set_background( views::Background::CreateSolidBackground(kBackgroundColor)); UpdateUserCount(index, total_user_count); - // Guest login controls window is much higher than exsisting user's controls - // window so window manager will place the control instead of image window. - int height = kBorderSize * 2 + controls_height; - height += is_guest_ ? 0 : kBorderSize + kUserImageSize; - border_window_->SetBounds(gfx::Rect(0, 0, kUserImageSize + kBorderSize * 2, - height)); border_window_->Show(); } @@ -418,11 +418,6 @@ WidgetGtk* UserController::CreateLabelWindow(int index, const gfx::Font& font = (type == WM_IPC_WINDOW_LOGIN_LABEL) ? rb.GetFont(ResourceBundle::LargeFont).DeriveFont(0, gfx::Font::BOLD) : rb.GetFont(ResourceBundle::BaseFont).DeriveFont(0, gfx::Font::BOLD); - int width = (type == WM_IPC_WINDOW_LOGIN_LABEL) ? - kUserImageSize : kUnselectedSize; - WidgetGtk* window = new ClickNotifyingWidget(WidgetGtk::TYPE_WINDOW, this); - window->MakeTransparent(); - window->Init(NULL, gfx::Rect()); std::wstring text = is_guest_ ? l10n_util::GetString(IDS_GUEST) : UTF8ToWide(user_.GetDisplayName()); views::Label* label = new views::Label(text); @@ -433,13 +428,17 @@ WidgetGtk* UserController::CreateLabelWindow(int index, else unselected_label_view_ = label; + int width = (type == WM_IPC_WINDOW_LOGIN_LABEL) ? + kUserImageSize : kUnselectedSize; + int height = label->GetPreferredSize().height(); + WidgetGtk* window = new ClickNotifyingWidget(WidgetGtk::TYPE_WINDOW, this); + window->MakeTransparent(); + window->Init(NULL, gfx::Rect(0, 0, width, height)); window->SetContentsView(label); - int height = label->GetPreferredSize().height(); std::vector<int> params; params.push_back(index); WmIpc::instance()->SetWindowType(window->GetNativeView(), type, ¶ms); - window->SetBounds(gfx::Rect(0, 0, width, height)); window->Show(); return window; } |