aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.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/Screen.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/Screen.cc')
-rw-r--r--src/Screen.cc26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index db302fe..5218319 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1051,7 +1051,7 @@ int BScreen::addWorkspace() {
1051 m_workspaces_list.push_back(wkspc); 1051 m_workspaces_list.push_back(wkspc);
1052 1052
1053 if (save_name) { 1053 if (save_name) {
1054 addWorkspaceName(wkspc->name().c_str()); //update names 1054 addWorkspaceName(wkspc->name().c_str());
1055 m_workspacenames_sig.emit(*this); 1055 m_workspacenames_sig.emit(*this);
1056 } 1056 }
1057 1057
@@ -1451,7 +1451,7 @@ void BScreen::initMenus() {
1451void BScreen::rereadMenu() { 1451void BScreen::rereadMenu() {
1452 1452
1453 m_rootmenu->removeAll(); 1453 m_rootmenu->removeAll();
1454 m_rootmenu->setLabel(""); 1454 m_rootmenu->setLabel(FbTk::BiDiString(""));
1455 1455
1456 Fluxbox * const fb = Fluxbox::instance(); 1456 Fluxbox * const fb = Fluxbox::instance();
1457 if (!fb->getMenuFilename().empty()) 1457 if (!fb->getMenuFilename().empty())
@@ -1776,8 +1776,10 @@ void BScreen::showPosition(int x, int y) {
1776 if (!doShowWindowPos()) 1776 if (!doShowWindowPos())
1777 return; 1777 return;
1778 1778
1779 char label[256]; 1779 char buf[256];
1780 sprintf(label, "X:%5d x Y:%5d", x, y); 1780 sprintf(buf, "X:%5d x Y:%5d", x, y);
1781
1782 FbTk::BiDiString label(buf);
1781 m_pos_window->showText(label); 1783 m_pos_window->showText(label);
1782} 1784}
1783 1785
@@ -1790,19 +1792,21 @@ void BScreen::showGeometry(unsigned int gx, unsigned int gy) {
1790 if (!doShowWindowPos()) 1792 if (!doShowWindowPos())
1791 return; 1793 return;
1792 1794
1793 char label[256]; 1795 char buf[256];
1794 _FB_USES_NLS; 1796 _FB_USES_NLS;
1795 1797
1796 sprintf(label, 1798 sprintf(buf,
1797 _FB_XTEXT(Screen, GeometryFormat, 1799 _FB_XTEXT(Screen, GeometryFormat,
1798 "W: %4d x H: %4d", 1800 "W: %4d x H: %4d",
1799 "Format for width and height window, %4d for width, and %4d for height").c_str(), 1801 "Format for width and height window, %4d for width, and %4d for height").c_str(),
1800 gx, gy); 1802 gx, gy);
1803
1804 FbTk::BiDiString label(buf);
1801 m_geom_window->showText(label); 1805 m_geom_window->showText(label);
1802} 1806}
1803 1807
1804 1808
1805void BScreen::showTooltip(const std::string &text) { 1809void BScreen::showTooltip(const FbTk::BiDiString &text) {
1806 if (*resource.tooltip_delay >= 0) 1810 if (*resource.tooltip_delay >= 0)
1807 m_tooltip_window->showText(text); 1811 m_tooltip_window->showText(text);
1808} 1812}
@@ -1855,20 +1859,22 @@ void BScreen::leftWorkspace(const int delta) {
1855 1859
1856void BScreen::renderGeomWindow() { 1860void BScreen::renderGeomWindow() {
1857 1861
1858 char label[256]; 1862 char buf[256];
1859 _FB_USES_NLS; 1863 _FB_USES_NLS;
1860 1864
1861 sprintf(label, 1865 sprintf(buf,
1862 _FB_XTEXT(Screen, GeometrySpacing, 1866 _FB_XTEXT(Screen, GeometrySpacing,
1863 "W: %04d x H: %04d", "Representative maximum sized text for width and height dialog").c_str(), 1867 "W: %04d x H: %04d", "Representative maximum sized text for width and height dialog").c_str(),
1864 0, 0); 1868 0, 0);
1869
1870 FbTk::BiDiString label(buf);
1865 m_geom_window->resize(label); 1871 m_geom_window->resize(label);
1866 m_geom_window->reconfigTheme(); 1872 m_geom_window->reconfigTheme();
1867} 1873}
1868 1874
1869 1875
1870void BScreen::renderPosWindow() { 1876void BScreen::renderPosWindow() {
1871 m_pos_window->resize("0:00000 x 0:00000"); 1877 m_pos_window->resize(FbTk::BiDiString("0:00000 x 0:00000"));
1872 m_pos_window->reconfigTheme(); 1878 m_pos_window->reconfigTheme();
1873} 1879}
1874 1880