File r893414.diff of Package kdepim4
Subject: korganizer: calendar scroll widget fixes
From: wstephenson@suse.de
Bug:
Patch-upstream: 893414
--- korganizer/navigatorbar.h (revision 893413)
+++ korganizer/navigatorbar.h (revision 893414)
@@ -30,7 +30,7 @@
#include <QMouseEvent>
#include <QFrame>
-class QPushButton;
+class QToolButton;
class QFrame;
class ActiveLabel : public QLabel
@@ -66,8 +66,7 @@ class NavigatorBar: public QWidget
void goMonth( int month );
protected:
- QPushButton *createNavigationButton( const QString &icon,
- const QString &toolTip );
+ QToolButton *createNavigationButton( const QString &icon, const QString &toolTip );
private slots:
void selectMonth();
@@ -77,11 +76,11 @@ class NavigatorBar: public QWidget
QDate mDate;
- QPushButton *mPrevYear;
- QPushButton *mPrevMonth;
+ QToolButton *mPrevYear;
+ QToolButton *mPrevMonth;
ActiveLabel *mMonth;
- QPushButton *mNextMonth;
- QPushButton *mNextYear;
+ QToolButton *mNextMonth;
+ QToolButton *mNextYear;
};
#endif
--- korganizer/navigatorbar.cpp (revision 893413)
+++ korganizer/navigatorbar.cpp (revision 893414)
@@ -32,15 +32,12 @@
#include <kglobal.h>
#include <kiconloader.h>
-#include <QString>
-#include <QPushButton>
-#include <QLayout>
+#include <QHBoxLayout>
#include <QLabel>
-#include <Q3PopupMenu>
#include <QMouseEvent>
-#include <QPixmap>
-#include <QHBoxLayout>
-#include <QBoxLayout>
+#include <QString>
+#include <QToolButton>
+#include <Q3PopupMenu>
ActiveLabel::ActiveLabel( QWidget *parent ) : QLabel( parent )
{
@@ -84,9 +81,7 @@ NavigatorBar::NavigatorBar( QWidget *par
mMonth->setToolTip( i18n( "Select a month" ) );
// set up control frame layout
- QBoxLayout *ctrlLayout = new QHBoxLayout( this );
- ctrlLayout->setSpacing( 4 );
- ctrlLayout->setMargin( 0 );
+ QHBoxLayout *ctrlLayout = new QHBoxLayout( this );
ctrlLayout->addWidget( mPrevYear, 3 );
ctrlLayout->addWidget( mPrevMonth, 3 );
ctrlLayout->addWidget( mMonth, 3 );
@@ -177,18 +172,18 @@ void NavigatorBar::selectMonth()
}
}
-QPushButton *NavigatorBar::createNavigationButton( const QString &icon,
- const QString &toolTip )
+QToolButton *NavigatorBar::createNavigationButton( const QString &icon,
+ const QString &toolTip )
{
- QPushButton *button = new QPushButton( this );
+ QToolButton *button = new QToolButton( this );
button->setIcon(
KIconLoader::global()->loadIcon( icon, KIconLoader::Desktop, KIconLoader::SizeSmall ) );
// By the default the button has a very wide minimum size (for whatever
// reasons). Override this, so that the date navigator doesn't need to be
- // so wide anymore. The minimum size is dominated by the other elements of the
- // date navigator then.
+ // so wide anymore. The minimum size is dominated by the other elements of
+ // the date navigator then.
button->setMinimumSize( 10, 10 );
button->setToolTip( toolTip );
Index: korganizer/navigatorbar.h
===================================================================
Index: korganizer/navigatorbar.cpp
===================================================================