-rw-r--r-- | noncore/apps/opie-console/TEWidget.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp index 2db214c..d1ff85e 100644 --- a/noncore/apps/opie-console/TEWidget.cpp +++ b/noncore/apps/opie-console/TEWidget.cpp @@ -1145,32 +1145,36 @@ void TEWidget::clearImage() // Create Image /////////////////////////////////////////////////////// void TEWidget::calcGeometry() { //FIXME: set rimX == rimY == 0 when running in full screen mode. int showhscrollbar = 1; int hwidth = 0; if(vcolumns == 0) showhscrollbar = 0; if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width(); scrollbar->resize(QApplication::style().scrollBarExtent().width(), contentsRect().height() - hwidth); + if(!showhscrollbar) cornerButton()->move(0, 0); + else cornerButton()->move(contentsRect().width() - hwidth, contentsRect().height() - hwidth); + + 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; if(vcolumns) columns = vcolumns; @@ -1194,34 +1198,34 @@ void TEWidget::calcGeometry() columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; if(vcolumns) columns = vcolumns; blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; if(showhscrollbar) blX = -hposition * font_w; brX = blX; scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0)); scrollbar->show(); break; } //FIXME: support 'rounding' styles lines = ( contentsRect().height() - 2 * rimY ) / font_h; bY = (contentsRect().height() - (lines *font_h)) / 2; if(showhscrollbar == 1) { - //bY = bY - 10; - lines = lines - 1; + lines = lines - (hwidth / font_h) - 1; + if(lines < 1) lines = 1; } } void TEWidget::makeImage() //FIXME: rename 'calcGeometry? { calcGeometry(); image = (ca*) malloc(lines*columns*sizeof(ca)); clearImage(); } // calculate the needed size QSize TEWidget::calcSize(int cols, int lins) const { int frw = width() - contentsRect().width(); int frh = height() - contentsRect().height(); |