From 54b9d51694242a1f2e0c1898b05c56114827ca10 Mon Sep 17 00:00:00 2001 From: josef Date: Mon, 28 Oct 2002 09:47:21 +0000 Subject: - 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) --- (limited to 'noncore') 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 @@ -1152,6 +1152,7 @@ void TEWidget::calcGeometry() int showhscrollbar = 1; int hwidth = 0; + int dcolumns; if(vcolumns == 0) showhscrollbar = 0; if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width(); @@ -1163,21 +1164,11 @@ void TEWidget::calcGeometry() 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) @@ -1187,6 +1178,7 @@ void TEWidget::calcGeometry() 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) @@ -1197,6 +1189,7 @@ void TEWidget::calcGeometry() 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) @@ -1212,6 +1205,17 @@ 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; } -- cgit v0.9.0.2