Fix Use ElidedLabel for Forum Name

This commit is contained in:
Phenom 2021-01-29 10:50:34 +01:00
parent e0ed60ee6f
commit 0dc6386d79
5 changed files with 28 additions and 10 deletions

View File

@ -256,6 +256,7 @@ void ElidedLabel::mousePressEvent(QMouseEvent *ev)
return; // eat event
}
QLabel::mousePressEvent(ev);
emit clicked(ev->pos());
}
void ElidedLabel::setTextColor(const QColor &color)

View File

@ -38,7 +38,7 @@ class ElidedLabel : public QLabel
Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
public:
ElidedLabel(const QString &text, QWidget *parent = 0);
explicit ElidedLabel(const QString &text, QWidget *parent = 0);
ElidedLabel(QWidget *parent = 0);
const QString & text() const { return mContent; }
@ -77,6 +77,7 @@ protected:
signals:
void elisionChanged(bool elided);
void clicked(QPoint pos);
private:
bool mElided;

View File

@ -274,7 +274,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion()));
connect(ui->threadTreeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(threadListCustomPopupMenu(QPoint)));
connect(ui->postText, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextMenuTextBrowser(QPoint)));
connect(ui->forumName, SIGNAL(clicked()), this, SLOT(showForumInfo()));
connect(ui->forumName, SIGNAL(clicked(QPoint)), this, SLOT(showForumInfo()));
ui->subscribeToolButton->hide() ;
connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));

View File

@ -112,15 +112,18 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="forumName">
<widget class="StyledElidedLabel" name="forumName">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click here to clear current selected thread and display more information about this forum.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>PushButton</string>
</property>
<property name="flat">
<bool>true</bool>
<string>Forum Name</string>
</property>
</widget>
</item>
@ -130,11 +133,11 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<width>1</width>
<height>0</height>
</size>
</property>
@ -527,6 +530,11 @@
<extends>QLineEdit</extends>
<header>gui/common/LineEditClear.h</header>
</customwidget>
<customwidget>
<class>StyledElidedLabel</class>
<extends>QLabel</extends>
<header>gui/common/StyledElidedLabel.h</header>
</customwidget>
<customwidget>
<class>SubscribeToolButton</class>
<extends>QToolButton</extends>
@ -545,8 +553,8 @@
</customwidget>
</customwidgets>
<resources>
<include location="../images.qrc"/>
<include location="../icons.qrc"/>
<include location="../images.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -149,6 +149,14 @@ ForumsDialog, GxsForumThreadWidget
qproperty-backgroundColorFiltered: rgb(255, 240, 210);
}
GxsForumThreadWidget StyledElidedLabel#forumName
{
padding: 2px;
font: bold;
font-size: 15px;
text-decoration: underline;
}
GroupTreeWidget
{
qproperty-textColorCategory: rgb(79, 79, 79);