From 0dc6386d79b16669b028fbfbaa837ebe69a9608a Mon Sep 17 00:00:00 2001 From: Phenom Date: Fri, 29 Jan 2021 10:50:34 +0100 Subject: [PATCH] Fix Use ElidedLabel for Forum Name --- retroshare-gui/src/gui/common/ElidedLabel.cpp | 1 + retroshare-gui/src/gui/common/ElidedLabel.h | 3 ++- .../gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- .../src/gui/gxsforums/GxsForumThreadWidget.ui | 24 ++++++++++++------- .../src/gui/qss/stylesheet/qss.default | 8 +++++++ 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/retroshare-gui/src/gui/common/ElidedLabel.cpp b/retroshare-gui/src/gui/common/ElidedLabel.cpp index 796852ad3..f12bcc142 100644 --- a/retroshare-gui/src/gui/common/ElidedLabel.cpp +++ b/retroshare-gui/src/gui/common/ElidedLabel.cpp @@ -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) diff --git a/retroshare-gui/src/gui/common/ElidedLabel.h b/retroshare-gui/src/gui/common/ElidedLabel.h index af9ccfc40..9290a61d1 100644 --- a/retroshare-gui/src/gui/common/ElidedLabel.h +++ b/retroshare-gui/src/gui/common/ElidedLabel.h @@ -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; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 457766fc0..66e92fbb9 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -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))); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui index 7ec3e09d9..b5fe3f95d 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui @@ -112,15 +112,18 @@ - + + + + 0 + 0 + + <html><head/><body><p>Click here to clear current selected thread and display more information about this forum.</p></body></html> - PushButton - - - true + Forum Name @@ -130,11 +133,11 @@ Qt::Horizontal - QSizePolicy::MinimumExpanding + QSizePolicy::Fixed - 0 + 1 0 @@ -527,6 +530,11 @@ QLineEdit
gui/common/LineEditClear.h
+ + StyledElidedLabel + QLabel +
gui/common/StyledElidedLabel.h
+
SubscribeToolButton QToolButton @@ -545,8 +553,8 @@ - + diff --git a/retroshare-gui/src/gui/qss/stylesheet/qss.default b/retroshare-gui/src/gui/qss/stylesheet/qss.default index 9c46bc17e..629864e71 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/qss.default +++ b/retroshare-gui/src/gui/qss/stylesheet/qss.default @@ -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);