aboutsummaryrefslogtreecommitdiff
path: root/src/OSDWindow.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2010-09-08 18:17:21 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2010-09-08 18:17:21 (GMT)
commit690d926ac444243611cd875fb84fabb4e6db2cf2 (patch)
treec8ef84056b295071f9a9207ffea5393c6cf4ad4d /src/OSDWindow.cc
parent1e8fe2bc14856fa16508686a28a85e72cb0e422c (diff)
downloadfluxbox-690d926ac444243611cd875fb84fabb4e6db2cf2.zip
fluxbox-690d926ac444243611cd875fb84fabb4e6db2cf2.tar.bz2
introduced FbTk::BidiString
a 'BidiString' holds both the logical content and the visual reordered version of the content of a string. this helps to reduce the number of calls to reorder the string before drawing it (as introduced in the patch from Ken Bloom) and to be more consistent in menus and textboxes (drawing cursors and underlining text).
Diffstat (limited to 'src/OSDWindow.cc')
-rw-r--r--src/OSDWindow.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/OSDWindow.cc b/src/OSDWindow.cc
index 005e07b..82090c5 100644
--- a/src/OSDWindow.cc
+++ b/src/OSDWindow.cc
@@ -57,19 +57,19 @@ void OSDWindow::reconfigTheme() {
57 57
58} 58}
59 59
60void OSDWindow::resize(const std::string &text) { 60void OSDWindow::resize(const FbTk::BiDiString &text) {
61 61
62 int h = m_theme->font().height() + m_theme->bevelWidth()*2; 62 int bw = 2 * m_theme->bevelWidth();
63 int w = m_theme->font().textWidth(text, text.size()) + 63 int h = m_theme->font().height() + bw;
64 m_theme->bevelWidth()*2; 64 int w = m_theme->font().textWidth(text) + bw;
65 FbTk::FbWindow::resize(w, h); 65 FbTk::FbWindow::resize(w, h);
66} 66}
67 67
68void OSDWindow::showText(const std::string &text) { 68void OSDWindow::showText(const FbTk::BiDiString &text) {
69 show(); 69 show();
70 clear(); 70 clear();
71 m_theme->font().drawText(*this, m_screen.screenNumber(), 71 m_theme->font().drawText(*this, m_screen.screenNumber(),
72 m_theme->iconbarTheme().text().textGC(), text, text.size(), 72 m_theme->iconbarTheme().text().textGC(), text,
73 m_theme->bevelWidth(), 73 m_theme->bevelWidth(),
74 m_theme->bevelWidth() + m_theme->font().ascent()); 74 m_theme->bevelWidth() + m_theme->font().ascent());
75} 75}