diff options
author | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-07 14:11:41 +0000 |
---|---|---|
committer | deanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-07 14:11:41 +0000 |
commit | c7d4b80edc966b4355f3918ff65aec9ef1411dd1 (patch) | |
tree | 33a0c795429739da7bb70b6828f2f1be5431a053 /app/gfx | |
parent | 7484a05d5c4d11ec8583ea5feffc509d3de2957f (diff) | |
download | chromium_src-c7d4b80edc966b4355f3918ff65aec9ef1411dd1.zip chromium_src-c7d4b80edc966b4355f3918ff65aec9ef1411dd1.tar.gz chromium_src-c7d4b80edc966b4355f3918ff65aec9ef1411dd1.tar.bz2 |
Honor MULTI_LINE, CHARACTER_BREAK, and NO_ELLIPSIS in Linux ChromeCanvas.
Review URL: http://codereview.chromium.org/113098
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/gfx')
-rw-r--r-- | app/gfx/chrome_canvas_linux.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/gfx/chrome_canvas_linux.cc b/app/gfx/chrome_canvas_linux.cc index 0c79f3a..d875f2d 100644 --- a/app/gfx/chrome_canvas_linux.cc +++ b/app/gfx/chrome_canvas_linux.cc @@ -101,6 +101,14 @@ void ChromeCanvas::DrawStringInt(const std::wstring& text, pango_layout_set_alignment(layout, PANGO_ALIGN_RIGHT); } + if (flags & MULTI_LINE) { + pango_layout_set_wrap(layout, + (flags & CHARACTER_BREAK) ? PANGO_WRAP_WORD_CHAR : PANGO_WRAP_WORD); + } + + if (flags & NO_ELLIPSIS) + pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); + std::string utf8 = WideToUTF8(text); pango_layout_set_text(layout, utf8.data(), utf8.size()); |