#ifdef Q_WS_MAEMO_5
setAttribute(Qt::WA_Maemo5StackedWindow, true);
-#endif // Q_WS_MAEMO_5
+#endif
QFrame *frame = new QFrame(this);
QVBoxLayout *layout = new QVBoxLayout(frame);
closeAction->setSoftKeyRole(QAction::NegativeSoftKey);
connect(closeAction, SIGNAL(triggered()), this, SLOT(close()));
QMainWindow::addAction(closeAction);
+
+ // toolBar = new QToolBar(this);
+ // toolBar->setFixedWidth(QApplication::desktop()->
+ // availableGeometry().width());
+ // toolBar->setFixedHeight(70);
+ // toolBar->setIconSize(QSize(90, 70));
+ // toolBar->setFloatable(false);
+ // toolBar->setMovable(false);
+ // addToolBar(Qt::BottomToolBarArea, toolBar);
#else
// Tool bar
setUnifiedTitleAndToolBarOnMac(true);
- toolBar = addToolBar("controls");
+ toolBar = addToolBar("");
toolBar->setMovable(false);
toolBar->setFloatable(false);
toolBar->toggleViewAction()->setVisible(false);
if (view) {
bookView = view;
bookView->setParent(centralWidget());
- centralWidget()->layout()->addWidget(bookView);
bookView->show();
+ centralWidget()->layout()->addWidget(bookView);
}
foreach (QWidget *child, others) {
if (child) {
QAction *AdopterWindow::addToolBarAction(QObject *receiver,
const char *member,
const QString &iconName,
- const QString &text)
+ const QString &text,
+ bool important)
{
TRACE;
qDebug() << "icon" << iconName << "text" << text;
QAction *action;
#ifndef Q_OS_SYMBIAN
+ Q_UNUSED(important);
action = toolBar->addAction(QIcon(Platform::instance()->icon(iconName)),
text, receiver, member);
#else
- Q_UNUSED(iconName);
+ if (0) { // if (important) {
+ qDebug() << "Add Symbian tool bar action";
+ QAction *toolBarAction = toolBar->addAction(
+ QIcon(Platform::instance()->icon(iconName)),
+ text, receiver, member);
+ toolBarAction->setText("");
+ toolBarAction->setToolTip("");
+ connect(toolBarAction, SIGNAL(triggered()), receiver, member);
+ }
action = new QAction(text, this);
menuBar()->addAction(action);
connect(action, SIGNAL(triggered()), receiver, member);
action->setText("");
action->setToolTip("");
#endif
+
return action;
}
class QToolBar;
class QAction;
class BookView;
+class QVBoxLayout;
/**
* A toplevel window that can adopt a BookView and other children.
bool hasChild(QWidget *child);
/**
- * Add action that is visible on the tool bar (except on Symbian, where
- * it is visible on the Options menu).
+ * Add action that is visible on the tool bar.
+ * @param receiver Object receiving "activated" signal.
+ * @param slot Slot receiving "activated" signal.
+ * @param iconName Base name of tool bar icon in resource file.
+ * @param text Tool bar item text.
+ * @param important On Symbian, only "important" actions are added to
+ * the tool bar. All actions are added to the Options
+ * menu though.
*/
QAction *addToolBarAction(QObject *receiver, const char *slot,
- const QString &iconName, const QString &text);
+ const QString &iconName, const QString &text,
+ bool important = false);
/** Add spacing to tool bar. */
void addToolBarSpace();
/** Show window. */
void show();
- /** If grab is true, volume keys will generate pageUp/Down keys. */
+ /** If grab is true, volume keys will generate pageUp/Down key events. */
void grabVolumeKeys(bool grab);
public slots:
#endif
BookView *bookView;
bool grabbingVolumeKeys;/**< True, if volume keys should be grabbed. */
-#ifndef Q_OS_SYMBIAN
QToolBar *toolBar;
-#endif
};
#endif // ADOPTERWINDOW_H
TARGET.UID3 = 0xA89FC85B\r
TARGET.CAPABILITY = UserEnvironment NetworkServices ReadUserData \\r
WriteUserData\r
- TARGET.EPOCHEAPSIZE = 0x080000 0x8000000\r
+ TARGET.EPOCHEAPSIZE = 0x080000 0x4000000\r
ICON = $$PWD/pkg/symbian/book.svg\r
\r
# FIXME: Package header for Qt 4.6.2:\r
#endif
chaptersAction = addToolBarAction(this, SLOT(showChapters()),
- "chapters", tr("Chapters"));
+ "chapters", tr("Chapters"), true);
bookmarksAction = addToolBarAction(this, SLOT(showBookmarks()),
- "bookmarks", tr("Bookmarks"));
+ "bookmarks", tr("Bookmarks"), true);
infoAction = addToolBarAction(this, SLOT(showInfo()),
- "info", tr("Book info"));
+ "info", tr("Book info"), true);
libraryAction = addToolBarAction(this, SLOT(showLibrary()),
- "library", tr("Library"));
+ "library", tr("Library"), true);
#ifdef Q_WS_MAEMO_5
settingsAction = menuBar()->addAction(tr("Settings"));
{
TRACE;
view->setLastBookmark();
- event->accept();
+ AdopterWindow::closeEvent(event);
}
void MainWindow::onSettingsChanged(const QString &key)