diff options
Diffstat (limited to 'kde-base/libkonq/files/kdebase-3.5.7-libkonq-tooltip.patch')
-rw-r--r-- | kde-base/libkonq/files/kdebase-3.5.7-libkonq-tooltip.patch | 243 |
1 files changed, 243 insertions, 0 deletions
diff --git a/kde-base/libkonq/files/kdebase-3.5.7-libkonq-tooltip.patch b/kde-base/libkonq/files/kdebase-3.5.7-libkonq-tooltip.patch new file mode 100644 index 0000000..7ec61b8 --- /dev/null +++ b/kde-base/libkonq/files/kdebase-3.5.7-libkonq-tooltip.patch @@ -0,0 +1,243 @@ +--- kdebase-3.5.7/libkonq/konq_filetip.cc.orig 2007-08-26 22:38:52.000000000 -0230 ++++ kdebase-3.5.7/libkonq/konq_filetip.cc 2007-08-27 09:45:35.000000000 -0230 +@@ -48,17 +48,19 @@ KonqFileTip::KonqFileTip( QScrollView* p + m_previewJob( 0 ) + { + m_iconLabel = new QLabel(this); ++ m_iconLabel->setAlignment(Qt::AlignHCenter | Qt::AlignTop); + m_textLabel = new QLabel(this); +- m_textLabel->setAlignment(Qt::AlignAuto | Qt::AlignTop); ++ m_textLabel->setAlignment(Qt::AlignAuto | Qt::AlignVCenter); + +- QGridLayout* layout = new QGridLayout(this, 1, 2, 8, 0); ++ QGridLayout * layout = new QGridLayout(this, 1, 2, 25, 0); + layout->addWidget(m_iconLabel, 0, 0); + layout->addWidget(m_textLabel, 0, 1); + layout->setResizeMode(QLayout::Fixed); + +- setPalette( QToolTip::palette() ); ++ setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ); + setMargin( 1 ); +- setFrameStyle( QFrame::Plain | QFrame::Box ); ++ setPalette( QToolTip::palette() ); ++ setFrameStyle( QFrame::StyledPanel ); + + m_timer = new QTimer(this); + +@@ -157,7 +159,7 @@ void KonqFileTip::reposition() + } + else pos.setY( rect.bottom() + 1 ); + +- move( pos ); ++ m_pos = pos; + update(); + } + +@@ -176,39 +178,160 @@ void KonqFileTip::gotPreviewResult() + + void KonqFileTip::drawContents( QPainter *p ) + { +- static const char * const names[] = { +- "arrow_topleft", +- "arrow_topright", +- "arrow_bottomleft", +- "arrow_bottomright" ++ QRegion mask(10, 10, width() - 20, height() - 20); ++ QPoint mAnchor = m_pos; ++ ++ QPoint corners[8] = { ++ QPoint(width() - 50, 10), ++ QPoint(10, 10), ++ QPoint(10, height() - 50), ++ QPoint(width() - 50, height() - 50), ++ QPoint(width() - 10, 10), ++ QPoint(10, 10), ++ QPoint(10, height() - 10), ++ QPoint(width() - 10, height() - 10) + }; + +- if (m_corner >= 4) { // 4 is empty, so don't draw anything +- QFrame::drawContents( p ); +- return; +- } +- +- if ( m_corners[m_corner].isNull()) +- m_corners[m_corner].load( locate( "data", QString::fromLatin1( "konqueror/pics/%1.png" ).arg( names[m_corner] ) ) ); +- +- QPixmap &pix = m_corners[m_corner]; +- +- switch ( m_corner ) +- { +- case 0: +- p->drawPixmap( 3, 3, pix ); +- break; +- case 1: +- p->drawPixmap( width() - pix.width() - 3, 3, pix ); +- break; +- case 2: +- p->drawPixmap( 3, height() - pix.height() - 3, pix ); +- break; +- case 3: +- p->drawPixmap( width() - pix.width() - 3, height() - pix.height() - 3, pix ); +- break; ++ for (int i = 0; i < 4; ++i) ++ { ++ QPointArray corner; ++ corner.makeArc(corners[i].x(), corners[i].y(), 40, 40, ++ i * 16 * 90, 16 * 90); ++ corner.setPoint( corner.size() - 1, corners[i + 4] ); ++ mask -= corner; + } + ++ QDesktopWidget* tmp = QApplication::desktop(); ++ QRect deskRect = tmp->screenGeometry(tmp->screenNumber(mAnchor)); ++ ++ if ( m_corner == 0 ) ++ { ++ QPointArray arrow(4); ++ arrow.setPoint(0, QPoint(1, 1)); ++ arrow.setPoint(1, QPoint(10, 30)); ++ arrow.setPoint(2, QPoint(30, 10)); ++ arrow.setPoint(3, arrow[0]); ++ mask += arrow; ++ } ++ else if ( m_corner == 1 ) ++ { ++ QPointArray arrow(4); ++ arrow.setPoint(0, QPoint(width()-1, 1)); ++ arrow.setPoint(1, QPoint(width() - 10, 30)); ++ arrow.setPoint(2, QPoint(width() - 30, 10)); ++ arrow.setPoint(3, arrow[0]); ++ mask += arrow; ++ } ++ else if ( m_corner == 2 ) ++ { ++ QPointArray arrow(4); ++ arrow.setPoint(0, QPoint(1, height()-1)); ++ arrow.setPoint(1, QPoint(10, height() - 30)); ++ arrow.setPoint(2, QPoint(30, height() - 10)); ++ arrow.setPoint(3, arrow[0]); ++ mask += arrow; ++ } ++ else if ( m_corner == 3 ) ++ { ++ QPointArray arrow(4); ++ arrow.setPoint(0, QPoint(width()-1, height()-1)); ++ arrow.setPoint(1, QPoint(width() - 10, height() - 30)); ++ arrow.setPoint(2, QPoint(width() - 30, height() - 10)); ++ arrow.setPoint(3, arrow[0]); ++ mask += arrow; ++ } ++ ++ setMask(mask); ++ ++ p->setPen ( QPen( QColor("black"), 2, Qt::SolidLine ) ); ++ ++ if ( m_corner == 0 ) ++ { ++ p->drawLine( 1, 1, 30, 10); ++ p->drawLine(30, 10, width(), 10); ++ ++ p->drawLine(width()-10, 0, width()-10, height()); ++ ++ p->drawLine(0, height()-10, width(), height()-10); ++ ++ p->drawLine(10, height(), 10, 30); ++ p->drawLine(10, 30, 1, 1); ++ ++ p->drawArc(corners[2].x(), corners[2].y(), 40, 40, 2 * 16 * 90, 16 * 90); ++ p->setPen ( QPen( QColor("black"), 3, Qt::SolidLine ) ); ++ p->drawArc(corners[0].x(), corners[0].y(), 40, 40, 0, 16 * 90); ++ p->drawArc(corners[3].x(), corners[3].y(), 40, 40, 3 * 16 * 90, 16 * 90); ++ } ++ else if ( m_corner == 1 ) ++ { ++ p->drawLine(0, 10, width()-30, 10); ++ ++ p->drawLine(width()-10, 30, width()-1, 1); ++ p->drawLine(width()-1, 1, width()-30, 10); ++ ++ p->drawLine(width()-10, 30, width()-10, height()); ++ ++ p->drawLine( 0, height()-10, width(), height()-10); ++ ++ p->drawLine(10, height(), 10, 0); ++ ++ p->drawArc(corners[1].x(), corners[1].y(), 40, 40, 16 * 90, 16 * 90); ++ p->drawArc(corners[2].x(), corners[2].y(), 40, 40, 2 * 16 * 90, 16 * 90); ++ p->setPen ( QPen( QColor("black"), 3, Qt::SolidLine ) ); ++ p->drawArc(corners[3].x(), corners[3].y(), 40, 40, 3 * 16 * 90, 16 * 90); ++ } ++ else if ( m_corner == 2 ) ++ { ++ p->drawLine(0, 10, width()-29, 10); ++ ++ p->drawLine(width()-10, 0, width()-10, height()-30); ++ ++ p->drawLine(30, height()-10, width(), height()-10); ++ ++ p->drawLine(30, height()-10, 1, height()-1); ++ p->drawLine( 1, height()-1, 10, height()-30); ++ ++ p->drawLine(10, height()-30, 10, 0); ++ ++ p->drawArc(corners[1].x(), corners[1].y(), 40, 40, 16 * 90, 16 * 90); ++ p->setPen ( QPen( QColor("black"), 3, Qt::SolidLine ) ); ++ p->drawArc(corners[0].x(), corners[0].y(), 40, 40, 0, 16 * 90); ++ p->drawArc(corners[3].x(), corners[3].y(), 40, 40, 3 * 16 * 90, 16 * 90); ++ } ++ else if ( m_corner == 3 ) ++ { ++ p->drawLine(0, 10, width(), 10); ++ ++ p->drawLine(width()-10, 0, width()-10, height()-29); ++ p->drawLine(width()-10, height()-30, width()-1, height()-1); ++ p->drawLine(width()-1, height()-1, width()-30, height()-10); ++ p->drawLine(30, height()-10, width()-30, height()-10); ++ ++ p->drawLine(10, height(), 10, 0); ++ ++ p->drawArc(corners[1].x(), corners[1].y(), 40, 40, 16 * 90, 16 * 90); ++ p->drawArc(corners[2].x(), corners[2].y(), 40, 40, 2 * 16 * 90, 16 * 90); ++ p->setPen ( QPen( QColor("black"), 3, Qt::SolidLine ) ); ++ p->drawArc(corners[0].x(), corners[0].y(), 40, 40, 0, 16 * 90); ++ } ++ else if ( m_corner >= 4 ) ++ { ++ p->drawLine(0, 10, width()-30, 10); ++ ++ p->drawLine(width()-10, 0, width()-10, height()); ++ ++ p->drawLine(0, height()-10, width(), height()-10); ++ ++ p->drawLine(10, height(), 10, 0); ++ ++ p->drawArc(corners[1].x(), corners[1].y(), 40, 40, 16 * 90, 16 * 90); ++ p->drawArc(corners[2].x(), corners[2].y(), 40, 40, 2 * 16 * 90, 16 * 90); ++ p->setPen ( QPen( QColor("black"), 3, Qt::SolidLine ) ); ++ p->drawArc(corners[0].x(), corners[0].y(), 40, 40, 0, 16 * 90); ++ p->drawArc(corners[3].x(), corners[3].y(), 40, 40, 3 * 16 * 90, 16 * 90); ++ } ++ ++ move( mAnchor ); + QFrame::drawContents( p ); + } + +--- kdebase-3.5.7/libkonq/konq_filetip.h.orig 2005-10-10 12:34:21.000000000 -0230 ++++ kdebase-3.5.7/libkonq/konq_filetip.h 2007-08-27 09:59:00.000000000 -0230 +@@ -32,6 +32,7 @@ class KFileItem; + class QLabel; + class QScrollView; + class QTimer; ++class QPoint; + + //-------------------------------------------------------------------------------- + +@@ -92,6 +93,7 @@ class LIBKONQ_EXPORT KonqFileTip : publi + KIO::PreviewJob* m_previewJob; + QRect m_rect; + QTimer* m_timer; ++ QPoint m_pos; + }; + + #endif |