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

Side by Side Diff: snapshot_window.cc

Issue 2867041: This fixes a problem with fav icon opacity, and initial panning position. (Closed) Base URL: ssh://git@chromiumos-git//window_manager.git
Patch Set: Created 10 years, 5 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 unified diff | Download patch
« no previous file with comments | « layout_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "window_manager/snapshot_window.h" 5 #include "window_manager/snapshot_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <tr1/memory> 9 #include <tr1/memory>
10 10
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 // manager region. 228 // manager region.
229 float snapshot_scale_x = static_cast<float>(layout_manager_->width()) / 229 float snapshot_scale_x = static_cast<float>(layout_manager_->width()) /
230 win_->client_width(); 230 win_->client_width();
231 float snapshot_scale_y = static_cast<float>(layout_manager_->height()) / 231 float snapshot_scale_y = static_cast<float>(layout_manager_->height()) /
232 win_->client_height(); 232 win_->client_height();
233 win_->ScaleComposited(snapshot_scale_x, snapshot_scale_y, anim_ms); 233 win_->ScaleComposited(snapshot_scale_x, snapshot_scale_y, anim_ms);
234 win_->actor()->ShowDimmed(false, anim_ms); 234 win_->actor()->ShowDimmed(false, anim_ms);
235 win_->actor()->SetTilt(0.0, anim_ms); 235 win_->actor()->SetTilt(0.0, anim_ms);
236 win_->MoveComposited(layout_manager_->x(), layout_manager_->y(), anim_ms); 236 win_->MoveComposited(layout_manager_->x(), layout_manager_->y(), anim_ms);
237 if (fav_icon_) { 237 if (fav_icon_) {
238 fav_icon_->SetCompositedOpacity(1.0f, 0);
238 fav_icon_->MoveComposited(layout_manager_->x(), 239 fav_icon_->MoveComposited(layout_manager_->x(),
239 kTitlePadding + layout_manager_->y() + 240 kTitlePadding + layout_manager_->y() +
240 win_->client_height() * snapshot_scale_y, 241 win_->client_height() * snapshot_scale_y,
241 anim_ms); 242 anim_ms);
242 } 243 }
243 if (title_) { 244 if (title_) {
244 title_->SetCompositedOpacity(1.0f, 0); 245 title_->SetCompositedOpacity(1.0f, 0);
245 int x_position = layout_manager_->x(); 246 int x_position = layout_manager_->x();
246 if (fav_icon_) { 247 if (fav_icon_) {
247 x_position += fav_icon_->composited_width() + 248 x_position += fav_icon_->composited_width() +
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // The snapshot should cover the screen. 285 // The snapshot should cover the screen.
285 float snapshot_scale_x = static_cast<float>(layout_manager_->width()) / 286 float snapshot_scale_x = static_cast<float>(layout_manager_->width()) /
286 win_->client_width(); 287 win_->client_width();
287 float snapshot_scale_y = static_cast<float>(layout_manager_->height()) / 288 float snapshot_scale_y = static_cast<float>(layout_manager_->height()) /
288 win_->client_height(); 289 win_->client_height();
289 290
290 win_->ScaleComposited(snapshot_scale_x, snapshot_scale_y, 0); 291 win_->ScaleComposited(snapshot_scale_x, snapshot_scale_y, 0);
291 win_->MoveComposited(layout_manager_->x(), layout_manager_->y(), 0); 292 win_->MoveComposited(layout_manager_->x(), layout_manager_->y(), 0);
292 if (state_ == STATE_OVERVIEW_MODE_SELECTED) { 293 if (state_ == STATE_OVERVIEW_MODE_SELECTED) {
293 if (fav_icon_) { 294 if (fav_icon_) {
295 fav_icon_->SetCompositedOpacity(1.0f, 0);
294 fav_icon_->MoveComposited(layout_manager_->x(), 296 fav_icon_->MoveComposited(layout_manager_->x(),
295 kTitlePadding + layout_manager_->y() + 297 kTitlePadding + layout_manager_->y() +
296 win_->client_height() * snapshot_scale_y, 0); 298 win_->client_height() * snapshot_scale_y, 0);
297 } 299 }
298 300
299 if (title_) { 301 if (title_) {
300 title_->SetCompositedOpacity(1.0f, 0); 302 title_->SetCompositedOpacity(1.0f, 0);
301 int x_position = layout_manager_->x(); 303 int x_position = layout_manager_->x();
302 if (fav_icon_) { 304 if (fav_icon_) {
303 x_position += fav_icon_->composited_width() + 305 x_position += fav_icon_->composited_width() +
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 input_width, 351 input_width,
350 overview_height_); 352 overview_height_);
351 353
352 win_->actor()->ShowDimmed(state_ == STATE_OVERVIEW_MODE_NORMAL, anim_ms); 354 win_->actor()->ShowDimmed(state_ == STATE_OVERVIEW_MODE_NORMAL, anim_ms);
353 win_->actor()->SetTilt(new_tilt, anim_ms); 355 win_->actor()->SetTilt(new_tilt, anim_ms);
354 win_->ScaleComposited(overview_scale_, overview_scale_, anim_ms); 356 win_->ScaleComposited(overview_scale_, overview_scale_, anim_ms);
355 win_->MoveComposited(absolute_overview_x, absolute_overview_y, anim_ms); 357 win_->MoveComposited(absolute_overview_x, absolute_overview_y, anim_ms);
356 358
357 int title_y = kTitlePadding + absolute_overview_y + 359 int title_y = kTitlePadding + absolute_overview_y +
358 win_->client_height() * overview_scale_; 360 win_->client_height() * overview_scale_;
359 if (fav_icon_) 361 if (fav_icon_) {
362 fav_icon_->SetCompositedOpacity(1.0f, opacity_anim_ms);
360 fav_icon_->MoveComposited(absolute_overview_x, title_y, anim_ms); 363 fav_icon_->MoveComposited(absolute_overview_x, title_y, anim_ms);
364 }
361 365
362 if (title_) { 366 if (title_) {
363 if (state_ == STATE_OVERVIEW_MODE_SELECTED) { 367 if (state_ == STATE_OVERVIEW_MODE_SELECTED) {
364 title_->SetCompositedOpacity(1.0f, opacity_anim_ms); 368 title_->SetCompositedOpacity(1.0f, opacity_anim_ms);
365 } else { 369 } else {
366 title_->SetCompositedOpacity(0.0f, opacity_anim_ms); 370 title_->SetCompositedOpacity(0.0f, opacity_anim_ms);
367 } 371 }
368 int x_position = absolute_overview_x; 372 int x_position = absolute_overview_x;
369 if (fav_icon_) { 373 if (fav_icon_) {
370 x_position += fav_icon_->composited_width() + 374 x_position += fav_icon_->composited_width() +
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 if (layout_manager_->current_snapshot() == this) { 411 if (layout_manager_->current_snapshot() == this) {
408 // If we're already the current snapshot, then switch modes to ACTIVE mode. 412 // If we're already the current snapshot, then switch modes to ACTIVE mode.
409 layout_manager_->SetMode(LayoutManager::MODE_ACTIVE); 413 layout_manager_->SetMode(LayoutManager::MODE_ACTIVE);
410 } else { 414 } else {
411 layout_manager_->SetCurrentSnapshotWithClick(this, timestamp, x, y); 415 layout_manager_->SetCurrentSnapshotWithClick(this, timestamp, x, y);
412 layout_manager_->LayoutWindows(true); 416 layout_manager_->LayoutWindows(true);
413 } 417 }
414 } 418 }
415 419
416 } // namespace window_manager 420 } // namespace window_manager
OLDNEW
« no previous file with comments | « layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698