Changeset View
Changeset View
Standalone View
Standalone View
src/document/katedocument.cpp
Show First 20 Lines • Show All 2181 Lines • ▼ Show 20 Line(s) | 2171 | { | |||
---|---|---|---|---|---|
2182 | m_marks.clear(); | 2182 | m_marks.clear(); | ||
2183 | 2183 | | |||
2184 | emit marksChanged(this); | 2184 | emit marksChanged(this); | ||
2185 | repaintViews(true); | 2185 | repaintViews(true); | ||
2186 | } | 2186 | } | ||
2187 | 2187 | | |||
2188 | void KTextEditor::DocumentPrivate::setMarkPixmap(MarkInterface::MarkTypes type, const QPixmap &pixmap) | 2188 | void KTextEditor::DocumentPrivate::setMarkPixmap(MarkInterface::MarkTypes type, const QPixmap &pixmap) | ||
2189 | { | 2189 | { | ||
2190 | m_markPixmaps.insert(type, pixmap); | 2190 | m_markIcons.insert(type, QVariant::fromValue(pixmap)); | ||
2191 | } | 2191 | } | ||
2192 | 2192 | | |||
2193 | void KTextEditor::DocumentPrivate::setMarkDescription(MarkInterface::MarkTypes type, const QString &description) | 2193 | void KTextEditor::DocumentPrivate::setMarkDescription(MarkInterface::MarkTypes type, const QString &description) | ||
2194 | { | 2194 | { | ||
2195 | m_markDescriptions.insert(type, description); | 2195 | m_markDescriptions.insert(type, description); | ||
2196 | } | 2196 | } | ||
2197 | 2197 | | |||
2198 | QPixmap KTextEditor::DocumentPrivate::markPixmap(MarkInterface::MarkTypes type) const | 2198 | QPixmap KTextEditor::DocumentPrivate::markPixmap(MarkInterface::MarkTypes type) const | ||
2199 | { | 2199 | { | ||
2200 | return m_markPixmaps.value(type, QPixmap()); | 2200 | auto icon = m_markIcons.value(type, QVariant::fromValue(QPixmap())); | ||
2201 | return (static_cast<QMetaType::Type>(icon.type()) == QMetaType::QIcon) ? icon.value<QIcon>().pixmap(32) : icon.value<QPixmap>(); | ||||
2201 | } | 2202 | } | ||
2202 | 2203 | | |||
2203 | QColor KTextEditor::DocumentPrivate::markColor(MarkInterface::MarkTypes type) const | 2204 | QColor KTextEditor::DocumentPrivate::markColor(MarkInterface::MarkTypes type) const | ||
2204 | { | 2205 | { | ||
2205 | uint reserved = (0x1 << KTextEditor::MarkInterface::reservedMarkersCount()) - 1; | 2206 | uint reserved = (0x1 << KTextEditor::MarkInterface::reservedMarkersCount()) - 1; | ||
2206 | if ((uint)type >= (uint)markType01 && (uint)type <= reserved) { | 2207 | if ((uint)type >= (uint)markType01 && (uint)type <= reserved) { | ||
2207 | return KateRendererConfig::global()->lineMarkerColor(type); | 2208 | return KateRendererConfig::global()->lineMarkerColor(type); | ||
2208 | } else { | 2209 | } else { | ||
Show All 12 Lines | |||||
2221 | } | 2222 | } | ||
2222 | 2223 | | |||
2223 | uint KTextEditor::DocumentPrivate::editableMarks() const | 2224 | uint KTextEditor::DocumentPrivate::editableMarks() const | ||
2224 | { | 2225 | { | ||
2225 | return m_editableMarks; | 2226 | return m_editableMarks; | ||
2226 | } | 2227 | } | ||
2227 | // END | 2228 | // END | ||
2228 | 2229 | | |||
2230 | void KTextEditor::DocumentPrivate::setMarkIcon(MarkInterface::MarkTypes markType, const QIcon &icon) | ||||
2231 | { | ||||
2232 | m_markIcons.insert(markType, QVariant::fromValue(icon)); | ||||
2233 | } | ||||
2234 | | ||||
2235 | QIcon KTextEditor::DocumentPrivate::markIcon(MarkInterface::MarkTypes markType) const | ||||
2236 | { | ||||
2237 | auto icon = m_markIcons.value(markType, QVariant::fromValue(QIcon())); | ||||
2238 | return (static_cast<QMetaType::Type>(icon.type()) == QMetaType::QIcon) ? icon.value<QIcon>() : QIcon(icon.value<QPixmap>()); | ||||
2239 | } | ||||
2240 | | ||||
2229 | // BEGIN KTextEditor::PrintInterface stuff | 2241 | // BEGIN KTextEditor::PrintInterface stuff | ||
2230 | bool KTextEditor::DocumentPrivate::print() | 2242 | bool KTextEditor::DocumentPrivate::print() | ||
2231 | { | 2243 | { | ||
2232 | return KatePrinter::print(this); | 2244 | return KatePrinter::print(this); | ||
2233 | } | 2245 | } | ||
2234 | 2246 | | |||
2235 | void KTextEditor::DocumentPrivate::printPreview() | 2247 | void KTextEditor::DocumentPrivate::printPreview() | ||
2236 | { | 2248 | { | ||
▲ Show 20 Lines • Show All 3844 Lines • Show Last 20 Lines |