author | josef <josef> | 2002-10-28 09:47:21 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-28 09:47:21 (UTC) |
commit | 54b9d51694242a1f2e0c1898b05c56114827ca10 (patch) (side-by-side diff) | |
tree | 8352d4a219d2547a87662206e4dccb6f1d36f907 | |
parent | 33834e447ef1313da826c64c6c09953eb3502b69 (diff) | |
download | opie-54b9d51694242a1f2e0c1898b05c56114827ca10.zip opie-54b9d51694242a1f2e0c1898b05c56114827ca10.tar.gz opie-54b9d51694242a1f2e0c1898b05c56114827ca10.tar.bz2 |
- ugh, showstopper:
Display is one character wider than expected.
While changing this, also replace 40 with vcolumns - dcolumns, so 120 chars
etc. could now also be used (once there is a config option for this)
-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 @@ -1151,8 +1151,9 @@ void TEWidget::calcGeometry() //FIXME: set rimX == rimY == 0 when running in full screen mode. int showhscrollbar = 1; int hwidth = 0; + int dcolumns; if(vcolumns == 0) showhscrollbar = 0; if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width(); @@ -1162,23 +1163,13 @@ void TEWidget::calcGeometry() 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; + dcolumns = columns; if(vcolumns) columns = vcolumns; blX = (contentsRect().width() - (columns*font_w) ) / 2; if(showhscrollbar) blX = -hposition * font_w; @@ -1186,8 +1177,9 @@ void TEWidget::calcGeometry() scrollbar->hide(); break; 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; if(showhscrollbar) brX = -hposition * font_w; @@ -1196,8 +1188,9 @@ void TEWidget::calcGeometry() scrollbar->show(); break; 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; if(showhscrollbar) blX = -hposition * font_w; @@ -1211,8 +1204,19 @@ void TEWidget::calcGeometry() bY = (contentsRect().height() - (lines *font_h)) / 2; 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; } } |