diff options
author | Sami Merilä <sami.merila@nokia.com> | 2009-09-18 16:06:46 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-09-21 08:06:19 (GMT) |
commit | 58b92a951899f74b63048a36c451d3355c0c5a7f (patch) | |
tree | fec4e8be5ca11570979e3f0a8de3f6a7407c661f /src/gui/dialogs/qfontdialog.cpp | |
parent | 75c4d11b8260ab74bcbf403c32333b81e5ef30e3 (diff) | |
download | Qt-58b92a951899f74b63048a36c451d3355c0c5a7f.zip Qt-58b92a951899f74b63048a36c451d3355c0c5a7f.tar.gz Qt-58b92a951899f74b63048a36c451d3355c0c5a7f.tar.bz2 |
S60 native looking dialog support.
Related to QTSSIXTY-63 "Make Qt dialogs look native"
S60 dialog support:
* Positioning according S60 rules:
- in portrait dialogs at the bottom of the screen,
- in landscape positioned in the center of the screen [unless device supports bottom softkeys], so that softkeys are not covered by the dialog
* If dialog shows extension, then dialog is re-positioned
* Dialog size:
- in portrait screen wide dialog, height can change
- in landscape width is the same size as width in portrait (some dialogs are maximized)
* No push buttons or DialogButtonBoxes in internal qt dialogs
(QWizard, QInputDialog, QFileDialog, QFontDialog, QColorDialog, QProgressDialog, QErrorMessage, QMessageBox), instead signals are remapped to softkeys.
* Globally, dialogbuttonboxes are converted automatically to softkeys.
OPEN:
* Needs to be re-factored slightly after softkey API refactoring is finished.
BUGS:
QWizard layout switch is wonky - dialog is not re-sized correctly.
QFontDialog will not fit into device screen (too much widgets in it). Some effort needed to be make it smaller.
Cannot set one softkey at the time softkeys => Options menu and right softkey cannot be set separately [SoftKey re-factoring will help]
Dialogs cannot get touch events to softkeys [SoftKey re-factoring will help]
Reviewed-by: Alessandro Portale
Reviewed-by: Jason Barron
Reviewed-by: mread
Reviewed-by: Shane Kearns
Diffstat (limited to 'src/gui/dialogs/qfontdialog.cpp')
-rw-r--r-- | src/gui/dialogs/qfontdialog.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/dialogs/qfontdialog.cpp b/src/gui/dialogs/qfontdialog.cpp index bb53abe..ca882c5 100644 --- a/src/gui/dialogs/qfontdialog.cpp +++ b/src/gui/dialogs/qfontdialog.cpp @@ -65,6 +65,10 @@ #include <private/qdialog_p.h> #include <private/qfont_p.h> +#if defined(Q_WS_S60) +#include <QtGui/qdesktopwidget.h> +#endif + QT_BEGIN_NAMESPACE class QFontListView : public QListView @@ -312,6 +316,8 @@ void QFontDialogPrivate::init() #if defined(Q_WS_WINCE) q->resize(180, 120); +#elif defined(Q_WS_S60) + q->resize(QApplication::desktop()->availableGeometry(QCursor::pos()).size()); #else q->resize(500, 360); #endif // Q_WS_WINCE @@ -768,7 +774,11 @@ void QFontDialogPrivate::retranslateStrings() familyAccel->setText(QFontDialog::tr("&Font")); styleAccel->setText(QFontDialog::tr("Font st&yle")); sizeAccel->setText(QFontDialog::tr("&Size")); +#ifndef Q_WS_S60 + // Removed the title due to lack of screen estate in small S60 screen. + // The effects are descriptive without a title (strikeout, underline). effects->setTitle(QFontDialog::tr("Effects")); +#endif strikeout->setText(QFontDialog::tr("Stri&keout")); underline->setText(QFontDialog::tr("&Underline")); sample->setTitle(QFontDialog::tr("Sample")); @@ -792,7 +802,7 @@ void QFontDialog::changeEvent(QEvent *e) \property QFontDialog::currentFont \brief the current font of the dialog. -*/ +*/ /*! \since 4.5 @@ -816,7 +826,7 @@ void QFontDialog::setCurrentFont(const QFont &font) d->updateFamilies(); #ifdef Q_WS_MAC - if (d->delegate) + if (d->delegate) QFontDialogPrivate::setFont(d->delegate, font); #endif } |