summaryrefslogtreecommitdiffabout
path: root/korganizer/ktimeedit.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/ktimeedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/ktimeedit.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/ktimeedit.cpp b/korganizer/ktimeedit.cpp
index 5222ac9..61a0931 100644
--- a/korganizer/ktimeedit.cpp
+++ b/korganizer/ktimeedit.cpp
@@ -28,51 +28,53 @@
#include <qlistbox.h>
#include <qapplication.h>
#include <kmessagebox.h>
#include <kglobal.h>
#include <kdebug.h>
#include <klocale.h>
#include <kpimglobalprefs.h>
#include "ktimeedit.h"
#include "koprefs.h"
#include <qvalidator.h>
// Validator for a time value with only hours and minutes (no seconds)
// Mostly locale aware. Author: David Faure <faure@kde.org>
// KTimeWidget/QTimeEdit provide nicer editing, but don't provide a combobox.
// Difficult to get all in one...
// But Qt-3.2 will offer QLineEdit::setMask, so a "99:99" mask would help.
KOTimeEdit::KOTimeEdit(QWidget *parent, QTime qt, const char *name)
: QComboBox(TRUE, parent, name)
{
setInsertionPolicy(NoInsertion);
mFlagKeyPressed = false;
-
- if ( QApplication::desktop()->width() < 650 )
+ if ( QApplication::desktop()->height() <= 480 ) {
setSizeLimit ( 6 );
+ } else {
+ setSizeLimit ( 12 );
+ }
mTime = qt;
// mNoTimeString = i18n("No Time");
// insertItem( mNoTimeString );
// Fill combo box with selection of times in localized format.
QTime timeEntry(0,0,0);
do {
insertItem(KGlobal::locale()->formatTime(timeEntry));
timeEntry = timeEntry.addSecs(60*15);
} while (!timeEntry.isNull());
// Add end of day.
insertItem( KGlobal::locale()->formatTime( QTime( 23, 59, 59 ) ) );
updateText();
setFocusPolicy(QWidget::StrongFocus);
connect(this, SIGNAL(activated(int)), this, SLOT(activ(int)));
connect(this, SIGNAL(highlighted(int)), this, SLOT(hilit(int)));
connect(this,SIGNAL(textChanged(const QString&)),this,SLOT(changedText()));
QFontMetrics fm ( font() );
QString timeString = "24:00";
if ( KPimGlobalPrefs::instance()->mPreferredTime == 1 )
timeString = "02:00pm";