File r878764.diff of Package kdepim4
Subject: kalarm: UI fixes
From: wstephenson@suse.de
Bug:
Patch-upstream: 878764
--- kalarm/editdlg.cpp (revision 878763)
+++ kalarm/editdlg.cpp (revision 878764)
@@ -56,6 +56,7 @@
#include <QVBoxLayout>
#include <QDragEnterEvent>
#include <QResizeEvent>
+#include <QScrollBar>
#include <QShowEvent>
#include <kglobal.h>
@@ -727,6 +728,7 @@ int EditAlarmDlg::getAlarmFlags() const
void EditAlarmDlg::showEvent(QShowEvent* se)
{
KDialog::showEvent(se);
+ DialogScroll<EditAlarmDlg>::initMinimumHeight(const_cast<EditAlarmDlg*>(this));
if (!mDeferGroupHeight)
{
if (mDeferGroup)
@@ -741,7 +743,6 @@ void EditAlarmDlg::showEvent(QShowEvent*
resize(s);
}
}
- DialogScroll<EditAlarmDlg>::initMinimumHeight(const_cast<EditAlarmDlg*>(this));
KWindowSystem::setOnDesktop(winId(), mDesktop); // ensure it displays on the desktop expected by the user
}
@@ -765,7 +766,7 @@ QSize EditAlarmDlg::minimumSizeHint() co
*/
void EditAlarmDlg::resizeEvent(QResizeEvent* re)
{
- if (isVisible())
+ if (isVisible() && mDeferGroupHeight)
{
QSize s = re->size();
s.setHeight(s.height() - (!mDeferGroup || mDeferGroup->isHidden() ? 0 : mDeferGroupHeight));
@@ -1058,6 +1059,12 @@ void EditAlarmDlg::slotShowMainPage()
mTemplateName->setFocus();
mMainPageShown = true;
}
+ else
+ {
+ // Set scroll position to top, since it otherwise jumps randomly
+ DialogScroll<EditAlarmDlg>* main = static_cast<DialogScroll<EditAlarmDlg>*>(mTabs->widget(0));
+ main->verticalScrollBar()->setValue(0);
+ }
if (mTimeWidget)
{
if (!mReadOnly && mRecurPageShown && mRecurrenceEdit->repeatType() == RecurrenceEdit::AT_LOGIN)
--- kalarm/fontcolour.h (revision 878763)
+++ kalarm/fontcolour.h (revision 878764)
@@ -38,8 +38,7 @@ public:
explicit FontColourChooser(QWidget* parent = 0,
const QStringList& fontList = QStringList(),
const QString& frameLabel = i18n("Requested font"),
- bool fg = true, bool defaultFont = false,
- int visibleListSize = 8);
+ bool fg = true, bool defaultFont = false, int visibleListSize = 8);
void setDefaultFont();
void setFont(const QFont&, bool onlyFixed = false);
Index: kalarm/editdlg.cpp
===================================================================
Index: kalarm/fontcolour.h
===================================================================