diff options
author | fluxgen <fluxgen> | 2002-10-15 17:17:00 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-10-15 17:17:00 (GMT) |
commit | 3e972e83bd2716f7e5941f4ef8edcb67f4f2a3b5 (patch) | |
tree | 570346082cf5339b76767e62d205ab980245064b /src/IconBar.cc | |
parent | 715f363016995cbe188e7c47d9c389c8581b9fb1 (diff) | |
download | fluxbox_pavel-3e972e83bd2716f7e5941f4ef8edcb67f4f2a3b5.zip fluxbox_pavel-3e972e83bd2716f7e5941f4ef8edcb67f4f2a3b5.tar.bz2 |
using new font system for labelstyle, windowstyle
Diffstat (limited to 'src/IconBar.cc')
-rw-r--r-- | src/IconBar.cc | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/IconBar.cc b/src/IconBar.cc index 3ed4f54..3d2919d 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.15 2002/08/04 15:23:24 fluxgen Exp $ | 22 | // $Id: IconBar.cc,v 1.16 2002/10/15 17:10:48 fluxgen Exp $ |
23 | 23 | ||
24 | #include "IconBar.hh" | 24 | #include "IconBar.hh" |
25 | #include "i18n.hh" | 25 | #include "i18n.hh" |
@@ -261,9 +261,9 @@ void IconBar::draw(IconBarObj *obj, int width) { | |||
261 | FluxboxWindow *fluxboxwin = obj->getFluxboxWin(); | 261 | FluxboxWindow *fluxboxwin = obj->getFluxboxWin(); |
262 | Window iconwin = obj->getIconWin(); | 262 | Window iconwin = obj->getIconWin(); |
263 | unsigned int title_text_w; | 263 | unsigned int title_text_w; |
264 | 264 | /* | |
265 | const int multibyte = I18n::instance()->multibyte(); | 265 | const int multibyte = I18n::instance()->multibyte(); |
266 | 266 | ||
267 | if (multibyte) { | 267 | if (multibyte) { |
268 | XRectangle ink, logical; | 268 | XRectangle ink, logical; |
269 | XmbTextExtents(m_screen->getWindowStyle()->font.set, | 269 | XmbTextExtents(m_screen->getWindowStyle()->font.set, |
@@ -273,14 +273,16 @@ void IconBar::draw(IconBarObj *obj, int width) { | |||
273 | title_text_w = XTextWidth(m_screen->getWindowStyle()->font.fontstruct, | 273 | title_text_w = XTextWidth(m_screen->getWindowStyle()->font.fontstruct, |
274 | fluxboxwin->getIconTitle().c_str(), fluxboxwin->getIconTitle().size()); | 274 | fluxboxwin->getIconTitle().c_str(), fluxboxwin->getIconTitle().size()); |
275 | } | 275 | } |
276 | 276 | */ | |
277 | title_text_w = m_screen->getWindowStyle()->font.textWidth( | ||
278 | fluxboxwin->getIconTitle().c_str(), fluxboxwin->getIconTitle().size()); | ||
277 | int l = title_text_w; | 279 | int l = title_text_w; |
278 | unsigned int dlen=fluxboxwin->getIconTitle().size(); | 280 | unsigned int dlen=fluxboxwin->getIconTitle().size(); |
279 | unsigned int bevel_w = m_screen->getBevelWidth(); | 281 | unsigned int bevel_w = m_screen->getBevelWidth(); |
280 | int dx=bevel_w*2; | 282 | int dx=bevel_w*2; |
281 | 283 | ||
282 | for (; dlen >= 0; dlen--) { | 284 | for (; dlen >= 0; dlen--) { |
283 | if (multibyte) { | 285 | /*if (multibyte) { |
284 | XRectangle ink, logical; | 286 | XRectangle ink, logical; |
285 | XmbTextExtents(m_screen->getWindowStyle()->tab.font.set, | 287 | XmbTextExtents(m_screen->getWindowStyle()->tab.font.set, |
286 | fluxboxwin->getIconTitle().c_str(), dlen, | 288 | fluxboxwin->getIconTitle().c_str(), dlen, |
@@ -289,13 +291,16 @@ void IconBar::draw(IconBarObj *obj, int width) { | |||
289 | } else | 291 | } else |
290 | l = XTextWidth(m_screen->getWindowStyle()->tab.font.fontstruct, | 292 | l = XTextWidth(m_screen->getWindowStyle()->tab.font.fontstruct, |
291 | fluxboxwin->getIconTitle().c_str(), dlen); | 293 | fluxboxwin->getIconTitle().c_str(), dlen); |
292 | l += (bevel_w * 4); | 294 | */ |
293 | 295 | l = m_screen->getWindowStyle()->tab.font.textWidth( | |
296 | fluxboxwin->getIconTitle().c_str(), dlen); | ||
297 | l += (bevel_w * 4); | ||
298 | |||
294 | if (l < width) | 299 | if (l < width) |
295 | break; | 300 | break; |
296 | } | 301 | } |
297 | 302 | ||
298 | switch (m_screen->getWindowStyle()->tab.font.justify) { | 303 | switch (m_screen->getWindowStyle()->tab.justify) { |
299 | case DrawUtil::Font::RIGHT: | 304 | case DrawUtil::Font::RIGHT: |
300 | dx += width - l; | 305 | dx += width - l; |
301 | break; | 306 | break; |
@@ -309,7 +314,7 @@ void IconBar::draw(IconBarObj *obj, int width) { | |||
309 | //Draw title to m_iconwin | 314 | //Draw title to m_iconwin |
310 | 315 | ||
311 | XClearWindow(m_display, iconwin); | 316 | XClearWindow(m_display, iconwin); |
312 | 317 | /* | |
313 | if (multibyte) { | 318 | if (multibyte) { |
314 | XmbDrawString(m_display, iconwin, | 319 | XmbDrawString(m_display, iconwin, |
315 | m_screen->getWindowStyle()->tab.font.set, | 320 | m_screen->getWindowStyle()->tab.font.set, |
@@ -322,6 +327,13 @@ void IconBar::draw(IconBarObj *obj, int width) { | |||
322 | m_screen->getWindowStyle()->tab.font.fontstruct->ascent + 1, | 327 | m_screen->getWindowStyle()->tab.font.fontstruct->ascent + 1, |
323 | fluxboxwin->getIconTitle().c_str(), dlen); | 328 | fluxboxwin->getIconTitle().c_str(), dlen); |
324 | } | 329 | } |
330 | */ | ||
331 | m_screen->getWindowStyle()->tab.font.drawText( | ||
332 | iconwin, | ||
333 | m_screen->getScreenNumber(), | ||
334 | m_screen->getWindowStyle()->tab.l_text_focus_gc, | ||
335 | fluxboxwin->getIconTitle().c_str(), dlen, | ||
336 | dx, m_screen->getWindowStyle()->tab.font.height()); | ||
325 | 337 | ||
326 | } | 338 | } |
327 | 339 | ||