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

Unified Diff: ui/app_list/views/app_list_item_view.cc

Issue 23709003: Display an app's short name in the app launcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
Index: ui/app_list/views/app_list_item_view.cc
diff --git a/ui/app_list/views/app_list_item_view.cc b/ui/app_list/views/app_list_item_view.cc
index 1b9aaf701d1273807d552101b9005f5947adaa1d..2c65045676d7aa958cac130dff662a393deb001a 100644
--- a/ui/app_list/views/app_list_item_view.cc
+++ b/ui/app_list/views/app_list_item_view.cc
@@ -130,6 +130,11 @@ void AppListItemView::UpdateIcon() {
icon_->SetImage(resized);
}
+void AppListItemView::UpdateTooltip() {
+ title_->SetTooltipText(model_->title() == model_->full_name() ?
+ string16() : UTF8ToUTF16(model_->full_name()));
benwells 2013/08/29 09:14:15 I think the correct indenting here is to go in ano
tmdiep 2013/08/30 02:48:13 Done.
+}
+
void AppListItemView::SetUIState(UIState state) {
if (ui_state_ == state)
return;
@@ -193,9 +198,14 @@ void AppListItemView::ItemIconChanged() {
void AppListItemView::ItemTitleChanged() {
title_->SetText(UTF8ToUTF16(model_->title()));
title_->Invalidate();
+ UpdateTooltip();
Layout();
}
+void AppListItemView::ItemFullNameChanged() {
+ UpdateTooltip();
+}
+
void AppListItemView::ItemHighlightedChanged() {
apps_grid_view_->EnsureViewVisible(this);
SchedulePaint();

Powered by Google App Engine
This is Rietveld 408576698