return;
}
- addAction(tr("Add bookmark"), this, SLOT(onAdd()));
+ addAction(tr("Add bookmark"), this, SLOT(onAdd()), ":/icons/add.png");
#ifndef Q_WS_MAEMO_5
addItemAction(tr("Go to"), this, SLOT(onGo()));
addItemAction(tr("Delete"), this, SLOT(onDelete()));
this, SLOT(onItemActivated(const QModelIndex &)));
#ifndef Q_WS_MAEMO_5
- addAction(tr("Close"), this, SLOT(close()), QDialogButtonBox::RejectRole);
+ addAction(tr("Close"), this, SLOT(close()), QString(),
+ QDialogButtonBox::RejectRole);
#endif // Q_WS_MAEMO_5
}
<file>icons/chapters.png</file>
<file>icons/mac/chapters.png</file>
<file>icons/library.png</file>
+ <file>icons/add.png</file>
+ <file>icons/folder.png</file>
</qresource>
</RCC>
addItemAction(tr("Delete"), this, SLOT(onRemove()));
#endif // ! Q_WS_MAEMO_5
- addAction(tr("Add book"), this, SLOT(onAdd()));
- addAction(tr("Add books from folder"), this, SLOT(onAddFolder()));
+ addAction(tr("Add book"), this, SLOT(onAdd()), ":/icons/add.png");
+ addAction(tr("Add books from folder"), this, SLOT(onAddFolder()),
+ ":/icons/folder.png");
// Create and add list view
list = new ListView(this);
// Handle progress
connect(view, SIGNAL(progress(qreal)), progress, SLOT(setProgress(qreal)));
- // Shadow window for full screen
+ // Shadow window for full screen reading
fullScreenWindow = new FullScreenWindow(this);
connect(fullScreenWindow, SIGNAL(restore()), this, SLOT(showRegular()));
Book icon by bmson (http://bmson.deviantart.com/)
+
Basic Icons by PixelMixer (http://pixel-mixer.com/)
+
Sample book "2 B R 0 2 B" by Kurt Vonnegut, digitized by
- Project Gutenberg (http://www.gutenberg.org/)
+Project Gutenberg (http://www.gutenberg.org/)
+
Zlib data compression library are copyright (C) 1995-2010 Jean-loup Gailly and
- Mark Adler (http://zlib.net/)
+Mark Adler (http://zlib.net/)
+
Minizip library copyright (C) 1998-2010 Gilles Vollant, Even Rouault and
- Mathias Svensson (http://www.winimage.com/zLibDll/minizip.html)q
+Mathias Svensson (http://www.winimage.com/zLibDll/minizip.html)
dorian (0.1.6-1) unstable; urgency=low
+ * Adjust zoom level in steps
+ * Adjust dialog boxes according to orientation
+ * Add icons to buttons
+
-- Akos Polster <akos@pipacs.com> Sun, 29 Aug 2010 02:00:00 +0200
dorian (0.1.5-1) unstable; urgency=low
#include "toolbuttonbox.h"
#ifdef Q_OS_SYMBIAN
-#define DEFAULT_ORIENTATION "portrait"
+const char *DEFAULT_ORIENTATION = "portrait";
#else
-#define DEFAULT_ORIENTATION "landscape"
+const char *DEFAULT_ORIENTATION = "landscape";
#endif
+const int ZOOM_MIN = 75;
+const int ZOOM_MAX = 250;
+const int ZOOM_STEP = 25;
+
SettingsWindow::SettingsWindow(QWidget *parent): QMainWindow(parent)
{
#ifdef Q_WS_MAEMO_5
layout->addWidget(grabVolume);
grabVolume->setChecked(settings->value("usevolumekeys", false).toBool());
- QLabel *zoomLabel = new QLabel(tr("Zoom level:"), contents);
+ int zoom = Settings::instance()->value("zoom").toInt();
+ if (zoom < ZOOM_MIN) {
+ zoom = ZOOM_MIN;
+ } else if (zoom > ZOOM_MAX) {
+ zoom = ZOOM_MAX;
+ }
+ zoomLabel = new QLabel(tr("Zoom level: %1%").arg(zoom), contents);
layout->addWidget(zoomLabel);
zoomSlider = new QSlider(Qt::Horizontal, contents);
- zoomSlider->setMinimum(50);
- zoomSlider->setMaximum(300);
- zoomSlider->setValue(Settings::instance()->value("zoom").toInt());
+ zoomSlider->setMinimum(ZOOM_MIN);
+ zoomSlider->setMaximum(ZOOM_MAX);
+ zoomSlider->setSingleStep(ZOOM_STEP);
+ zoomSlider->setPageStep(ZOOM_STEP);
+ zoomSlider->setValue(zoom);
layout->addWidget(zoomSlider);
QLabel *fontLabel = new QLabel(tr("Font:"), contents);
void SettingsWindow::onSliderValueChanged(int value)
{
-#ifdef Q_WS_MAEMO_5 // Re-scaling the book view is too much for the N900
- Q_UNUSED(value);
+ int step = zoomSlider->singleStep();
+ if (value % step) {
+ zoomSlider->setValue((value + step / 2) / step * step);
+ return;
+ }
+ zoomLabel->setText(tr("Zoom level: %1%").arg(value));
+#ifdef Q_WS_MAEMO_5
+ // Re-scaling the book view is too much for the N900
#else
Settings::instance()->setValue("zoom", value);
#endif // Q_WS_MAEMO_5
class QFont;
class QSlider;
class QFontComboBox;
+class QLabel;
class ToolButtonBox;
class SettingsWindow: public QMainWindow
private:
QSlider *zoomSlider;
+ QLabel *zoomLabel;
QFontComboBox *fontButton;
ToolButtonBox *orientationBox;
};
contentLayout->setMargin(0);
content->setLayout(contentLayout);
- buttonBox = new QDialogButtonBox(Qt::Vertical, this);
- QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
- horizontalLayout->addWidget(scroller);
- horizontalLayout->addWidget(buttonBox);
- setLayout(horizontalLayout);
+ QBoxLayout *boxLayout;
+ QRect screenGeometry = QApplication::desktop()->screenGeometry();
+ if (screenGeometry.width() < screenGeometry.height()) {
+ buttonBox = new QDialogButtonBox(Qt::Horizontal, this);
+ boxLayout = new QVBoxLayout(this);
+ } else {
+ buttonBox = new QDialogButtonBox(Qt::Vertical, this);
+ boxLayout = new QHBoxLayout(this);
+ }
+ boxLayout->addWidget(scroller);
+ boxLayout->addWidget(buttonBox);
+ setLayout(boxLayout);
scroller->setWidget(content);
content->show();
}
void ListWindow::addAction(const QString &title, QObject *receiver,
- const char *slot, QDialogButtonBox::ButtonRole role)
+ const char *slot, const QString &iconPath,
+ QDialogButtonBox::ButtonRole role)
{
Trace t("ListWindow::addAction");
#ifndef Q_WS_MAEMO_5
+ Q_UNUSED(iconPath);
QPushButton *button = buttonBox->addButton(title, role);
connect(button, SIGNAL(clicked()), receiver, slot);
#else
Q_UNUSED(role);
- // QAction *action = menuBar()->addAction(title);
- // connect(action, SIGNAL(triggered()), receiver, slot);
- QPushButton *button = new QPushButton(title, this);
+ QPushButton *button = new QPushButton(QIcon(iconPath), title, this);
contentLayout->addWidget(button);
connect(button, SIGNAL(clicked()), receiver, slot);
#endif // ! Q_WS_MAEMO_5
* Activating the action invokes the slot with no parameters.
*/
void addAction(const QString &title, QObject *receiver, const char *slot,
+ const QString &iconPath = QString(),
QDialogButtonBox::ButtonRole role = QDialogButtonBox::ActionRole);
/**