[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kde4/kdenetwork/ksirc
From:       Maks Orlovich <maksim () kde ! org>
Date:       2005-05-31 21:41:38
Message-ID: 1117575698.908070.7329.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 420365 by orlovich:

Fix painting: use visible coordinates to the QPixmap::fill(Qwidget*, int, int) call
Fix layout. Somehow it didn't work well with Q3VBox, so ported to layout.
Now the app is pretty usable, though config dialog looks funny, and the last line in the view
doesn't always paint right.



 M  +4 -4      kstextview.cpp  
 M  +2 -2      kstextview.h  
 M  +8 -2      toplevel.cpp  
 M  +0 -1      toplevel.h  


--- branches/work/kde4/kdenetwork/ksirc/kstextview.cpp #420364:420365
@@ -1522,10 +1522,10 @@
 }
 
 ContentsPaintAlgorithm::ContentsPaintAlgorithm( const Q3PtrListIterator<TextParag> &paragIt,
-                                                QWidget *viewport, QPixmap &paintBuffer,
+                                                Q3ScrollView *view, QPixmap &paintBuffer,
                                                 QPainter &painter, int clipX, int clipY,
                                                 int clipHeight )
-        : m_paragIt( paragIt ), m_viewport( viewport ), m_paintBuffer( paintBuffer ),
+        : m_paragIt( paragIt ), m_view ( view ), m_paintBuffer( paintBuffer ),
           m_painter( painter ), m_clipX( clipX ), m_clipY( clipY ), m_clipHeight( clipHeight ),
           m_overshoot( 0 )
 {
@@ -1604,7 +1604,7 @@
 
     while ( y < yEnd )
     {
-        m_paintBuffer.fill( m_viewport, 0, y );
+        m_paintBuffer.fill( m_view->viewport(), 0, y - m_view->contentsY() );
         QPainter bufferedPainter( &m_paintBuffer );
         bufferedPainter.translate( -m_clipX, -y );
 	int nextY = paint( bufferedPainter, y );
@@ -1653,7 +1653,7 @@
     Q3PtrListIterator<TextParag> paragIt( m_parags );
 
     ContentsPaintAlgorithm( paragIt,
-                            viewport(), m_paintBuffer, *painter, clipX, clipY,
+                            this, m_paintBuffer, *painter, clipX, clipY,
                             clipHeight )
         .paint();
 }
--- branches/work/kde4/kdenetwork/ksirc/kstextview.h #420364:420365
@@ -449,7 +449,7 @@
 {
 public:
     ContentsPaintAlgorithm( const Q3PtrListIterator<TextParag> &paragIt,
-                            QWidget *viewport, QPixmap &paintBuffer,
+                            Q3ScrollView *view, QPixmap &paintBuffer,
                             QPainter &painter, int clipX, int clipY, int clipHeight );
 
     void paint();
@@ -460,7 +460,7 @@
     int adjustYAndIterator( int startY, int currentY, int nextY );
 
     Q3PtrListIterator<TextParag> m_paragIt;
-    QWidget *m_viewport;
+    Q3ScrollView *m_view;
     QPixmap &m_paintBuffer;
     QPainter &m_painter;
     int m_clipX, m_clipY, m_clipHeight;
--- branches/work/kde4/kdenetwork/ksirc/toplevel.cpp #420364:420365
@@ -236,9 +236,13 @@
 
   // kstInside does not setup fonts, etc, it simply handles sizing
 
-  top = new Q3VBox( this );
+  QFrame*      top       = new QFrame(this);
+  top->setFrameShape(QFrame::NoFrame);
+  QVBoxLayout* topLayout = new QVBoxLayout(top);
 
   ksTopic = new KSircTopic( top );
+  topLayout->addWidget(ksTopic);
+
   ksTopic->setFont(ksopts->defaultFont);
   connect( ksTopic, SIGNAL( topicChange( const QString & ) ),
            this, SLOT( setTopicIntern( const QString & ) ) );
@@ -246,6 +250,7 @@
   Q3CString kstn = Q3CString(QObject::name()) + "_";
 
   pan = new QSplitter(Qt::Horizontal, top, kstn + "splitter");
+  topLayout->addWidget(pan);
 #if KDE_IS_VERSION(3,1,92)
   pan->setOpaqueResize( KGlobalSettings::opaqueResize() );
 #else
@@ -278,7 +283,7 @@
   pan->setResizeMode( nicks_box, QSplitter::Stretch );
 
 //  f = new kstInside(top, QString(QObject::name()) + "_" + "kstIFrame");
-  top->setStretchFactor(pan, 1);
+  topLayout->setStretchFactor(pan, 1);
 
   setCentralWidget(top);  // Tell the KApplication what the main widget is.
 
@@ -329,6 +334,7 @@
   kmenu->insertItem(i18n("&Edit"), edit, -1, -1);
 
   linee = new aHistLineEdit(top, "");
+  topLayout->add(linee);
 
   initColors();
 
--- branches/work/kde4/kdenetwork/ksirc/toplevel.h #420364:420365
@@ -371,7 +371,6 @@
     chanButtons *channelButtons;
     QSplitter *pan;
     Q3VBox *nicks_box;
-    Q3VBox *top;
     KMenuBar *kmenu;
     QLabel *lag;
     enum {PING = 10, TOPIC = 20};
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic