-rw-r--r-- | noncore/apps/opie-console/TEWidget.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp index 1c83710..3d010cb 100644 --- a/noncore/apps/opie-console/TEWidget.cpp +++ b/noncore/apps/opie-console/TEWidget.cpp @@ -1153,4 +1153,5 @@ void TEWidget::calcGeometry() int showhscrollbar = 1; int hwidth = 0; + int dcolumns; if(vcolumns == 0) showhscrollbar = 0; @@ -1164,19 +1165,9 @@ void TEWidget::calcGeometry() - if(showhscrollbar == 1) - { - hscrollbar->resize(contentsRect().width() - hwidth, hwidth); - hscrollbar->setRange(0, 40); - - QPoint p = contentsRect().bottomLeft(); - hscrollbar->move(QPoint(p.x(), p.y() - hwidth)); - hscrollbar->show(); - } - else hscrollbar->hide(); - switch(scrollLoc) { case SCRNONE : columns = ( contentsRect().width() - 2 * rimX ) / font_w; + dcolumns = columns; if(vcolumns) columns = vcolumns; blX = (contentsRect().width() - (columns*font_w) ) / 2; @@ -1188,4 +1179,5 @@ void TEWidget::calcGeometry() case SCRLEFT : columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; + dcolumns = columns; if(vcolumns) columns = vcolumns; brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; @@ -1198,4 +1190,5 @@ void TEWidget::calcGeometry() case SCRRIGHT: columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; + dcolumns = columns; if(vcolumns) columns = vcolumns; blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; @@ -1213,4 +1206,15 @@ void TEWidget::calcGeometry() if(showhscrollbar == 1) { + hscrollbar->resize(contentsRect().width() - hwidth, hwidth); + hscrollbar->setRange(0, vcolumns - dcolumns); + + QPoint p = contentsRect().bottomLeft(); + hscrollbar->move(QPoint(p.x(), p.y() - hwidth)); + hscrollbar->show(); + } + else hscrollbar->hide(); + + if(showhscrollbar == 1) + { lines = lines - (hwidth / font_h) - 1; if(lines < 1) lines = 1; |