Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix position of clip name when editing

parent 5e20b719
......@@ -133,12 +133,11 @@ public:
QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
const int textMargin = style->pixelMetric(QStyle::PM_FocusFrameHMargin) + 1;
int type = index.data(AbstractProjectItem::ItemTypeRole).toInt();
double factor = (double)opt.decorationSize.height() / r1.height();
int decoWidth = 2 * textMargin;
int mid = 0;
if (factor > 0) {
decoWidth += opt.decorationSize.width() / factor;
if (opt.decorationSize.height() > 0) {
decoWidth += r1.height() * m_dar;
}
int mid = 0;
if (type == AbstractProjectItem::ClipItem || type == AbstractProjectItem::SubClipItem) {
mid = (int)((r1.height() / 2));
}
......@@ -148,7 +147,6 @@ public:
QFontMetricsF fm(ft);
QRect r2 = fm.boundingRect(r1, Qt::AlignLeft | Qt::AlignTop, index.data(AbstractProjectItem::DataName).toString()).toRect();
editor->setGeometry(r2);
QStyledItemDelegate::updateEditorGeometry(editor, option, index);
}
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
......
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