Changeset View
Changeset View
Standalone View
Standalone View
core/printoptionswidget.cpp
- This file was added.
1 | /*************************************************************************** | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2019 Michael Weghorn <m.weghorn@posteo.de> * | ||||
3 | * * | ||||
4 | * This program is free software; you can redistribute it and/or modify * | ||||
5 | * it under the terms of the GNU General Public License as published by * | ||||
6 | * the Free Software Foundation; either version 2 of the License, or * | ||||
7 | * (at your option) any later version. * | ||||
8 | ***************************************************************************/ | ||||
9 | | ||||
10 | #include "printoptionswidget.h" | ||||
11 | | ||||
12 | #include <QComboBox> | ||||
13 | #include <QFormLayout> | ||||
14 | | ||||
15 | #include <KLocalizedString> | ||||
16 | | ||||
17 | namespace Okular { | ||||
18 | | ||||
19 | DefaultPrintOptionsWidget::DefaultPrintOptionsWidget(QWidget *parent) | ||||
20 | : PrintOptionsWidget(parent) | ||||
21 | { | ||||
22 | setWindowTitle( i18n( "Print Options" ) ); | ||||
23 | QFormLayout *layout = new QFormLayout(this); | ||||
24 | m_ignorePrintMargins = new QComboBox; | ||||
25 | // value indicates whether full page is enabled (i.e. print margins ignored) | ||||
26 | m_ignorePrintMargins->insertItem(0, i18n("Fit to printable area"), false); | ||||
27 | m_ignorePrintMargins->insertItem(1, i18n("Fit to full page"), true); | ||||
28 | layout->addRow(i18n("Scale mode:"), m_ignorePrintMargins); | ||||
29 | } | ||||
30 | | ||||
31 | bool DefaultPrintOptionsWidget::ignorePrintMargins() const | ||||
32 | { | ||||
33 | return m_ignorePrintMargins->currentData().value<bool>(); | ||||
34 | } | ||||
35 | | ||||
36 | } |