From 90f2fcf031554577ce811e7f7151f2a78ea7a265 Mon Sep 17 00:00:00 2001 From: Mathias Gumz <akira@fluxbox.org> Date: Sat, 3 Jan 2015 21:45:14 +0100 Subject: Minor API change for OSDWindow OSDWindow::resize(const FbTk::BiDiString&) shadowed FbWindow::resize(x, y). To fix this I renamed the function to OSDWindow::resizeForText() to make the intention clear. --- src/OSDWindow.cc | 2 +- src/OSDWindow.hh | 2 +- src/Screen.cc | 13 ++++++------- src/TooltipWindow.cc | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/OSDWindow.cc b/src/OSDWindow.cc index 82090c5..d5f0ed5 100644 --- a/src/OSDWindow.cc +++ b/src/OSDWindow.cc @@ -57,7 +57,7 @@ void OSDWindow::reconfigTheme() { } -void OSDWindow::resize(const FbTk::BiDiString &text) { +void OSDWindow::resizeForText(const FbTk::BiDiString &text) { int bw = 2 * m_theme->bevelWidth(); int h = m_theme->font().height() + bw; diff --git a/src/OSDWindow.hh b/src/OSDWindow.hh index 14e01d2..0b063b2 100644 --- a/src/OSDWindow.hh +++ b/src/OSDWindow.hh @@ -41,7 +41,7 @@ public: m_pixmap(None), m_visible(false) { } void reconfigTheme(); - void resize(const FbTk::BiDiString &text); + void resizeForText(const FbTk::BiDiString &text); void showText(const FbTk::BiDiString &text); void hide(); diff --git a/src/Screen.cc b/src/Screen.cc index 29ab548..1a42f33 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1900,19 +1900,18 @@ void BScreen::renderGeomWindow() { char buf[256]; _FB_USES_NLS; - sprintf(buf, - _FB_XTEXT(Screen, GeometrySpacing, - "W: %04d x H: %04d", "Representative maximum sized text for width and height dialog").c_str(), - 0, 0); + const std::string msg = _FB_XTEXT(Screen, GeometrySpacing, + "W: %04d x H: %04d", "Representative maximum sized text for width and height dialog"); + const int n = snprintf(buf, msg.size(), msg.c_str(), 0, 0); - FbTk::BiDiString label(buf); - m_geom_window->resize(label); + FbTk::BiDiString label(std::string(buf, n)); + m_geom_window->resizeForText(label); m_geom_window->reconfigTheme(); } void BScreen::renderPosWindow() { - m_pos_window->resize(FbTk::BiDiString("0:00000 x 0:00000")); + m_pos_window->resizeForText(FbTk::BiDiString("0:00000 x 0:00000")); m_pos_window->reconfigTheme(); } diff --git a/src/TooltipWindow.cc b/src/TooltipWindow.cc index 77a6e1e..06ddf63 100644 --- a/src/TooltipWindow.cc +++ b/src/TooltipWindow.cc @@ -53,7 +53,7 @@ void TooltipWindow::raiseTooltip() { if (m_lastText.logical().empty()) return; - resize(m_lastText); + resizeForText(m_lastText); reconfigTheme(); FbTk::Font& font = theme()->iconbarTheme().text().font(); -- cgit v0.11.2