Commit 0eccf4c3 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Adjust the sizes a little bit

parent d1600ed1
......@@ -132,12 +132,42 @@ public:
options.text = QString();
QStyledItemDelegate::paint(painter, options, index);
constexpr int lineHeight = 3;
constexpr int lineHeight = 2;
QFontMetrics fm = opt.fontMetrics;
QRect prect = opt.rect;
const int ascent = (opt.fontMetrics.ascent() / 2);
// draw line
prect.setX(prect.x() + ascent + 2);
auto sp = painter->pen();
auto p = painter->pen();
p.setWidth(2);
painter->setPen(p);
auto p1 = prect.bottomLeft();
int w = opt.fontMetrics.ascent();
int h = opt.rect.height();
int r = w / 3;
p1.ry() -= (h / 2) - r;
painter->setRenderHint(QPainter::Antialiasing, true);
QPoint pp = p1;
pp.ry() -= 3 + 1;
painter->drawLine(prect.topLeft(), pp);
painter->drawEllipse(p1, r, r);
auto p2 = p1;
p2.ry() += r + 1;
painter->drawLine(p2, prect.bottomLeft());
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setPen(sp);
// padding
prect.setX(prect.x() + lineHeight);
prect.setX(prect.x() + ascent + 2);
prect.setY(prect.y() + lineHeight);
// draw author on left
......@@ -167,14 +197,14 @@ public:
// draw separator
painter->setPen(opt.palette.button().color());
painter->drawLine(prect.bottomLeft(), prect.bottomRight());
painter->drawLine(opt.rect.bottomLeft(), opt.rect.bottomRight());
painter->setPen(fg);
}
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &) const override
QSize sizeHint(const QStyleOptionViewItem &opt, const QModelIndex &) const override
{
auto height = option.fontMetrics.height();
return QSize(0, height * 4);
auto height = opt.fontMetrics.height();
return QSize(0, height * 3 + (3 * 2));
}
};
......
......@@ -68,13 +68,9 @@ void KatePluginManager::setupPluginList()
// handle all install KTextEditor plugins
m_pluginList.clear();
QSet<QString> unique;
// const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("ktexteditor"), [](const KPluginMetaData &md) {
// return md.serviceTypes().contains(QLatin1String("KTextEditor/Plugin"));
// });
const QVector<KPluginMetaData> plugins =
KPluginLoader::findPlugins(QStringLiteral("/home/waqar/kde/src/kde/applications/kate/Release/bin"), [](const KPluginMetaData &md) {
return md.serviceTypes().contains(QLatin1String("KTextEditor/Plugin"));
});
const QVector<KPluginMetaData> plugins = KPluginLoader::findPlugins(QStringLiteral("ktexteditor"), [](const KPluginMetaData &md) {
return md.serviceTypes().contains(QLatin1String("KTextEditor/Plugin"));
});
for (const auto &pluginMetaData : plugins) {
KatePluginInfo info;
info.metaData = pluginMetaData;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment