From 58a391e7a20b571369fe2c556711f9bdfc70ed5d Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 31 Mar 2006 11:22:29 +0000 Subject: [PATCH] improve a bit svn path=/branches/work/kde4/playground/graphics/okular/; revision=524837 --- generators/ghostview/generator_ghostview.cpp | 2 +- part.cpp | 11 +++++------ shell/shell.cpp | 2 +- ui/minibar.cpp | 14 ++++++++++---- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/generators/ghostview/generator_ghostview.cpp b/generators/ghostview/generator_ghostview.cpp index bf28359df..c5d09a562 100644 --- a/generators/ghostview/generator_ghostview.cpp +++ b/generators/ghostview/generator_ghostview.cpp @@ -265,7 +265,7 @@ void GSGenerator::setupGUI(KActionCollection * ac , QToolBox * tBox ) if ( GSSettings::messages() ) { m_box=tBox; - m_box->addItem( m_logWindow, QIconSet(SmallIcon("queue")), i18n("GhostScript Messages") ); + m_box->addItem( m_logWindow, SmallIconSet("queue"), i18n("GhostScript Messages") ); } m_actionCollection = ac; diff --git a/part.cpp b/part.cpp index 8e5768e27..6bf9efeed 100644 --- a/part.cpp +++ b/part.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -147,7 +146,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName, //KListViewSearchLine * tocSearchLine = new KListViewSearchLine( tocFrame, toc ); //tocFrameLayout->addWidget( tocSearchLine ); //tocFrameLayout->addWidget( toc ); - tbIndex = m_toolBox->addItem( m_toc/*tocFrame*/, QIconSet(SmallIcon("text_left")), i18n("Contents") ); + tbIndex = m_toolBox->addItem( m_toc/*tocFrame*/, SmallIconSet("text_left"), i18n("Contents") ); m_toolBox->setItemToolTip( tbIndex, i18n("Contents") ); enableTOC( false ); @@ -164,14 +163,14 @@ Part::Part(QWidget *parentWidget, const char *widgetName, thumbsBox->setStretchFactor( m_searchWidget, 100 ); thumbsBox->setStretchFactor( m_thumbnailList, 100 ); // thumbsBox->setStretchFactor( m_tc, 1 ); - tbIndex = m_toolBox->addItem( thumbsBox, QIconSet(SmallIcon("thumbnail")), i18n("Thumbnails") ); + tbIndex = m_toolBox->addItem( thumbsBox, SmallIconSet("thumbnail"), i18n("Thumbnails") ); m_toolBox->setItemToolTip( tbIndex, i18n("Thumbnails") ); m_toolBox->setCurrentIndex( m_toolBox->indexOf( thumbsBox ) ); // [left toolbox: Reviews] | [] #warning this is making it crash // Reviews * reviewsWidget = new Reviews( m_toolBox, m_document ); -// m_toolBox->addItem( reviewsWidget, QIconSet(SmallIcon("pencil")), i18n("Reviews") ); +// m_toolBox->addItem( reviewsWidget, SmallIconSet("pencil"), i18n("Reviews") ); // widgets: [../miniBarContainer] | [] QWidget * miniBarContainer = new QWidget( m_leftPanel ); @@ -220,13 +219,13 @@ Part::Part(QWidget *parentWidget, const char *widgetName, m_prevPage->setWhatsThis( i18n( "Moves to the previous page of the document" ) ); m_prevPage->setShortcut( "Backspace" ); // dirty way to activate prev page when pressing miniBar's button - connect( m_miniBar, SIGNAL( prevPage() ), m_prevPage, SLOT( activate() ) ); + connect( m_miniBar, SIGNAL( prevPage() ), m_prevPage, SLOT( trigger() ) ); m_nextPage = KStdAction::next(this, SLOT(slotNextPage()), ac, "next_page" ); m_nextPage->setWhatsThis( i18n( "Moves to the next page of the document" ) ); m_nextPage->setShortcut( "Space" ); // dirty way to activate next page when pressing miniBar's button - connect( m_miniBar, SIGNAL( nextPage() ), m_nextPage, SLOT( activate() ) ); + connect( m_miniBar, SIGNAL( nextPage() ), m_nextPage, SLOT( trigger() ) ); m_firstPage = KStdAction::firstPage( this, SLOT( slotGotoFirst() ), ac, "first_page" ); m_firstPage->setWhatsThis( i18n( "Moves to the first page of the document" ) ); diff --git a/shell/shell.cpp b/shell/shell.cpp index 3cacee6e2..b1c2d3a0d 100644 --- a/shell/shell.cpp +++ b/shell/shell.cpp @@ -156,7 +156,7 @@ void Shell::setupActions() { KAction * openAction = KStdAction::open(this, SLOT(fileOpen()), actionCollection()); m_recent = KStdAction::openRecent( this, SLOT( openURL( const KUrl& ) ), actionCollection() ); - connect( m_recent, SIGNAL( activated() ), openAction, SLOT( activate() ) ); + connect( m_recent, SIGNAL( activated() ), openAction, SLOT( trigger() ) ); m_recent->setWhatsThis( i18n( "Click to open a file or Click and hold to select a recent file" ) ); m_printAction = KStdAction::print( m_part, SLOT( slotPrint() ), actionCollection() ); m_printAction->setEnabled( false ); diff --git a/ui/minibar.cpp b/ui/minibar.cpp index 623504e75..04e064a92 100644 --- a/ui/minibar.cpp +++ b/ui/minibar.cpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include #include #include #include @@ -434,10 +436,14 @@ void HoverButton::paintEvent( QPaintEvent * e ) } else { - QPainter p( this ); - p.fillRect(e->rect(), parentWidget() ? parentWidget()->palette().brush(QPalette::Active, QColorGroup::Background) : QBrush(paletteBackgroundColor())); - #warning don't know how to port drawButtonLabel -// drawButtonLabel( &p ); + QStylePainter p( this ); + QStyleOptionButton opt; + opt.initFrom( this ); + opt.features = QStyleOptionButton::Flat; + opt.icon = icon(); + opt.iconSize = iconSize(); + opt.text = text(); + p.drawControl( QStyle::CE_PushButton, opt ); } }