Commit 866e15bf authored by David Jarvie's avatar David Jarvie
Browse files

Fix spacings, tidy

parent e006a1d1
......@@ -37,22 +37,22 @@ TimeEdit::TimeEdit(QWidget* parent)
mPmIndex(-1),
mReadOnly(false)
{
QHBoxLayout *hbox = new QHBoxLayout;
hbox->setMargin(0);
setLayout(hbox);
QHBoxLayout* layout = new QHBoxLayout;
layout->setMargin(0);
layout->setSpacing(0);
setLayout(layout);
bool use12hour = KLocale::global()->use12Clock();
mSpinBox = new TimeSpinBox(!use12hour, this);
hbox->addWidget(mSpinBox);
mSpinBox->setFixedSize(mSpinBox->sizeHint());
connect(mSpinBox, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)));
layout->addWidget(mSpinBox);
if (use12hour)
{
mAmPm = new ComboBox(this);
setAmPmCombo(1, 1); // add "am" and "pm" options to the combo box
mAmPm->setFixedSize(mAmPm->sizeHint());
hbox->addWidget(mAmPm);
connect(mAmPm, SIGNAL(highlighted(int)), SLOT(slotAmPmChanged(int)));
layout->addWidget(mAmPm);
}
}
......
......@@ -52,13 +52,11 @@ TimePeriod::TimePeriod(bool allowHourMinute, QWidget* parent)
mNoHourMinute(!allowHourMinute),
mReadOnly(false)
{
QHBoxLayout *layout = new QHBoxLayout;
QHBoxLayout* layout = new QHBoxLayout;
setLayout(layout);
layout->setSpacing(KDialog::spacingHint());
layout->setMargin(0);
mSpinStack = new QStackedWidget(this);
layout->addWidget(mSpinStack);
mSpinBox = new SpinBox(mSpinStack);
mSpinBox->setSingleStep(1);
mSpinBox->setSingleShiftStep(10);
......@@ -74,9 +72,9 @@ TimePeriod::TimePeriod(bool allowHourMinute, QWidget* parent)
mSpinStack->setFixedSize(mSpinBox->sizeHint().expandedTo(mTimeSpinBox->sizeHint()));
mHourMinuteRaised = mNoHourMinute;
showHourMin(!mNoHourMinute);
layout->addWidget(mSpinStack);
mUnitsCombo = new ComboBox(this);
layout->addWidget(mUnitsCombo);
mUnitsCombo->setEditable(false);
if (mNoHourMinute)
mDateOnlyOffset = 2;
......@@ -91,6 +89,7 @@ TimePeriod::TimePeriod(bool allowHourMinute, QWidget* parent)
mMaxUnitShown = Weeks;
mUnitsCombo->setFixedSize(mUnitsCombo->sizeHint());
connect(mUnitsCombo, SIGNAL(activated(int)), SLOT(slotUnitsSelected(int)));
layout->addWidget(mUnitsCombo);
setFocusProxy(mUnitsCombo);
setTabOrder(mUnitsCombo, mSpinStack);
......
......@@ -38,7 +38,6 @@
#include "timespinbox.h"
#include "buttongroup.h"
#include <KHBox>
#include <kalarmcal/kaevent.h>
#include <kalarmcal/karecurrence.h>
......@@ -52,6 +51,7 @@ using namespace KCalCore;
#include <kdialog.h>
#include <kmessagebox.h>
#include <kdatecombobox.h>
#include <KHBox>
#include <QPushButton>
#include <QLabel>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment