Prevent KeeShare banner from squashing group panel

* Fixes #9569
This commit is contained in:
Jonathan White 2023-07-17 21:14:34 -04:00
parent d025f02720
commit 286b5cf9a4
2 changed files with 6 additions and 4 deletions

View File

@ -53,6 +53,7 @@
#include "gui/group/GroupView.h" #include "gui/group/GroupView.h"
#include "gui/reports/ReportsDialog.h" #include "gui/reports/ReportsDialog.h"
#include "gui/tag/TagView.h" #include "gui/tag/TagView.h"
#include "gui/widgets/ElidedLabel.h"
#include "keeshare/KeeShare.h" #include "keeshare/KeeShare.h"
#ifdef WITH_XC_NETWORKING #ifdef WITH_XC_NETWORKING
@ -73,7 +74,7 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
, m_previewView(new EntryPreviewWidget(this)) , m_previewView(new EntryPreviewWidget(this))
, m_previewSplitter(new QSplitter(m_mainWidget)) , m_previewSplitter(new QSplitter(m_mainWidget))
, m_searchingLabel(new QLabel(this)) , m_searchingLabel(new QLabel(this))
, m_shareLabel(new QLabel(this)) , m_shareLabel(new ElidedLabel(this))
, m_csvImportWizard(new CsvImportWizard(this)) , m_csvImportWizard(new CsvImportWizard(this))
, m_editEntryWidget(new EditEntryWidget(this)) , m_editEntryWidget(new EditEntryWidget(this))
, m_editGroupWidget(new EditGroupWidget(this)) , m_editGroupWidget(new EditGroupWidget(this))
@ -159,7 +160,7 @@ DatabaseWidget::DatabaseWidget(QSharedPointer<Database> db, QWidget* parent)
#ifdef WITH_XC_KEESHARE #ifdef WITH_XC_KEESHARE
m_shareLabel->setObjectName("KeeShareBanner"); m_shareLabel->setObjectName("KeeShareBanner");
m_shareLabel->setText(tr("Shared group…")); m_shareLabel->setRawText(tr("Shared group…"));
m_shareLabel->setAlignment(Qt::AlignCenter); m_shareLabel->setAlignment(Qt::AlignCenter);
m_shareLabel->setVisible(false); m_shareLabel->setVisible(false);
#endif #endif
@ -1520,7 +1521,7 @@ void DatabaseWidget::onGroupChanged()
#ifdef WITH_XC_KEESHARE #ifdef WITH_XC_KEESHARE
auto shareLabel = KeeShare::sharingLabel(group); auto shareLabel = KeeShare::sharingLabel(group);
if (!shareLabel.isEmpty()) { if (!shareLabel.isEmpty()) {
m_shareLabel->setText(shareLabel); m_shareLabel->setRawText(shareLabel);
m_shareLabel->setVisible(true); m_shareLabel->setVisible(true);
} else { } else {
m_shareLabel->setVisible(false); m_shareLabel->setVisible(false);

View File

@ -50,6 +50,7 @@ class QLabel;
class MessageWidget; class MessageWidget;
class EntryPreviewWidget; class EntryPreviewWidget;
class TagView; class TagView;
class ElidedLabel;
namespace Ui namespace Ui
{ {
@ -280,7 +281,7 @@ private:
QPointer<EntryPreviewWidget> m_previewView; QPointer<EntryPreviewWidget> m_previewView;
QPointer<QSplitter> m_previewSplitter; QPointer<QSplitter> m_previewSplitter;
QPointer<QLabel> m_searchingLabel; QPointer<QLabel> m_searchingLabel;
QPointer<QLabel> m_shareLabel; QPointer<ElidedLabel> m_shareLabel;
QPointer<CsvImportWizard> m_csvImportWizard; QPointer<CsvImportWizard> m_csvImportWizard;
QPointer<EditEntryWidget> m_editEntryWidget; QPointer<EditEntryWidget> m_editEntryWidget;
QPointer<EditGroupWidget> m_editGroupWidget; QPointer<EditGroupWidget> m_editGroupWidget;