Changeset 94 in tspsg-svn for trunk/src/settingsdialog.cpp
- Timestamp:
- Feb 25, 2010, 9:48:46 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/settingsdialog.cpp
r93 r94 43 43 44 44 #if defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) 45 // Layout helper elements 46 QVBoxLayout *vbox1; 47 QHBoxLayout *hbox1; 45 QVBoxLayout *vbox1; // Layout helper 46 47 #ifdef Q_OS_WINCE 48 // On screens with small height when SIP is shown and the window is resized 49 // there is not enought space for all elements. 50 // So we show scrollbars to be able to access them. 51 QScrollArea *scrollArea = new QScrollArea(this); 52 scrollArea->setFrameShape(QFrame::NoFrame); 53 scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 54 scrollArea->setWidgetResizable(true); 55 scrollArea->setWidget(bgWhite); 56 #endif // Q_OS_WINCE 48 57 49 58 bgWhite->layout()->setMargin(0); 50 51 // Bottom part (with grey bg)52 hbox1 = new QHBoxLayout(bgGrey);53 hbox1->setMargin(6);54 hbox1->setSpacing(6);55 hbox1->addWidget(buttonHelp);56 hbox1->addStretch();57 59 58 60 // Central layout … … 60 62 vbox1->setMargin(0); 61 63 vbox1->setSpacing(0); 64 #ifdef Q_OS_WINCE 65 vbox1->addWidget(scrollArea); 66 #else 62 67 vbox1->addWidget(bgWhite); 63 vbox1->addWidget(lineHorizontal); 68 #endif // Q_OS_WINCE 64 69 vbox1->addWidget(bgGrey); 70 setLayout(vbox1); 65 71 #else 66 72 // Layout helper elements 67 73 QVBoxLayout *vbox1, *vbox2; 68 QHBoxLayout *hbox1 , *hbox2;74 QHBoxLayout *hbox1; 69 75 70 76 if (QtWin::isCompositionEnabled()) { … … 89 95 imgIcon->setObjectName("imgIcon"); 90 96 imgIcon->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding); 91 imgIcon->setFrameShape(QFrame::Panel); 92 imgIcon->setLineWidth(0); 97 imgIcon->setFrameShape(QFrame::NoFrame); 93 98 imgIcon->setPixmap(QPixmap(":/images/icons/preferences_system.png")); 94 99 imgIcon->setStyleSheet("background-color: #0080C0; padding-top: 11px;"); … … 128 133 #endif // Q_OS_WIN32 129 134 130 // Bottom part (with grey bg) 131 hbox2 = new QHBoxLayout(bgGrey); 132 hbox2->setMargin(6); 133 hbox2->setSpacing(6); 134 hbox2->addWidget(buttonHelp); 135 hbox2->addWidget(labelHint); 136 hbox2->addWidget(buttonBox); 135 // Inserting label for hints to the bottom part (with grey bg) 136 buttons->insertWidget(buttons->indexOf(buttonHelp) + 1, labelHint, 1); 137 137 138 138 // Central layout … … 141 141 vbox2->setSpacing(0); 142 142 vbox2->addLayout(hbox1); 143 vbox2->addWidget(lineHorizontal);144 143 vbox2->addWidget(bgGrey); 145 #endif // Q_OS_WINCE 146 144 setLayout(vbox2); 145 #endif // Q_OS_WINCE 146 147 #ifdef Q_OS_WINCE 148 currentGeometry = QApplication::desktop()->availableGeometry(0); 149 // We need to react to SIP show/hide and resize the window appropriately 150 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(desktopResized(int))); 151 #endif // Q_OS_WINCE 147 152 connect(spinRandMin,SIGNAL(valueChanged(int)),this,SLOT(spinRandMinValueChanged(int))); 148 153 connect(buttonFont,SIGNAL(clicked()),this,SLOT(buttonFontClicked())); … … 211 216 212 217 /*! 213 * 218 * \brief Indicates whether and how the translucency setting was changed 219 * \retval -1 the translucency was \em disabled. 220 * \retval 0 the translucency was <em>not changed</em>. 221 * \retval 1 the translucency was \em enabled. 214 222 */ 215 223 qint8 SettingsDialog::translucencyChanged() const … … 277 285 } 278 286 287 #ifdef Q_OS_WINCE 288 void SettingsDialog::desktopResized(int screen) 289 { 290 if (screen != 0) 291 return; 292 293 QRect availableGeometry = QApplication::desktop()->availableGeometry(0); 294 if (currentGeometry != availableGeometry) { 295 /*! 296 * \hack HACK: This hack checks whether \link QDesktopWidget::availableGeometry() availableGeometry()\endlink's \c top + \c hegiht = \link QDesktopWidget::screenGeometry() screenGeometry()\endlink's \c height. 297 * If \c true, the window gets maximized. If we used \c setGeometry() in this case, the bottom of the 298 * window would end up being behind the soft buttons. Is this a bug in Qt or Windows Mobile? 299 */ 300 if ((availableGeometry.top() + availableGeometry.height()) == QApplication::desktop()->screenGeometry().height()) { 301 setWindowState(windowState() | Qt::WindowMaximized); 302 } else { 303 if (windowState() & Qt::WindowMaximized) 304 setWindowState(windowState() ^ Qt::WindowMaximized); 305 setGeometry(availableGeometry); 306 } 307 } 308 currentGeometry = availableGeometry; 309 } 310 #endif // Q_OS_WINCE 311 279 312 void SettingsDialog::spinRandMinValueChanged(int val) { 280 313 spinRandMax->setMinimum(val);
Note: See TracChangeset
for help on using the changeset viewer.