summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/TEWidget.cpp26
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
@@ -1152,6 +1152,7 @@ void TEWidget::calcGeometry()
1152 1152
1153 int showhscrollbar = 1; 1153 int showhscrollbar = 1;
1154 int hwidth = 0; 1154 int hwidth = 0;
1155 int dcolumns;
1155 1156
1156 if(vcolumns == 0) showhscrollbar = 0; 1157 if(vcolumns == 0) showhscrollbar = 0;
1157 if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width(); 1158 if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width();
@@ -1163,21 +1164,11 @@ void TEWidget::calcGeometry()
1163 else cornerButton()->move(contentsRect().width() - hwidth, contentsRect().height() - hwidth); 1164 else cornerButton()->move(contentsRect().width() - hwidth, contentsRect().height() - hwidth);
1164 1165
1165 1166
1166 if(showhscrollbar == 1)
1167 {
1168 hscrollbar->resize(contentsRect().width() - hwidth, hwidth);
1169 hscrollbar->setRange(0, 40);
1170
1171 QPoint p = contentsRect().bottomLeft();
1172 hscrollbar->move(QPoint(p.x(), p.y() - hwidth));
1173 hscrollbar->show();
1174 }
1175 else hscrollbar->hide();
1176
1177 switch(scrollLoc) 1167 switch(scrollLoc)
1178 { 1168 {
1179 case SCRNONE : 1169 case SCRNONE :
1180 columns = ( contentsRect().width() - 2 * rimX ) / font_w; 1170 columns = ( contentsRect().width() - 2 * rimX ) / font_w;
1171 dcolumns = columns;
1181 if(vcolumns) columns = vcolumns; 1172 if(vcolumns) columns = vcolumns;
1182 blX = (contentsRect().width() - (columns*font_w) ) / 2; 1173 blX = (contentsRect().width() - (columns*font_w) ) / 2;
1183 if(showhscrollbar) 1174 if(showhscrollbar)
@@ -1187,6 +1178,7 @@ void TEWidget::calcGeometry()
1187 break; 1178 break;
1188 case SCRLEFT : 1179 case SCRLEFT :
1189 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; 1180 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1181 dcolumns = columns;
1190 if(vcolumns) columns = vcolumns; 1182 if(vcolumns) columns = vcolumns;
1191 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; 1183 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1192 if(showhscrollbar) 1184 if(showhscrollbar)
@@ -1197,6 +1189,7 @@ void TEWidget::calcGeometry()
1197 break; 1189 break;
1198 case SCRRIGHT: 1190 case SCRRIGHT:
1199 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; 1191 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1192 dcolumns = columns;
1200 if(vcolumns) columns = vcolumns; 1193 if(vcolumns) columns = vcolumns;
1201 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; 1194 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1202 if(showhscrollbar) 1195 if(showhscrollbar)
@@ -1212,6 +1205,17 @@ void TEWidget::calcGeometry()
1212 1205
1213 if(showhscrollbar == 1) 1206 if(showhscrollbar == 1)
1214 { 1207 {
1208 hscrollbar->resize(contentsRect().width() - hwidth, hwidth);
1209 hscrollbar->setRange(0, vcolumns - dcolumns);
1210
1211 QPoint p = contentsRect().bottomLeft();
1212 hscrollbar->move(QPoint(p.x(), p.y() - hwidth));
1213 hscrollbar->show();
1214 }
1215 else hscrollbar->hide();
1216
1217 if(showhscrollbar == 1)
1218 {
1215 lines = lines - (hwidth / font_h) - 1; 1219 lines = lines - (hwidth / font_h) - 1;
1216 if(lines < 1) lines = 1; 1220 if(lines < 1) lines = 1;
1217 } 1221 }