8#include "tablecellformatdialog.h"
10#include <KColorButton>
11#include <KLocalizedString>
16#include <QDialogButtonBox>
20using namespace KPIMTextEdit;
22class TableCellFormatDialog::TableCellFormatDialogPrivate
25 explicit TableCellFormatDialogPrivate(TableCellFormatDialog *qq)
28 q->setWindowTitle(
i18nc(
"@title:window",
"Cell Format"));
29 auto mainLayout =
new QVBoxLayout;
30 q->setLayout(mainLayout);
32 auto hbox =
new QHBoxLayout;
33 auto lab =
new QLabel(
i18nc(
"@label:textbox",
"Vertical Alignment:"));
35 verticalAlignment =
new QComboBox;
40 hbox->addWidget(verticalAlignment);
41 mainLayout->addLayout(hbox);
43 auto sep =
new KSeparator;
44 mainLayout->addWidget(sep);
46 hbox =
new QHBoxLayout;
47 useBackgroundColor =
new QCheckBox(
i18nc(
"@option:check",
"Background Color:"));
48 hbox->addWidget(useBackgroundColor);
49 backgroundColor =
new KColorButton;
50 backgroundColor->setDefaultColor(
Qt::white);
51 hbox->addWidget(backgroundColor);
52 mainLayout->addLayout(hbox);
55 mainLayout->addWidget(sep);
56 backgroundColor->setEnabled(
false);
64 mainLayout->addWidget(buttonBox);
67 QCheckBox *useBackgroundColor =
nullptr;
69 KColorButton *backgroundColor =
nullptr;
70 QComboBox *verticalAlignment =
nullptr;
71 TableCellFormatDialog *
const q;
74TableCellFormatDialog::TableCellFormatDialog(
QWidget *parent)
76 , d(new TableCellFormatDialogPrivate(this))
80TableCellFormatDialog::~TableCellFormatDialog() =
default;
82QColor TableCellFormatDialog::tableCellBackgroundColor()
const
84 return d->backgroundColor->color();
87void TableCellFormatDialog::setTableCellBackgroundColor(
const QColor &col)
89 d->backgroundColor->setColor(col);
90 d->useBackgroundColor->setChecked(
true);
100 d->verticalAlignment->setCurrentIndex(d->verticalAlignment->findData(QVariant(vertical)));
103bool TableCellFormatDialog::useBackgroundColor()
const
105 return d->useBackgroundColor->isChecked();
108#include "moc_tablecellformatdialog.cpp"
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)