# HG changeset patch # User Jacob Dawid # Date 1302643048 -7200 # Node ID 32732696103897706336f7d0092b14ffe5b590ee # Parent 5464586889ae1e722b4f7f1128c7cc4be3b669c8 Removed line and column label. diff -r 5464586889ae -r 327326961038 gui//src/NumberedCodeEdit.cpp --- a/gui//src/NumberedCodeEdit.cpp Tue Apr 12 23:11:28 2011 +0200 +++ b/gui//src/NumberedCodeEdit.cpp Tue Apr 12 23:17:28 2011 +0200 @@ -127,55 +127,6 @@ currentRect = QRect( 1, position_y, currentMarker.width(), currentMarker.height() ); } } - - /* - - int contentsY = edit->verticalScrollBar()->value(); - qreal pageBottom = contentsY + edit->viewport()->height(); - const QFontMetrics fm = fontMetrics(); - const int ascent = fontMetrics().ascent() + 1; // height = ascent + descent + 1 - int lineCount = 1; - - QPainter p(this); - p.setPen(palette().windowText().color()); - - bugRect = QRect(); - stopRect = QRect(); - currentRect = QRect(); - - for ( QTextBlock block = edit->document()->begin(); - block.isValid(); block = block.next(), ++lineCount ) { - - const QRectF boundingRect = edit->publicBlockBoundingRect( block ); - - QPointF position = boundingRect.topLeft(); - if ( position.y() + boundingRect.height() < contentsY ) - continue; - if ( position.y() > pageBottom ) - break; - - const QString txt = QString::number( lineCount ); - p.drawText( width() - fm.width(txt), qRound( position.y() ) - contentsY + ascent, txt ); - - // Bug marker - if ( bugLine == lineCount ) { - p.drawPixmap( 1, qRound( position.y() ) - contentsY, bugMarker ); - bugRect = QRect( 1, qRound( position.y() ) - contentsY, bugMarker.width(), bugMarker.height() ); - } - - // Stop marker - if ( breakpoints.contains(lineCount) ) { - p.drawPixmap( 19, qRound( position.y() ) - contentsY, stopMarker ); - stopRect = QRect( 19, qRound( position.y() ) - contentsY, stopMarker.width(), stopMarker.height() ); - } - - // Current line marker - if ( currentLine == lineCount ) { - p.drawPixmap( 19, qRound( position.y() ) - contentsY, currentMarker ); - currentRect = QRect( 19, qRound( position.y() ) - contentsY, currentMarker.width(), currentMarker.height() ); - } - } - */ } bool NumberBar::event( QEvent *event ) @@ -242,10 +193,6 @@ vbox->addLayout(messages_layout); messages_layout->setSpacing( 0 ); messages_layout->setMargin( 0 ); - - line_column_label=new QLabel("Line: 1 Col: 1", this); - messages_layout->addWidget(line_column_label); - line_column_label->show(); } @@ -288,38 +235,8 @@ void NumberedTextView::textChanged( int /*pos*/, int removed, int added ) { - //Q_UNUSED( pos ); - if ( removed == 0 && added == 0 ) return; - - //QTextBlock block = highlight.block(); - //QTextBlock block = view->document()->begin(); - //QTextBlockFormat fmt = block.blockFormat(); - //QColor bg = view->palette().base().color(); - //fmt.setBackground( bg ); - //highlight.setBlockFormat( fmt ); - /* - QTextBlockFormat fmt; - - int lineCount = 1; - for ( QTextBlock block = view->document()->begin(); - block.isValid() && block!=view->document()->end(); block = block.next(), ++lineCount ) { - - if ( lineCount == currentLine ) - { - fmt = block.blockFormat(); - QColor bg = view->palette().highlight().color(); - fmt.setBackground( bg ); - - highlight = QTextCursor( block ); - highlight.movePosition( QTextCursor::EndOfBlock, QTextCursor::KeepAnchor ); - highlight.setBlockFormat( fmt ); - - break; - } - } - */ if( !textModifiedOk && view->document()->isModified() ) { @@ -343,8 +260,6 @@ QString word = cursor.selectedText(); emit mouseHover( word ); emit mouseHover( helpEvent->pos(), word ); - - // QToolTip::showText( helpEvent->globalPos(), word ); // For testing } return false; @@ -397,7 +312,6 @@ throw path; } - QString repository=path+"~~"; QString command("simplercs \""+repository+"\" \""+path+"\""); QProcess::startDetached(command); @@ -433,10 +347,7 @@ QTextBlock block = view->document()->begin(); for ( ;block.isValid() && actual_block!=block; block = block.next()) lineCount++ ; - - int col= cursor.position() - block.position() + 1; - - line_column_label->setText("Line: "+QString::number(lineCount)+" Col: "+QString::number(col) ); + } static QString startLineInsertText(QString str, QString textToInsert) diff -r 5464586889ae -r 327326961038 gui//src/NumberedCodeEdit.h --- a/gui//src/NumberedCodeEdit.h Tue Apr 12 23:11:28 2011 +0200 +++ b/gui//src/NumberedCodeEdit.h Tue Apr 12 23:17:28 2011 +0200 @@ -151,7 +151,6 @@ private: QString filePath; - QLabel *line_column_label; CodeEdit *view; NumberBar *numbers; QHBoxLayout *hbox;