summaryrefslogtreecommitdiff
authorjosef <josef>2002-10-26 13:59:17 (UTC)
committer josef <josef>2002-10-26 13:59:17 (UTC)
commit86704160817aedc391ac16199b9fd1feec880a7f (patch) (unidiff)
treebbd5ca08392cbd6612951ab4781fef6fe8a16285
parentffa4d7c4df80207411c27746ae884cbcead4e619 (diff)
downloadopie-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
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/TEWidget.cpp6
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()
1154 1154
1155 if(vcolumns == 0) showhscrollbar = 0; 1155 if(vcolumns == 0) showhscrollbar = 0;
1156 if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width(); 1156 if(showhscrollbar == 1) hwidth = QApplication::style().scrollBarExtent().width();
1157 1157
1158 scrollbar->resize(QApplication::style().scrollBarExtent().width(), 1158 scrollbar->resize(QApplication::style().scrollBarExtent().width(),
1159 contentsRect().height() - hwidth); 1159 contentsRect().height() - hwidth);
1160 1160
1161 if(showhscrollbar == 1) 1161 if(showhscrollbar == 1)
1162 { 1162 {
1163 hscrollbar->resize(contentsRect().width() - hwidth, hwidth); 1163 hscrollbar->resize(contentsRect().width() - hwidth, hwidth);
1164 hscrollbar->setRange(0, 40); 1164 hscrollbar->setRange(0, 40);
1165 1165
1166 QPoint p = contentsRect().bottomLeft(); 1166 QPoint p = contentsRect().bottomLeft();
1167 hscrollbar->move(QPoint(p.x(), p.y() - hwidth)); 1167 hscrollbar->move(QPoint(p.x(), p.y() - hwidth));
1168 hscrollbar->show(); 1168 hscrollbar->show();
1169 } 1169 }
1170 else hscrollbar->hide(); 1170 else hscrollbar->hide();
1171 1171
1172 switch(scrollLoc) 1172 switch(scrollLoc)
1173 { 1173 {
1174 case SCRNONE : 1174 case SCRNONE :
1175 columns = ( contentsRect().width() - 2 * rimX ) / font_w; 1175 columns = ( contentsRect().width() - 2 * rimX ) / font_w;
1176 if(vcolumns) columns = vcolumns; 1176 if(vcolumns) columns = vcolumns;
1177 blX = (contentsRect().width() - (columns*font_w) ) / 2; 1177 blX = (contentsRect().width() - (columns*font_w) ) / 2;
1178 if(showhscrollbar)
1179 blX = -hposition * font_w;
1178 brX = blX; 1180 brX = blX;
1179 scrollbar->hide(); 1181 scrollbar->hide();
1180 break; 1182 break;
1181 case SCRLEFT : 1183 case SCRLEFT :
1182 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; 1184 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1183 if(vcolumns) columns = vcolumns; 1185 if(vcolumns) columns = vcolumns;
1184 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; 1186 brX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1187 if(showhscrollbar)
1188 brX = -hposition * font_w;
1185 blX = brX + scrollbar->width(); 1189 blX = brX + scrollbar->width();
1186 scrollbar->move(contentsRect().topLeft()); 1190 scrollbar->move(contentsRect().topLeft());
1187 scrollbar->show(); 1191 scrollbar->show();
1188 break; 1192 break;
1189 case SCRRIGHT: 1193 case SCRRIGHT:
1190 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w; 1194 columns = ( contentsRect().width() - 2 * rimX - scrollbar->width()) / font_w;
1191 if(vcolumns) columns = vcolumns; 1195 if(vcolumns) columns = vcolumns;
1192 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2; 1196 blX = (contentsRect().width() - (columns*font_w) - scrollbar->width() ) / 2;
1193 if(showhscrollbar) 1197 if(showhscrollbar)
1194 blX = -hposition * font_w; 1198 blX = -hposition * font_w;
1195 brX = blX; 1199 brX = blX;
1196 scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0)); 1200 scrollbar->move(contentsRect().topRight() - QPoint(scrollbar->width()-1,0));
1197 scrollbar->show(); 1201 scrollbar->show();
1198 break; 1202 break;
1199 } 1203 }
1200 //FIXME: support 'rounding' styles 1204 //FIXME: support 'rounding' styles
1201 lines = ( contentsRect().height() - 2 * rimY ) / font_h; 1205 lines = ( contentsRect().height() - 2 * rimY ) / font_h;
1202 bY = (contentsRect().height() - (lines *font_h)) / 2; 1206 bY = (contentsRect().height() - (lines *font_h)) / 2;
1203 1207
1204 if(showhscrollbar == 1) 1208 if(showhscrollbar == 1)
1205 { 1209 {
1206 //bY = bY - 10; 1210 //bY = bY - 10;
1207 lines = lines - 1; 1211 lines = lines - 1;
1208 } 1212 }
@@ -1323,27 +1327,29 @@ void TEWidget::drop_menu_activated(int)
1323 { 1327 {
1324/* 1328/*
1325 KURL url; 1329 KURL url;
1326 url.setPath( dropText ); 1330 url.setPath( dropText );
1327 dropText = url.directory( true, false ); // remove filename 1331 dropText = url.directory( true, false ); // remove filename
1328*/ 1332*/
1329 } 1333 }
1330 } 1334 }
1331 dropText.replace(QRegExp(" "), "\\ "); // escape spaces 1335 dropText.replace(QRegExp(" "), "\\ "); // escape spaces
1332 currentSession->getEmulation()->sendString(dropText.local8Bit()); 1336 currentSession->getEmulation()->sendString(dropText.local8Bit());
1333 currentSession->getEmulation()->sendString("\n"); 1337 currentSession->getEmulation()->sendString("\n");
1334// KWM::activate((Window)this->winId()); 1338// KWM::activate((Window)this->winId());
1335 break; 1339 break;
1336 } 1340 }
1337#endif 1341#endif
1338} 1342}
1339 1343
1340QPushButton* TEWidget::cornerButton() { 1344QPushButton* TEWidget::cornerButton() {
1341 return m_cornerButton; 1345 return m_cornerButton;
1342} 1346}
1343 1347
1344void TEWidget::setWrapAt(int columns) 1348void TEWidget::setWrapAt(int columns)
1345{ 1349{
1346 vcolumns = columns; 1350 vcolumns = columns;
1351 propagateSize();
1352 update();
1347} 1353}
1348 1354
1349 1355