summaryrefslogtreecommitdiffabout
path: root/korganizer/navigatorbar.cpp
authorzautrix <zautrix>2005-02-08 16:58:16 (UTC)
committer zautrix <zautrix>2005-02-08 16:58:16 (UTC)
commit126b79abd88bb13ab41c4d987ee759eb9ba7d483 (patch) (side-by-side diff)
tree45d26727b41c6f344152ed3f4ee1dd4bc97d58b0 /korganizer/navigatorbar.cpp
parent720510bf933a86211f8e9e2465788d141f0f1149 (diff)
downloadkdepimpi-126b79abd88bb13ab41c4d987ee759eb9ba7d483.zip
kdepimpi-126b79abd88bb13ab41c4d987ee759eb9ba7d483.tar.gz
kdepimpi-126b79abd88bb13ab41c4d987ee759eb9ba7d483.tar.bz2
ffff
Diffstat (limited to 'korganizer/navigatorbar.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/navigatorbar.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/korganizer/navigatorbar.cpp b/korganizer/navigatorbar.cpp
index 7ba97c8..b591232 100644
--- a/korganizer/navigatorbar.cpp
+++ b/korganizer/navigatorbar.cpp
@@ -17,105 +17,99 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <qstring.h>
#include <qtooltip.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qframe.h>
#include <qlabel.h>
#include <qpopupmenu.h>
#include <qapplication.h>
#include <kdebug.h>
#include <klocale.h>
#include <kglobal.h>
#include <kiconloader.h>
#include "libkdepim/kdatepicker.h"
#include <knotifyclient.h>
#include "kdatetbl.h"
#include "koglobals.h"
#include <kglobalsettings.h>
#include "koprefs.h"
#ifndef KORG_NOPLUGINS
#include "kocore.h"
#endif
#include <kcalendarsystem.h>
#include "navigatorbar.h"
NavigatorBar::NavigatorBar( const QDate & date, QWidget *parent, const char *name )
: QWidget( parent, name )
{
QBoxLayout *topLayout = new QHBoxLayout( this );
// Set up the control buttons and date label
mCtrlFrame = new QFrame( this );
mCtrlFrame->setFrameStyle(QFrame::Panel|QFrame::Raised);
mCtrlFrame->setLineWidth(1);
topLayout->addWidget( mCtrlFrame );
- QFont tfont = KGlobalSettings::generalFont();//font();
- int add = 0;
- if ( QApplication::desktop()->width() >= 480 ) {
- add = 2;
- if ( QString ( name ) == QString("useBigPixmaps") )
- add += 2;
- }
- if ( add )
- tfont.setPointSize(tfont.pointSize()+add);
+ QFont tfont = font();
+ if ( QApplication::desktop()->width() >= 480 )
+ tfont.setPointSize(tfont.pointSize()+2);
tfont.setBold(true);
bool isRTL = KOGlobals::self()->reverseLayout();
#ifndef DESKTOP_VERSION
bool isDesktop = false;
#else
bool isDesktop = true;
#endif
if ( QString ( name ) == QString("useBigPixmaps") && QApplication::desktop()->width() > 320 )
isDesktop = true;
// Create backward navigation buttons
mPrevYear = new QPushButton( mCtrlFrame );
mPrevYear->setPixmap( SmallIcon( isDesktop ? "2leftarrowB" : "2leftarrow" ) );
QToolTip::add( mPrevYear, i18n("Previous Year") );
mPrevMonth = new QPushButton( mCtrlFrame );
mPrevMonth->setPixmap( SmallIcon( isDesktop ? "1leftarrowB" : "1leftarrow") );
QToolTip::add( mPrevMonth, i18n("Previous Month") );
// Create forward navigation buttons
mNextMonth = new QPushButton( mCtrlFrame );
mNextMonth->setPixmap( SmallIcon( isDesktop ? "1rightarrowB" : "1rightarrow") );
QToolTip::add( mNextMonth, i18n("Next Month") );
mNextYear = new QPushButton( mCtrlFrame );
mNextYear->setPixmap( SmallIcon( isDesktop ? "2rightarrowB": "2rightarrow") );
QToolTip::add( mNextYear, i18n("Next Year") );
mSelectMonth = new QPushButton( mCtrlFrame );
// Create month name label
//selectMonth->setFont( tfont );
// selectMonth->setAlignment( AlignCenter );
//mDateLabel = new QLabel( selectMonth );
//mDateLabel->setFont( tfont );
//mDateLabel->setAlignment( AlignCenter );
if ( QString ( name ) == QString("useBigPixmaps") ) {
mNextMonth->setFlat( true);
mNextYear->setFlat( true);
mSelectMonth->setFlat( true);
mPrevYear->setFlat( true);
mPrevMonth->setFlat( true);
}
mSelectMonth->setFont( tfont );
// Set minimum width to width of widest month name label
int i;
int maxwidth = 0;
QFontMetrics fm ( mSelectMonth->font() );
int width = fm.width("September '00" );
// for( i = 1; i <= KOGlobals::self()->calendarSystem()->monthsInYear(date);