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

Side by Side Diff: ui/message_center/notification_view.cc

Issue 11636043: Added ellipses when the title of notifications is too long. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium 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 "ui/message_center/notification_view.h" 5 #include "ui/message_center/notification_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "ui/base/accessibility/accessible_view_state.h" 9 #include "ui/base/accessibility/accessible_view_state.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 icon->SetVerticalAlignment(views::ImageView::LEADING); 139 icon->SetVerticalAlignment(views::ImageView::LEADING);
140 icon->set_border(MakePadding(kIconTopPadding, kIconLeftPadding, 140 icon->set_border(MakePadding(kIconTopPadding, kIconLeftPadding,
141 kIconBottomPadding, kIconToTextPadding)); 141 kIconBottomPadding, kIconToTextPadding));
142 layout->AddView(icon, 1, 2 + notification_.items.size()); 142 layout->AddView(icon, 1, 2 + notification_.items.size());
143 143
144 // First row: Title. This vertically spans the close button padding row and 144 // First row: Title. This vertically spans the close button padding row and
145 // the close button row. 145 // the close button row.
146 // TODO(dharcourt): Skip the title Label when there's no title text. 146 // TODO(dharcourt): Skip the title Label when there's no title text.
147 views::Label* title = new views::Label(notification_.title); 147 views::Label* title = new views::Label(notification_.title);
148 title->SetHorizontalAlignment(gfx::ALIGN_LEFT); 148 title->SetHorizontalAlignment(gfx::ALIGN_LEFT);
149 title->SetElideBehavior(views::Label::ELIDE_AT_END);
149 title->SetFont(title->font().DeriveFont(4)); 150 title->SetFont(title->font().DeriveFont(4));
150 title->SetEnabledColor(kTitleColor); 151 title->SetEnabledColor(kTitleColor);
151 title->SetBackgroundColor(kTitleBackgroundColor); 152 title->SetBackgroundColor(kTitleBackgroundColor);
152 title->set_border(MakePadding(kTextTopPadding, 0, 3, kTextToClosePadding)); 153 title->set_border(MakePadding(kTextTopPadding, 0, 3, kTextToClosePadding));
153 layout->AddView(title, 1, 2); 154 layout->AddView(title, 1, 2);
154 155
155 // First row: Close button padding. 156 // First row: Close button padding.
156 views::View* padding = new views::ImageView(); 157 views::View* padding = new views::ImageView();
157 padding->set_border(MakePadding(kCloseTopPadding, 1, 0, 0)); 158 padding->set_border(MakePadding(kCloseTopPadding, 1, 0, 0));
158 layout->AddView(padding); 159 layout->AddView(padding);
(...skipping 13 matching lines...) Expand all
172 layout->StartRow(0, 0); 173 layout->StartRow(0, 0);
173 layout->SkipColumns(1); 174 layout->SkipColumns(1);
174 ItemView* item = new ItemView(notification_.items[i]); 175 ItemView* item = new ItemView(notification_.items[i]);
175 item->set_border(MakePadding(0, 0, bottom_padding, kTextToClosePadding)); 176 item->set_border(MakePadding(0, 0, bottom_padding, kTextToClosePadding));
176 layout->AddView(item); 177 layout->AddView(item);
177 layout->SkipColumns(1); 178 layout->SkipColumns(1);
178 } 179 }
179 } 180 }
180 181
181 } // namespace message_center 182 } // namespace message_center
OLDNEW
« 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