QVBoxLayout *layout = new QVBoxLayout(frame);
layout->setMargin(0);
frame->setLayout(layout);
- frame->show();
+ //frame->show();
setCentralWidget(frame);
#ifdef Q_OS_SYMBIAN
bookView = view;
bookView->setParent(this);
- bookView->show();
centralWidget()->layout()->addWidget(bookView);
+ bookView->show();
progress = prog;
previousButton = previous;
{
TRACE;
if (bookView) {
+ bookView->hide();
centralWidget()->layout()->removeWidget(bookView);
}
bookView = 0;
void AdopterWindow::show()
{
+ Trace t("AdopterWindow::show");
#ifdef Q_OS_SYMBIAN
foreach (QWidget *w, QApplication::allWidgets()) {
w->setContextMenuPolicy(Qt::NoContextMenu);
}
showMaximized();
- raise();
#else
QMainWindow::show();
#endif
{
Trace t("AdopterWindow::showEvent");
+ QMainWindow::showEvent(e);
#if defined(Q_WS_MAEMO_5)
doGrabVolumeKeys(grabbingVolumeKeys);
#endif // Q_WS_MAEMO_5
- QMainWindow::showEvent(e);
+ placeDecorations();
}
void AdopterWindow::resizeEvent(QResizeEvent *event)
{
Trace t("AdopterWindow::resizeEvent");
-
-#ifdef Q_OS_SYMBIAN
- if (toolBar) {
- if (portrait()) {
- qDebug() << "Show tool bar";
- toolBar->setVisible(true);
- } else {
- qDebug() << "Hide tool bar";
- toolBar->setVisible(false);
- }
- }
-#endif // Q_OS_SYMBIAN
-
- if (hasBookView()) {
- QTimer::singleShot(100, this, SLOT(placeDecorations()));
- }
QMainWindow::resizeEvent(event);
+ placeDecorations();
}
void AdopterWindow::keyPressEvent(QKeyEvent *event)
{
Trace t("AdopterWindow::placeDecorations");
+#ifdef Q_OS_SYMBIAN
+ if (toolBar) {
+ if (portrait()) {
+ qDebug() << "Show tool bar";
+ toolBar->setVisible(true);
+ } else {
+ qDebug() << "Hide tool bar";
+ toolBar->setVisible(false);
+ }
+ }
+#endif // Q_OS_SYMBIAN
+
if (!hasBookView()) {
return;
}
connect(restoreButton, SIGNAL(triggered()), this, SIGNAL(restore()));
}
-void FullScreenWindow::showFullScreen()
+void FullScreenWindow::showEvent(QShowEvent *e)
{
- Trace t("FullScreenWindow::showFullScreen");
- AdopterWindow::showFullScreen();
+ Trace t("FullScreenWindow::showEvent");
+ AdopterWindow::showEvent(e);
placeChildren();
}
void FullScreenWindow::resizeEvent(QResizeEvent *e)
{
Trace t("FullScreenWindow::resizeEvent");
- QTimer::singleShot(100, this, SLOT(placeChildren()));
AdopterWindow::resizeEvent(e);
+ placeChildren();
}
void FullScreenWindow::placeChildren()
public:
explicit FullScreenWindow(QWidget *parent);
- /** Swith to full screen, and flash the restore button. */
- void showFullScreen();
-
/**
* Adopt children.
* Same as @AdopterWindow::takeChildren(), but saves prog, previous
/** Handle size (and orientation) change. */
void resizeEvent(QResizeEvent *e);
+ /** Handle show event. */
+ void showEvent(QShowEvent *e);
+
protected slots:
/** Re-align adopted child windows. */
void placeChildren();
connect(next, SIGNAL(triggered()), this, SLOT(goToNextPage()));
connect(prev, SIGNAL(triggered()), this, SLOT(goToPreviousPage()));
- // Adopt view, show window
- showRegular();
-
#ifdef DORIAN_TEST_MODEL
(void)new ModelTest(Library::instance(), this);
#endif
library->setNowReading(sorted.mapToSource(sorted.index(0, 0)));
}
}
+
+ // Show in regular (non full-screen) mode
+ showRegular();
}
void MainWindow::onCurrentBookChanged()
fullScreenWindow->hide();
show();
-#if defined(Q_OS_SYMBIAN)
+
+#if 0 // #if defined(Q_OS_SYMBIAN)
activateWindow();
#endif
}
leaveBookView();
fullScreenWindow->takeBookView(view, prog, prev, next);
-// #ifdef Q_OS_SYMBIAN
+ fullScreenWindow->showFullScreen();
hide();
-// #endif
- fullScreenWindow->showFullScreen();
-#ifdef Q_OS_SYMBIAN
+#if 0 // #ifdef Q_OS_SYMBIAN
fullScreenWindow->activateWindow();
#endif
}