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

Unified Diff: ui/views/examples/label_example.cc

Issue 2413223003: Views:: Make Labels support text selection. (Closed)
Patch Set: Created 4 years, 2 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/views/examples/label_example.cc
diff --git a/ui/views/examples/label_example.cc b/ui/views/examples/label_example.cc
index 6683626e376dde7e3cbf1a7852e22064f5456e94..42fb899f3db9321c9044ab58eb3092e14b3c91cc 100644
--- a/ui/views/examples/label_example.cc
+++ b/ui/views/examples/label_example.cc
@@ -115,6 +115,14 @@ void LabelExample::CreateExampleView(View* container) {
label->SetBorder(Border::CreateSolidBorder(20, SK_ColorRED));
container->AddChildView(label);
+ label = new Label(
+ ASCIIToUTF16("A selectable label with custom colors for text."));
+ label->SetSelectionTextColor(SK_ColorBLUE);
+ label->SetSelectionBackgroundColor(SK_ColorYELLOW);
+ label->SetEnabledColor(SK_ColorRED);
+ label->SetSelectable(true);
+ container->AddChildView(label);
+
AddCustomLabel(container);
}

Powered by Google App Engine
This is Rietveld 408576698