mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-14 19:12:11 +01:00
2cb067878d
- html highlighter is now highlighting with reg exps, no more with hard coded tags/tag options - all cppecheck warnings fixed + added script (cppcheck.sh) - introduced coding style + added astyle script (coding_style.sh) - fixed one mistake in czech translate + updated windows installer
34 lines
727 B
C++
34 lines
727 B
C++
#include "squeezelabelv2.h"
|
|
|
|
SqueezeLabelV2::SqueezeLabelV2(QWidget* parent)
|
|
: QLabel(parent)
|
|
{
|
|
}
|
|
|
|
SqueezeLabelV2::SqueezeLabelV2(const QString &string)
|
|
: QLabel()
|
|
{
|
|
setText(string);
|
|
}
|
|
|
|
void SqueezeLabelV2::setText(const QString &txt)
|
|
{
|
|
m_originalText = txt;
|
|
QFontMetrics fm = fontMetrics();
|
|
QString elided = fm.elidedText(m_originalText, Qt::ElideMiddle, width());
|
|
QLabel::setText(elided);
|
|
}
|
|
|
|
QString SqueezeLabelV2::originalText()
|
|
{
|
|
return m_originalText;
|
|
}
|
|
|
|
void SqueezeLabelV2::resizeEvent(QResizeEvent* event)
|
|
{
|
|
QLabel::resizeEvent(event);
|
|
QFontMetrics fm = fontMetrics();
|
|
QString elided = fm.elidedText(m_originalText, Qt::ElideMiddle, width());
|
|
QLabel::setText(elided);
|
|
}
|