summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-11-08 13:40:06 (UTC)
committer llornkcor <llornkcor>2002-11-08 13:40:06 (UTC)
commit2aa75fdaeb219fffef86af1a2ca0aac0ac6731ce (patch) (unidiff)
tree568d62e648000ac4d8f0c909a0157af03de04298
parentada5be67fec81ed8845a6f358bbf7e3b181d417e (diff)
downloadopie-2aa75fdaeb219fffef86af1a2ca0aac0ac6731ce.zip
opie-2aa75fdaeb219fffef86af1a2ca0aac0ac6731ce.tar.gz
opie-2aa75fdaeb219fffef86af1a2ca0aac0ac6731ce.tar.bz2
change horz scroll position for when using left scroll
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/TEWidget.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/apps/embeddedkonsole/TEWidget.cpp b/core/apps/embeddedkonsole/TEWidget.cpp
index c220e11..23720cd 100644
--- a/core/apps/embeddedkonsole/TEWidget.cpp
+++ b/core/apps/embeddedkonsole/TEWidget.cpp
@@ -1172,65 +1172,69 @@ void TEWidget::calcGeometry()
1172 case SCRLEFT : 1172 case SCRLEFT :
1173 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; 1173 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1174 dcolumns = columns; 1174 dcolumns = columns;
1175 if(vcolumns) columns = vcolumns; 1175 if(vcolumns) columns = vcolumns;
1176 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; 1176 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1177 if(showhscrollbar) 1177 if(showhscrollbar)
1178 brX = -hposition * font_w; 1178 brX = -hposition * font_w;
1179 blX = brX + scrollbar->width(); 1179 blX = brX + scrollbar->width();
1180 scrollbar->move(contentsRect().topLeft()); 1180 scrollbar->move(contentsRect().topLeft());
1181 scrollbar->show(); 1181 scrollbar->show();
1182 break; 1182 break;
1183 case SCRRIGHT: 1183 case SCRRIGHT:
1184 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; 1184 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1185 dcolumns = columns; 1185 dcolumns = columns;
1186 if(vcolumns) columns = vcolumns; 1186 if(vcolumns) columns = vcolumns;
1187 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; 1187 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1188 if(showhscrollbar) 1188 if(showhscrollbar)
1189 blX = -hposition * font_w; 1189 blX = -hposition * font_w;
1190 brX = blX; 1190 brX = blX;
1191 scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0)); 1191 scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0));
1192 scrollbar->show(); 1192 scrollbar->show();
1193 break; 1193 break;
1194 } 1194 }
1195 //FIXME: support 'rounding' styles 1195 //FIXME: support 'rounding' styles
1196 lines = ( contentsRect().height() - 2 * rimY ) / font_h; 1196 lines = ( contentsRect().height() - 2 * rimY ) / font_h;
1197 bY = (contentsRect().height() - (lines *font_h)) / 2; 1197 bY = (contentsRect().height() - (lines *font_h)) / 2;
1198 1198
1199 if(showhscrollbar == 1) { 1199 if(showhscrollbar == 1) {
1200 hScrollbar->resize(contentsRect().width() - hwidth, hwidth); 1200 hScrollbar->resize(contentsRect().width() - hwidth, hwidth);
1201 hScrollbar->setRange(0, vcolumns - dcolumns); 1201 hScrollbar->setRange(0, vcolumns - dcolumns);
1202 1202
1203 QPoint p = contentsRect().bottomLeft(); 1203 QPoint p = contentsRect().bottomLeft();
1204 hScrollbar->move(QPoint(p.x(), p.y() - hwidth)); 1204 if(scrollLoc == SCRLEFT)
1205 hScrollbar->move(QPoint(p.x()+hwidth, p.y() - hwidth));
1206 else
1207 hScrollbar->move(QPoint(p.x(), p.y() - hwidth));
1208
1205 hScrollbar->show(); 1209 hScrollbar->show();
1206 } 1210 }
1207 else hScrollbar->hide(); 1211 else hScrollbar->hide();
1208 1212
1209 if(showhscrollbar == 1) { 1213 if(showhscrollbar == 1) {
1210 lines = lines - (hwidth / font_h) - 1; 1214 lines = lines - (hwidth / font_h) - 1;
1211 if(lines < 1) lines = 1; 1215 if(lines < 1) lines = 1;
1212 } 1216 }
1213 //FIXME: support 'rounding' styles 1217 //FIXME: support 'rounding' styles
1214} 1218}
1215 1219
1216void TEWidget::makeImage() 1220void TEWidget::makeImage()
1217//FIXME: rename 'calcGeometry? 1221//FIXME: rename 'calcGeometry?
1218{ 1222{
1219 calcGeometry(); 1223 calcGeometry();
1220 image = (ca*) malloc(lines*columns*sizeof(ca)); 1224 image = (ca*) malloc(lines*columns*sizeof(ca));
1221 clearImage(); 1225 clearImage();
1222} 1226}
1223 1227
1224// calculate the needed size 1228// calculate the needed size
1225QSize TEWidget::calcSize(int cols, int lins) const 1229QSize TEWidget::calcSize(int cols, int lins) const
1226{ 1230{
1227 int frw = width() - contentsRect().width(); 1231 int frw = width() - contentsRect().width();
1228 int frh = height() - contentsRect().height(); 1232 int frh = height() - contentsRect().height();
1229 int scw = (scrollLoc==SCRNONE?0:scrollbar->width()); 1233 int scw = (scrollLoc==SCRNONE?0:scrollbar->width());
1230 return QSize( font_w*cols + 2*rimX + frw + scw, font_h*lins + 2*rimY + frh ); 1234 return QSize( font_w*cols + 2*rimX + frw + scw, font_h*lins + 2*rimY + frh );
1231} 1235}
1232 1236
1233QSize TEWidget::sizeHint() const 1237QSize TEWidget::sizeHint() const
1234{ 1238{
1235 return size(); 1239 return size();
1236} 1240}