aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Tab.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/Tab.cc b/src/Tab.cc
index 61ac624..22d229f 100644
--- a/src/Tab.cc
+++ b/src/Tab.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: Tab.cc,v 1.40 2002/11/15 14:06:33 fluxgen Exp $ 22// $Id: Tab.cc,v 1.41 2002/11/17 13:40:01 fluxgen Exp $
23 23
24#include "Tab.hh" 24#include "Tab.hh"
25 25
@@ -385,30 +385,31 @@ void Tab::draw(bool pressed) const {
385 385
386 } else { 386 } else {
387 */ 387 */
388 int dx=m_win->frame.bevel_w*2; 388 int dx=0;
389 Theme::WindowStyle *winstyle = m_win->getScreen()->getWindowStyle(); 389 Theme::WindowStyle *winstyle = m_win->getScreen()->getWindowStyle();
390 size_t dlen = m_win->getTitle().size(); 390 size_t dlen = m_win->getTitle().size();
391 size_t l = dlen; 391 size_t l = winstyle->tab.font.textWidth(m_win->getTitle().c_str(), dlen);
392 if ( dlen > m_size_w) { 392 if ( l > m_size_w) {
393 for (; dlen >= 0; dlen--) { 393 for (; dlen >= 0; dlen--) {
394 l = winstyle->tab.font.textWidth(m_win->getTitle().c_str(), dlen); 394 l = winstyle->tab.font.textWidth(m_win->getTitle().c_str(), dlen) + m_win->frame.bevel_w*4;
395 l += (dx * 4);
396 395
397 if (l < m_size_w || dlen == 0) 396 if (l < m_size_w || dlen == 0)
398 break; 397 break;
399 } 398 }
400 } 399 }
401 400
402 switch (winstyle->tab.justify) { 401 switch (winstyle->tab.justify) {
403 case DrawUtil::Font::RIGHT: 402 case DrawUtil::Font::RIGHT:
404 dx += m_size_w - l; 403 dx += m_size_w - l - m_win->frame.bevel_w*3;
405 break; 404 break;
406
407 case DrawUtil::Font::CENTER: 405 case DrawUtil::Font::CENTER:
408 dx += (m_size_w - l) / 2; 406 dx += (m_size_w - l) / 2;
409 break; 407 break;
408 case DrawUtil::Font::LEFT:
409 dx = m_win->frame.bevel_w;
410 break;
410 default: 411 default:
411 break; 412 break;
412 } 413 }
413 414
414 m_win->getScreen()->getWindowStyle()->tab.font.drawText( 415 m_win->getScreen()->getWindowStyle()->tab.font.drawText(