Messagelib
themeeditor.cpp
49 static const char gThemeContentItemTypeDndMimeDataFormat[] = "application/x-kmail-messagelistview-theme-contentitem-type";
51 ThemeColumnPropertiesDialog::ThemeColumnPropertiesDialog(QWidget *parent, Theme::Column *column, const QString &title)
80 mMessageSortingCombo->setToolTip(i18n("The sorting order that clicking on this column header will switch to."));
84 mVisibleByDefaultCheck->setToolTip(i18n("Check this if this column should be visible when the theme is selected."));
88 mIsSenderOrReceiverCheck->setToolTip(i18n("Check this if this column label should be updated depending on the folder \"inbound\"/\"outbound\" type."));
94 connect(okButton, &QPushButton::clicked, this, &ThemeColumnPropertiesDialog::slotOkButtonClicked);
100 ComboBoxUtils::fillIntegerOptionCombo(mMessageSortingCombo, SortOrder::enumerateMessageSortingOptions(Aggregation::PerfectReferencesAndSubject));
114 static_cast<SortOrder::MessageSorting>(ComboBoxUtils::getIntegerOptionComboValue(mMessageSortingCombo, SortOrder::NoMessageSorting)));
119 ThemeContentItemSourceLabel::ThemeContentItemSourceLabel(QWidget *parent, Theme::ContentItem::Type type)
177 mSampleGroupHeaderItem->setSubject(i18n("Very long subject very long subject very long subject very long subject very long subject very long"));
186 mSampleMessageItem->setSubject(i18n("Very long subject very long subject very long subject very long subject very long subject very long"));
192 list.append(new MessageItem::Tag(QIcon::fromTheme(QStringLiteral("feed-subscribe")).pixmap(KIconLoader::SizeSmall), i18n("Sample Tag 1"), QString()));
193 list.append(new MessageItem::Tag(QIcon::fromTheme(QStringLiteral("feed-subscribe")).pixmap(KIconLoader::SizeSmall), i18n("Sample Tag 2"), QString()));
194 list.append(new MessageItem::Tag(QIcon::fromTheme(QStringLiteral("feed-subscribe")).pixmap(KIconLoader::SizeSmall), i18n("Sample Tag 3"), QString()));
246 connect(header(), &QWidget::customContextMenuRequested, this, &ThemePreviewWidget::slotHeaderContextMenuRequested);
409 label += QStringLiteral(" (%1)").arg(i18nc("Indicates whether or not a header label is visible", "Visible"));
546 const_cast<Theme::Column *>(mDelegate->hitColumn())->insertMessageRow(mDelegate->hitRowIndex(), row);
548 const_cast<Theme::Column *>(mDelegate->hitColumn())->insertGroupHeaderRow(mDelegate->hitRowIndex(), row);
557 const_cast<Theme::Column *>(mDelegate->hitColumn())->insertMessageRow(mDelegate->hitRowIndex() + 1, row);
559 const_cast<Theme::Column *>(mDelegate->hitColumn())->insertGroupHeaderRow(mDelegate->hitRowIndex() + 1, row);
586 idx = mDelegate->hitContentItemRight() ? row->rightItems().indexOf(const_cast<Theme::ContentItem *>(mDelegate->hitContentItem()))
605 idx = mDelegate->hitContentItemRight() ? row->rightItems().indexOf(const_cast<Theme::ContentItem *>(mDelegate->hitContentItem()))
644 bool ThemePreviewWidget::computeContentItemInsertPosition(const QPoint &pos, Theme::ContentItem::Type type)
729 // either there were some right items (so the theme delegate knows that the reported item is the closest)
730 // or there were no right items but the position is closest to the left item than the right row end
806 if (mDelegate->hitRow()->rightItems().isEmpty() && mDelegate->hitRow()->leftItems().isEmpty()) {
809 const_cast<Theme::Column *>(mDelegate->hitColumn())->removeMessageRow(const_cast<Theme::Row *>(mDelegate->hitRow()));
814 const_cast<Theme::Column *>(mDelegate->hitColumn())->removeGroupHeaderRow(const_cast<Theme::Row *>(mDelegate->hitRow()));
841 mThemeSelectedContentItemRect = mSelectedThemeContentItem ? mDelegate->hitContentItemRect() : QRect();
883 QAction *act = childmenu->addAction(i18nc("@action:inmenu Foreground color setting", "Default"));
894 connect(childmenu, &QMenu::triggered, this, &ThemePreviewWidget::slotForegroundColorMenuTriggered);
905 childmenu->addAction(i18nc("Hide a mark if the mail does not have the attribute, e.g. Important mark on a non important mail", "Hide"));
911 i18nc("Keep a empty space in the list if the mail does not have the attribute, e.g. Important mark on a non important mail",
915 act->setChecked(!(mSelectedThemeContentItem->softenByBlendingWhenDisabled() || mSelectedThemeContentItem->hideWhenDisabled()));
918 i18nc("Show the icon softened in the list if the mail does not have the attribute, e.g. Important mark on a non important mail",
925 connect(childmenu, &QMenu::triggered, this, &ThemePreviewWidget::slotDisabledFlagsMenuTriggered);
940 QAction *act = childmenu->addAction(i18nc("@action:inmenu Group header background color setting", "None"));
945 act = childmenu->addAction(i18nc("@action:inmenu Group header background color setting", "Automatic"));
950 act = childmenu->addAction(i18nc("@action:inmenu Group header background color setting", "Custom..."));
956 connect(childmenu, &QMenu::triggered, this, &ThemePreviewWidget::slotGroupHeaderBackgroundModeMenuTriggered);
971 act->setChecked(mTheme->groupHeaderBackgroundStyle() == static_cast<Theme::GroupHeaderBackgroundStyle>((*it).second));
975 connect(childmenu, &QMenu::triggered, this, &ThemePreviewWidget::slotGroupHeaderBackgroundStyleMenuTriggered);
1006 mSelectedThemeContentItem->setSoftenByBlendingWhenDisabled(flags == Theme::ContentItem::SoftenByBlendingWhenDisabled);
1047 mSelectedThemeContentItem->setSoftenByBlending(!mSelectedThemeContentItem->softenByBlending());
1063 if (flag == Theme::ContentItem::IsBold && mSelectedThemeContentItem->isBold() != act->isChecked()) {
1066 } else if (flag == Theme::ContentItem::IsItalic && mSelectedThemeContentItem->isItalic() != act->isChecked()) {
1075 Theme::GroupHeaderBackgroundMode mode = static_cast<Theme::GroupHeaderBackgroundMode>(act->data().toInt(&ok));
1106 Theme::GroupHeaderBackgroundStyle mode = static_cast<Theme::GroupHeaderBackgroundStyle>(act->data().toInt(&ok));
1120 if (mThemeSelectedContentItemRect.isValid() || (mDropIndicatorPoint1 != mDropIndicatorPoint2)) {
1229 auto dlg = new ThemeColumnPropertiesDialog(this, mSelectedThemeColumn, i18n("Add New Column"));
1253 auto dlg = new ThemeColumnPropertiesDialog(this, mSelectedThemeColumn, i18n("Column Properties"));
1431 i18n("Right click on the header to add or modify columns. Drag the content items and drop them on the columns in order to compose your theme. Right "
1459 QObject::connect(mIconSizeSpinBox, &KPluralHandlingSpinBox::valueChanged, this, &ThemeEditor::slotIconSizeSpinBoxValueChanged);
1484 ComboBoxUtils::setIntegerOptionComboValue(mViewHeaderPolicyCombo, (int)mCurrentTheme->viewHeaderPolicy());
1507 mCurrentTheme->setViewHeaderPolicy((Theme::ViewHeaderPolicy)ComboBoxUtils::getIntegerOptionComboValue(mViewHeaderPolicyCombo, 0));
1514 ComboBoxUtils::fillIntegerOptionCombo(mViewHeaderPolicyCombo, Theme::enumerateViewHeaderPolicyOptions());
void append(const T &value)
QByteArray data(const QString &mimeType) const const
@ PerfectReferencesAndSubject
Thread by all of the above and try to match subjects too.
Definition: aggregation.h:69
QPoint pos() const const
AlignCenter
const QString & description() const
Returns a description of this option set.
Definition: optionset.h:79
@ AttachmentStateIcon
The icon that displays the attachment state (may be disabled)
Definition: theme.h:139
static bool applicableToGroupHeaderItems(Type type)
Static test that returns true if an instance of ContentItem with the specified type makes sense in a ...
Definition: theme.cpp:283
FontChange
QPoint topLeft() const const
void setShortcut(const QKeySequence &key)
Raised
int right() const const
static QVector< QPair< QString, int > > enumerateViewHeaderPolicyOptions()
Enumerates the available view header policy options.
Definition: theme.cpp:1045
Qt::MouseButton button() const const
void customContextMenuRequested(const QPoint &pos)
int count(const T &value) const const
The ThemeDelegate paints the message list view message and group items by using the supplied Theme.
Definition: themedelegate.h:30
QPoint pos() const const
void clicked(bool checked)
QIcon fromTheme(const QString &name)
int width() const const
static bool applicableToMessageItems(Type type)
Static test that returns true if an instance of ContentItem with the specified type makes sense in a ...
Definition: theme.cpp:278
This class is an optimizing helper for dealing with large flat QAbstractItemModel objects.
Definition: modelinvariantrowmapper.h:87
QVector::const_iterator constEnd() const const
CustomContextMenu
@ IsBold
For text items. If set then always show as bold, otherwise use the default font weight.
Definition: theme.h:220
void acceptProposedAction()
QList::const_iterator constBegin() const const
int x() const const
int y() const const
const QMimeData * mimeData() const const
QPoint bottomRight() const const
KIOFILEWIDGETS_EXPORT QStringList list(const QString &fileClass)
bool contains(const QRect &rectangle, bool proper) const const
LeftButton
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
static QString description(Type type)
Returns a descriptive name for the specified content item type.
Definition: theme.cpp:103
int left() const const
@ CombinedReadRepliedStateIcon
The combined icon that displays the unread/read/replied/forwarded state (never disabled)
Definition: theme.h:191
void reserve(int alloc)
QColor getColor(const QColor &initial, QWidget *parent, const QString &title, QColorDialog::ColorDialogOptions options)
int bottom() const const
virtual void changeEvent(QEvent *ev) override
int top() const const
ItemIsEnabled
static QVector< QPair< QString, int > > enumerateGroupHeaderBackgroundStyles()
Enumerates the available group header background styles.
Definition: theme.cpp:1050
QString i18n(const char *text, const TYPE &arg...)
constexpr bool isEmpty() const
KLocalizedString KI18N_EXPORT ki18ncp(const char *context, const char *singular, const char *plural)
void accept()
@ AutoColor
Automatically determine the color (somewhere in the middle between background and text)
Definition: theme.h:801
virtual void showEvent(QShowEvent *event)
static QVector< QPair< QString, int > > enumerateMessageSortingOptions(Aggregation::Threading t)
Enumerates the message sorting options compatible with the specified Threading setting.
Definition: sortorder.cpp:60
Qt::MouseButtons buttons() const const
void setText(const QString &text)
@ RepliedStateIcon
The icon that displays the replied/forwarded state (may be disabled)
Definition: theme.h:143
int toInt(bool *ok) const const
virtual void mouseMoveEvent(QMouseEvent *event) override
int manhattanLength() const const
bool isEmpty() const const
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
virtual void mousePressEvent(QMouseEvent *event) override
Accepted
SizeSmall
virtual bool hasFormat(const QString &mimeType) const const
Key_Return
QPoint bottomLeft() const const
bool isValid() const const
void ignore()
void setCheckable(bool)
QVariant data() const const
void setData(const QVariant &userData)
QString label(StandardShortcut id)
StyledPanel
Definition: aggregation.h:21
The Theme class defines the visual appearance of the MessageList.
Definition: theme.h:48
CopyAction
void triggered(bool checked)
A message item that can have a fake tag list and a fake annotation.
Definition: messageitem.h:195
void resize(int size)
QList::const_iterator constEnd() const const
void setEnabled(bool)
void rejected()
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
QPoint topRight() const const
GroupHeaderBackgroundMode
Which color do we use to paint group header background ?
Definition: theme.h:799
void ignore()
CTRL
@ IsItalic
Fot text items. If set then always show as italic, otherwise use the default font style.
Definition: theme.h:221
QString i18nc(const char *context, const char *text, const TYPE &arg...)
bool isValid() const const
void setDefault(bool)
@ SoftenByBlendingWhenDisabled
In disabled state the icon should be still shown, but made very soft by alpha blending.
Definition: theme.h:218
QList::iterator begin()
QModelIndex parent() const const
int size() const const
KGuiItem ok()
void valueChanged(int i)
QVector::const_iterator constBegin() const const
The base class for the OptionSet editors.
Definition: optionseteditor.h:28
void setChecked(bool)
A single item of the MessageList tree managed by MessageList::Model.
Definition: item.h:47
QList::iterator end()
virtual void paintEvent(QPaintEvent *event) override
@ UseCustomColor
For text and vertical line. If set then always use a custom color, otherwise use default text color.
Definition: theme.h:219
const QList< QKeySequence > & end()
black
char * data()
@ HideWhenDisabled
In disabled state the icon should take no space (overrides SoftenByBlendingWhenDisabled)
Definition: theme.h:217
int stat(const QString &path, KDE_struct_stat *buf)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Mar 27 2023 04:08:18 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Mar 27 2023 04:08:18 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.