aboutsummaryrefslogtreecommitdiff
path: root/src/IconBar.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/IconBar.cc')
-rw-r--r--src/IconBar.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/IconBar.cc b/src/IconBar.cc
index 380b7a5..0377d3b 100644
--- a/src/IconBar.cc
+++ b/src/IconBar.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: IconBar.cc,v 1.11 2002/03/23 15:14:45 fluxgen Exp $ 22// $Id: IconBar.cc,v 1.12 2002/04/03 23:01:49 fluxgen Exp $
23 23
24#include "IconBar.hh" 24#include "IconBar.hh"
25#include "i18n.hh" 25#include "i18n.hh"
@@ -239,8 +239,6 @@ void IconBar::draw(IconBarObj *obj, int width) {
239 239
240 FluxboxWindow *fluxboxwin = obj->getFluxboxWin(); 240 FluxboxWindow *fluxboxwin = obj->getFluxboxWin();
241 Window iconwin = obj->getIconWin(); 241 Window iconwin = obj->getIconWin();
242 const char *title = fluxboxwin->getIconTitle();
243 unsigned int title_len = strlen(title);
244 unsigned int title_text_w; 242 unsigned int title_text_w;
245 243
246 const int multibyte = I18n::instance()->multibyte(); 244 const int multibyte = I18n::instance()->multibyte();
@@ -248,15 +246,15 @@ void IconBar::draw(IconBarObj *obj, int width) {
248 if (multibyte) { 246 if (multibyte) {
249 XRectangle ink, logical; 247 XRectangle ink, logical;
250 XmbTextExtents(m_screen->getWindowStyle()->font.set, 248 XmbTextExtents(m_screen->getWindowStyle()->font.set,
251 title, title_len, &ink, &logical); 249 fluxboxwin->getIconTitle().c_str(), fluxboxwin->getIconTitle().size(), &ink, &logical);
252 title_text_w = logical.width; 250 title_text_w = logical.width;
253 } else { 251 } else {
254 title_text_w = XTextWidth(m_screen->getWindowStyle()->font.fontstruct, 252 title_text_w = XTextWidth(m_screen->getWindowStyle()->font.fontstruct,
255 title, title_len); 253 fluxboxwin->getIconTitle().c_str(), fluxboxwin->getIconTitle().size());
256 } 254 }
257 255
258 int l = title_text_w; 256 int l = title_text_w;
259 int dlen=title_len; 257 unsigned int dlen=fluxboxwin->getIconTitle().size();
260 unsigned int bevel_w = m_screen->getBevelWidth(); 258 unsigned int bevel_w = m_screen->getBevelWidth();
261 int dx=bevel_w*2; 259 int dx=bevel_w*2;
262 260
@@ -264,12 +262,12 @@ void IconBar::draw(IconBarObj *obj, int width) {
264 if (multibyte) { 262 if (multibyte) {
265 XRectangle ink, logical; 263 XRectangle ink, logical;
266 XmbTextExtents(m_screen->getWindowStyle()->tab.font.set, 264 XmbTextExtents(m_screen->getWindowStyle()->tab.font.set,
267 title, dlen, 265 fluxboxwin->getIconTitle().c_str(), dlen,
268 &ink, &logical); 266 &ink, &logical);
269 l = logical.width; 267 l = logical.width;
270 } else 268 } else
271 l = XTextWidth(m_screen->getWindowStyle()->tab.font.fontstruct, 269 l = XTextWidth(m_screen->getWindowStyle()->tab.font.fontstruct,
272 title, dlen); 270 fluxboxwin->getIconTitle().c_str(), dlen);
273 l += (bevel_w * 4); 271 l += (bevel_w * 4);
274 272
275 if (l < width) 273 if (l < width)
@@ -295,13 +293,13 @@ void IconBar::draw(IconBarObj *obj, int width) {
295 XmbDrawString(m_display, iconwin, 293 XmbDrawString(m_display, iconwin,
296 m_screen->getWindowStyle()->tab.font.set, 294 m_screen->getWindowStyle()->tab.font.set,
297 m_screen->getWindowStyle()->tab.l_text_focus_gc, dx, 295 m_screen->getWindowStyle()->tab.l_text_focus_gc, dx,
298 1 - m_screen->getWindowStyle()->tab.font.set_extents->max_ink_extent.y, 296 1 - m_screen->getWindowStyle()->tab.font.set_extents->max_ink_extent.y,
299 title, dlen); 297 fluxboxwin->getIconTitle().c_str(), dlen);
300 } else { 298 } else {
301 XDrawString(m_display, iconwin, 299 XDrawString(m_display, iconwin,
302 m_screen->getWindowStyle()->tab.l_text_focus_gc, dx, 300 m_screen->getWindowStyle()->tab.l_text_focus_gc, dx,
303 m_screen->getWindowStyle()->tab.font.fontstruct->ascent + 1, 301 m_screen->getWindowStyle()->tab.font.fontstruct->ascent + 1,
304 title, dlen); 302 fluxboxwin->getIconTitle().c_str(), dlen);
305 } 303 }
306 304
307} 305}