aboutsummaryrefslogtreecommitdiff
path: root/src/TooltipWindow.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/TooltipWindow.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/TooltipWindow.cc')
-rw-r--r--src/TooltipWindow.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/TooltipWindow.cc b/src/TooltipWindow.cc
index 284f232..79d4163 100644
--- a/src/TooltipWindow.cc
+++ b/src/TooltipWindow.cc
@@ -38,7 +38,7 @@ TooltipWindow::TooltipWindow(const FbTk::FbWindow &parent, BScreen &screen,
38 38
39} 39}
40 40
41void TooltipWindow::showText(const std::string &text) { 41void TooltipWindow::showText(const FbTk::BiDiString& text) {
42 42
43 m_lastText = text; 43 m_lastText = text;
44 if (m_delay == 0) 44 if (m_delay == 0)
@@ -50,13 +50,13 @@ void TooltipWindow::showText(const std::string &text) {
50 50
51void TooltipWindow::raiseTooltip() { 51void TooltipWindow::raiseTooltip() {
52 52
53 if (m_lastText.empty()) 53 if (m_lastText.logical().empty())
54 return; 54 return;
55 55
56 resize(m_lastText); 56 resize(m_lastText);
57 reconfigTheme(); 57 reconfigTheme();
58 int h = theme()->font().height() + theme()->bevelWidth() * 2; 58 int h = theme()->font().height() + theme()->bevelWidth() * 2;
59 int w = theme()->font().textWidth(m_lastText, m_lastText.size()) + theme()->bevelWidth() * 2; 59 int w = theme()->font().textWidth(m_lastText) + theme()->bevelWidth() * 2;
60 60
61 Window root_ret; // not used 61 Window root_ret; // not used
62 Window window_ret; // not used 62 Window window_ret; // not used
@@ -92,12 +92,12 @@ void TooltipWindow::raiseTooltip() {
92 clear(); 92 clear();
93 theme()->font().drawText(*this, screen().screenNumber(), 93 theme()->font().drawText(*this, screen().screenNumber(),
94 theme()->iconbarTheme().text().textGC(), 94 theme()->iconbarTheme().text().textGC(),
95 m_lastText, m_lastText.size(), 95 m_lastText,
96 theme()->bevelWidth(), 96 theme()->bevelWidth(),
97 theme()->bevelWidth() + theme()->font().ascent()); 97 theme()->bevelWidth() + theme()->font().ascent());
98} 98}
99 99
100void TooltipWindow::updateText(const std::string &text) { 100void TooltipWindow::updateText(const FbTk::BiDiString& text) {
101 m_lastText = text; 101 m_lastText = text;
102 raiseTooltip(); 102 raiseTooltip();
103} 103}