KTextEditor
katethemeconfig.cpp
194 "<p>Sets the background color of the selection.</p><p>To set the text color for selected text, use the "<b>Configure Highlighting</b>" "
202 ci.whatsThis = i18n("<p>Sets the background color of the currently active line, which means the line where your cursor is positioned.</p>");
242 ci.whatsThis = i18n("<p>This color will be used to draw the number of the current line (if enabled).</p>");
249 ci.whatsThis = i18n("<p>This color will be used to draw the line between line numbers and the icon borders, if both are enabled.</p>");
257 "<p>Sets the color of Word Wrap-related markers:</p><dl><dt>Static Word Wrap</dt><dd>A vertical line which shows the column where text is going to be "
273 ci.whatsThis = i18n("<p>Sets the color of the line modification marker for modified lines.</p>");
292 ci.whatsThis = i18n("<p>Sets the color of the line that is used to indicate spelling mistakes.</p>");
314 "<p>Sets the bracket matching color. This means, if you place the cursor e.g. at a <b>(</b>, the matching <b>)</b> will be highlighted with this "
324 const QString markerNames[KSyntaxHighlighting::Theme::MarkError - KSyntaxHighlighting::Theme::MarkBookmark + 1] = {i18n("Bookmark"),
332 ci.whatsThis = i18n("<p>Sets the background color of mark type.</p><p><b>Note</b>: The marker color is displayed lightly because of transparency.</p>");
333 for (int i = 0; i <= KSyntaxHighlighting::Theme::MarkError - KSyntaxHighlighting::Theme::MarkBookmark; ++i) {
334 ci.role = static_cast<KSyntaxHighlighting::Theme::EditorColorRole>(i + KSyntaxHighlighting::Theme::MarkBookmark);
434 static const auto idx = KSyntaxHighlighting::Theme::staticMetaObject.indexOfEnumerator("EditorColorRole");
489KateThemeConfigDefaultStylesTab::KateThemeConfigDefaultStylesTab(KateThemeConfigColorTab *colorTab)
497 connect(m_defaultStyles, &KateStyleTreeWidget::changed, this, &KateThemeConfigDefaultStylesTab::changed);
517 const KSyntaxHighlighting::Theme currentTheme = KateHlManager::self()->repository().theme(schema);
568 QTreeWidgetItem *parent = new QTreeWidgetItem(m_defaultStyles, QStringList() << i18nc("@item:intable", "Normal Text & Source Code"));
570 for (int i = (int)KSyntaxHighlighting::Theme::TextStyle::Normal; i <= (int)KSyntaxHighlighting::Theme::TextStyle::Attribute; ++i) {
571 m_defaultStyles->addItem(parent, defaultStyleName(static_cast<KSyntaxHighlighting::Theme::TextStyle>(i)), l->at(i));
575 parent = new QTreeWidgetItem(m_defaultStyles, QStringList() << i18nc("@item:intable", "Numbers, Types & Constants"));
577 for (int i = (int)KSyntaxHighlighting::Theme::TextStyle::DataType; i <= (int)KSyntaxHighlighting::Theme::TextStyle::Constant; ++i) {
578 m_defaultStyles->addItem(parent, defaultStyleName(static_cast<KSyntaxHighlighting::Theme::TextStyle>(i)), l->at(i));
582 parent = new QTreeWidgetItem(m_defaultStyles, QStringList() << i18nc("@item:intable", "Strings & Characters"));
584 for (int i = (int)KSyntaxHighlighting::Theme::TextStyle::Char; i <= (int)KSyntaxHighlighting::Theme::TextStyle::Import; ++i) {
585 m_defaultStyles->addItem(parent, defaultStyleName(static_cast<KSyntaxHighlighting::Theme::TextStyle>(i)), l->at(i));
589 parent = new QTreeWidgetItem(m_defaultStyles, QStringList() << i18nc("@item:intable", "Comments & Documentation"));
591 for (int i = (int)KSyntaxHighlighting::Theme::TextStyle::Comment; i <= (int)KSyntaxHighlighting::Theme::TextStyle::Alert; ++i) {
592 m_defaultStyles->addItem(parent, defaultStyleName(static_cast<KSyntaxHighlighting::Theme::TextStyle>(i)), l->at(i));
596 parent = new QTreeWidgetItem(m_defaultStyles, QStringList() << i18nc("@item:intable", "Miscellaneous"));
598 for (int i = (int)KSyntaxHighlighting::Theme::TextStyle::Others; i <= (int)KSyntaxHighlighting::Theme::TextStyle::Error; ++i) {
599 m_defaultStyles->addItem(parent, defaultStyleName(static_cast<KSyntaxHighlighting::Theme::TextStyle>(i)), l->at(i));
625 static const auto idx = KSyntaxHighlighting::Theme::staticMetaObject.indexOfEnumerator("TextStyle");
692KateThemeConfigHighlightTab::KateThemeConfigHighlightTab(KateThemeConfigDefaultStylesTab *page, KateThemeConfigColorTab *colorTab)
735 qobject_cast<KTextEditor::ViewPrivate *>(KTextEditor::EditorPrivate::self()->application()->activeMainWindow()->activeView());
765static KateAttributeList defaultsForHighlighting(const std::vector<KSyntaxHighlighting::Format> &formats, const KateAttributeList &defaultStyleAttributes)
771 // use the default style attribute we got passed to have the one we currently have configured in the settings here
772 KTextEditor::Attribute::Ptr newAttribute(new KTextEditor::Attribute(*defaultStyleAttributes.at(format.textStyle())));
774 // check for override => if yes, set attribute as overridden, use invalid theme to avoid the usage of theme override!
932 // look at all highlightings we have info stored, important: keep info we did load from file and not overwrite here!
939 // we need to store even if we have nothing set as long as the value differs from the default, see bug 459093
1048 connect(defaultSchemaCombo, &QComboBox::currentIndexChanged, this, &KateThemeConfigPage::slotChanged);
1096 m_themePreview->rendererConfig()->setValue(KateRendererConfig::AutoColorThemeSelection, false);
1117 connect(schemaCombo, &QComboBox::currentIndexChanged, this, &KateThemeConfigPage::comboBoxIndexChanged);
1138 m_readOnlyThemeLabel = new KMessageWidget(i18n("Bundled read-only theme. To modify the theme, please copy it."), this);
1150 connect(m_colorTab, &KateThemeConfigColorTab::changed, this, &KateThemeConfigPage::slotChanged);
1154 connect(m_defaultStylesTab, &KateThemeConfigDefaultStylesTab::changed, this, &KateThemeConfigPage::slotChanged);
1158 connect(m_highlightTab, &KateThemeConfigHighlightTab::changed, this, &KateThemeConfigPage::slotChanged);
1177 const QString currentThemeName = schemaCombo->itemData(schemaCombo->currentIndex()).toString();
1192 QFileDialog::getOpenFileName(this, i18n("Importing Color Theme"), QString(), QStringLiteral("%1 (*.theme)").arg(i18n("Color theme")));
1198 const QString themesPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/org.kde.syntax-highlighting/themes");
1201 const QString themesFullFileName = themesPath + QStringLiteral("/") + QFileInfo(srcName).fileName();
1206 i18n("Importing will overwrite the existing theme file \"%1\". This can not be undone.", themesFullFileName),
1232 refillCombos(schemaCombo->itemData(schemaCombo->currentIndex()).toString(), defaultSchemaCombo->itemData(defaultSchemaCombo->currentIndex()).toString());
1252 const auto defaultTheme = defaultSchemaCombo->itemData(defaultSchemaCombo->currentIndex()).toString();
1263 refillCombos(schemaCombo->itemData(schemaCombo->currentIndex()).toString(), defaultSchemaCombo->itemData(defaultSchemaCombo->currentIndex()).toString());
1288void KateThemeConfigPage::refillCombos(const QString &schemaName, const QString &defaultSchemaName)
1308 KTextEditor::EditorPrivate::self()->hlManager()->repository().defaultTheme(KSyntaxHighlighting::Repository::LightTheme).name());
1313 if (!KateRendererConfig::global()->value(KateRendererConfig::AutoColorThemeSelection).toBool()) {
1362 i18n("Do you really want to delete the theme \"%1\"? This can not be undone.", schemaNameToDelete),
1378 QVariant(KTextEditor::EditorPrivate::self()->hlManager()->repository().defaultTheme(KSyntaxHighlighting::Repository::LightTheme).name())));
1394 const QString currentThemeName = schemaCombo->itemData(schemaCombo->currentIndex()).toString();
1398 const QString themesPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/org.kde.syntax-highlighting/themes");
1417 if (KateHlManager::self()->repository().theme(schemaName).isValid() || QFile::exists(themeFileName)) {
1419 i18n("<p>The theme \"%1\" already exists.</p><p>Please choose a different theme name.</p>", schemaName),
1452 // we can't delete read-only themes, e.g. the stuff shipped inside Qt resources or system wide installed
void setCloseButtonVisible(bool visible)
void setMessageType(KMessageWidget::MessageType type)
Information
Q_INVOKABLE KSyntaxHighlighting::Theme theme(const QString &themeName) const
bool isValid() const
bool isStrikeThrough(TextStyle style) const
QString translatedName() const
QRgb textColor(TextStyle style) const
QString name() const
QString filePath() const
bool isBold(TextStyle style) const
bool isReadOnly() const
QRgb selectedTextColor(TextStyle style) const
QRgb selectedBackgroundColor(TextStyle style) const
bool isUnderline(TextStyle style) const
EditorColorRole
IndentationLine
CodeFolding
SpellChecking
MarkBookmark
SavedLines
TemplateFocusedPlaceholder
TemplateReadOnlyPlaceholder
CurrentLineNumber
TemplateBackground
IconBorder
SearchHighlight
BackgroundColor
TextSelection
ReplaceHighlight
BracketMatching
ModifiedLines
LineNumbers
TemplatePlaceholder
CurrentLine
WordWrapMarker
bool isItalic(TextStyle style) const
QRgb backgroundColor(TextStyle style) const
QRgb editorColor(EditorColorRole role) const
Backend of KTextEditor::Document related public KTextEditor interfaces.
Definition katedocument.h:68
bool setHighlightingMode(const QString &name) override
Set the current mode of the document by giving its name.
Definition katedocument.cpp:1836
QTreeWidget that automatically adds columns for KateStyleListItems and provides a popup menu and a sl...
Definition katestyletreewidget.h:23
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
ButtonCode warningContinueCancel(QWidget *parent, const QString &text, const QString &title=QString(), const KGuiItem &buttonContinue=KStandardGuiItem::cont(), const KGuiItem &buttonCancel=KStandardGuiItem::cancel(), const QString &dontAskAgainName=QString(), Options options=Notify)
Continue
void information(QWidget *parent, const QString &text, const QString &title=QString(), const QString &dontShowAgainName=QString(), Options options=Notify)
bool isValid(QStringView ifopt)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
QString name(StandardAction id)
KGuiItem cancel()
KGuiItem defaults()
const QList< QKeySequence > & reload()
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
Definition katetextblock.h:18
void clicked(bool checked)
void addStretch(int stretch)
void addWidget(QWidget *widget, int stretch, Qt::Alignment alignment)
HexArgb
int alpha() const const
QColor fromRgba(QRgb rgba)
QString name(NameFormat format) const const
void activated(int index)
void addItem(const QIcon &icon, const QString &text, const QVariant &userData)
void clear()
count
void setCurrentIndex(int index)
void currentIndexChanged(int index)
void setEditable(bool editable)
int findData(const QVariant &data, int role, Qt::MatchFlags flags) const const
void insertSeparator(int index)
QVariant itemData(int index, int role) const const
void removeItem(int index)
Rejected
bool mkpath(const QString &dirPath) const const
bool copy(const QString &fileName, const QString &newName)
bool exists() const const
bool remove()
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, Options options)
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, Options options)
QString fileName() const const
void addWidget(QWidget *widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment alignment)
void setColumnStretch(int column, int stretch)
iterator insert(const Key &key, const T &value)
T value(const Key &key) const const
QIcon fromTheme(const QString &name)
TextInput
ReadOnly
QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error)
QJsonObject object() const const
bool isEmpty() const const
void remove(QLatin1StringView key)
NoError
void setBuddy(QWidget *buddy)
void addWidget(QWidget *w)
void setContentsMargins(const QMargins &margins)
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
void reserve(qsizetype size)
QMetaEnum fromType()
int keyCount() const const
bool blockSignals(bool block)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
T qobject_cast(QObject *object)
void setParent(QObject *parent)
Base
GenericDataLocation
QString writableLocation(StandardLocation type)
void clear()
QString first(qsizetype n) const const
QString fromUtf8(QByteArrayView str)
qsizetype indexOf(QChar ch, qsizetype from, Qt::CaseSensitivity cs) const const
bool isEmpty() const const
QString left(qsizetype n) const const
QString mid(qsizetype position, qsizetype n) const const
QString number(double n, char format, int precision)
int addTab(QWidget *page, const QIcon &icon, const QString &label)
void setDocumentMode(bool set)
ForegroundBrush
void expandAll()
void clear()
void expandItem(const QTreeWidgetItem *item)
QString toString() const const
void setEnabled(bool)
virtual bool event(QEvent *event) override
void hide()
QLayout * layout() const const
palette
virtual void showEvent(QShowEvent *event)
QStyle * style() const const
virtual void setVisible(bool visible)
void setWhatsThis(const QString &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.