D8991: Use kSqueezedTextLabel for the label text on the statusbar

Elvis Angelaccio noreply at phabricator.kde.org
Sat Nov 25 10:31:51 GMT 2017


elvisangelaccio added inline comments.

INLINE COMMENTS

> dolphinstatusbar.cpp:130-132
> +    topLayout->addWidget(m_label, 1);
> +    topLayout->addWidget(m_zoomSlider, 1);
> +    topLayout->addWidget(m_spaceInfo, 1);

This looks unrelated? Can you explain how to reproduce the "jumpy" issue you mentioned?

> dolphinstatusbar.cpp:315
>      const QString text = m_text.isEmpty() ? m_defaultText : m_text;
> -
> -    // Set status bar text and elide it if too long
> -    QFontMetrics fontMetrics(m_label->font());
> -    const QString elidedText = fontMetrics.elidedText(text, Qt::ElideMiddle, m_label->width());
> -    m_label->setText(elidedText);
> -
> -    // If the text has been elided, set the original text as tooltip
> -    if (text != elidedText) {
> -        m_label->setToolTip(Qt::convertFromPlainText(text));
> -    } else {
> -        m_label->setToolTip(QString());
> -    }
> +    static_cast<KSqueezedTextLabel*>(m_label)->setText(text);
>  }

This cast wouldn't be needed if `m_label` were declared as `KSqueezedTextLabel*`.

REPOSITORY
  R318 Dolphin

REVISION DETAIL
  https://phabricator.kde.org/D8991

To: ahmadsamir
Cc: elvisangelaccio, #dolphin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20171125/e462cae2/attachment.htm>


More information about the kfm-devel mailing list