author | josef <josef> | 2002-10-26 13:59:17 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-26 13:59:17 (UTC) |
commit | 86704160817aedc391ac16199b9fd1feec880a7f (patch) (side-by-side diff) | |
tree | bbd5ca08392cbd6612951ab4781fef6fe8a16285 | |
parent | ffa4d7c4df80207411c27746ae884cbcead4e619 (diff) | |
download | opie-86704160817aedc391ac16199b9fd1feec880a7f.zip opie-86704160817aedc391ac16199b9fd1feec880a7f.tar.gz opie-86704160817aedc391ac16199b9fd1feec880a7f.tar.bz2 |
- handle no vscrollbar and vscrollbar on left side (hopefully)
- when changing word wrap, reset widget automatically
-rw-r--r-- | noncore/apps/opie-console/TEWidget.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp index bf9a313..2db214c 100644 --- a/noncore/apps/opie-console/TEWidget.cpp +++ b/noncore/apps/opie-console/TEWidget.cpp @@ -1154,55 +1154,59 @@ void TEWidget::calcGeometry() if(vcolumns == 0) showhscrollbar = 0; if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width(); scrollbar->resize(QApplication::style().scrollBarExtent().width(), 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; blX = (contentsRect().width() - (columns*font_w) ) / 2; + if(showhscrollbar) + blX = -hposition * font_w; brX = blX; scrollbar->hide(); break; case SCRLEFT : columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; if(vcolumns) columns = vcolumns; brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; + if(showhscrollbar) + brX = -hposition * font_w; blX = brX + scrollbar->width(); scrollbar->move(contentsRect().topLeft()); scrollbar->show(); break; case SCRRIGHT: 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; } @@ -1323,27 +1327,29 @@ void TEWidget::drop_menu_activated(int) { /* KURL url; url.setPath( dropText ); dropText = url.directory( true, false ); // remove filename */ } } dropText.replace(QRegExp(" "), "\\ "); // escape spaces currentSession->getEmulation()->sendString(dropText.local8Bit()); currentSession->getEmulation()->sendString("\n"); // KWM::activate((Window)this->winId()); break; } #endif } QPushButton* TEWidget::cornerButton() { return m_cornerButton; } void TEWidget::setWrapAt(int columns) { vcolumns = columns; + propagateSize(); + update(); } |