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

Side by Side Diff: ui/views/examples/multiline_elision_example.cc

Issue 1953133002: [WIP: not for review] Reduce re-layout Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/views/examples/multiline_elision_example.h"
6
7 #include "ui/gfx/render_text.h"
8
9 namespace views {
10 namespace examples {
11
12 class MultilineElisionExample::ElidedRenderTextView
13 : public RenderTextView {
14 public:
15 ElidedRenderTextView() {
16 render_text()->SetElideBehavior(gfx::ELIDE_TAIL);
17 render_text()->SetMaxLines(2);
18 }
19
20 gfx::Size GetPreferredSize() const override { return gfx::Size(500, 40); }
21
22 private:
23 DISALLOW_COPY_AND_ASSIGN(ElidedRenderTextView);
24 };
25
26 MultilineElisionExample::MultilineElisionExample()
27 : MultilineExample("Multiline Elision Example") {}
28
29 MultilineElisionExample::~MultilineElisionExample() {}
30
31 MultilineExample::RenderTextView* MultilineElisionExample::CreateTextView() {
32 return new ElidedRenderTextView();
33 }
34
35 } // namespace examples
36 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698