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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 11830009: Fixes bug in painting multiple selected tabs. Specifically when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index a7aa6ba04399b7cf0a34d81efe8544c31a5de639..09dc10d4146a4eba2727aa412c5b03dffea6e3ca 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -1198,6 +1198,7 @@ void TabStrip::PaintChildren(gfx::Canvas* canvas) {
Tab* active_tab = NULL;
std::vector<Tab*> tabs_dragging;
std::vector<Tab*> selected_tabs;
+ int selected_tab_count = 0;
bool is_dragging = false;
int active_tab_index = -1;
// Since |touch_layout_| is created based on number of tabs and width we use
@@ -1213,6 +1214,8 @@ void TabStrip::PaintChildren(gfx::Canvas* canvas) {
for (int i = tab_count() - 1; i >= 0; --i) {
Tab* tab = tab_at(i);
+ if (tab->IsSelected())
+ selected_tab_count++;
if (tab->dragging() && !stacking) {
is_dragging = true;
if (tab->IsActive()) {
@@ -1251,13 +1254,11 @@ void TabStrip::PaintChildren(gfx::Canvas* canvas) {
canvas->Restore();
if (GetWidget()->ShouldUseNativeFrame()) {
- bool multiple_tabs_selected = (!selected_tabs.empty() ||
- tabs_dragging.size() > 1);
// Make sure non-active tabs are somewhat transparent.
SkPaint paint;
// If there are multiple tabs selected, fade non-selected tabs more to make
// the selected tabs more noticable.
- int alpha = multiple_tabs_selected ?
+ int alpha = selected_tab_count > 1 ?
kNativeFrameInactiveTabAlphaMultiSelection :
kNativeFrameInactiveTabAlpha;
paint.setColor(SkColorSetARGB(alpha, 255, 255, 255));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698