From ad92b11f127043845de792a5503ba13f35984d62 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Sun, 25 Feb 2018 02:00:31 +0100 Subject: [PATCH] Use edlided label for details widget title and adjust layout spacing --- src/gui/DatabaseWidget.cpp | 8 +- src/gui/DetailsWidget.cpp | 4 +- src/gui/DetailsWidget.ui | 342 ++++++++++++++++++++++--------------- 3 files changed, 211 insertions(+), 143 deletions(-) diff --git a/src/gui/DatabaseWidget.cpp b/src/gui/DatabaseWidget.cpp index 06b7b87b7..ff9d15fc0 100644 --- a/src/gui/DatabaseWidget.cpp +++ b/src/gui/DatabaseWidget.cpp @@ -76,7 +76,7 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent) m_messageWidget = new MessageWidget(this); m_messageWidget->setHidden(true); - QVBoxLayout* mainLayout = new QVBoxLayout(); + auto* mainLayout = new QVBoxLayout(); QLayout* layout = new QHBoxLayout(); mainLayout->addWidget(m_messageWidget); mainLayout->addLayout(layout); @@ -119,7 +119,7 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent) connect(m_detailsView, SIGNAL(errorOccurred(QString)), this, SLOT(showErrorMessage(QString))); - QVBoxLayout* vLayout = new QVBoxLayout(rightHandSideWidget); + auto* vLayout = new QVBoxLayout(rightHandSideWidget); vLayout->setMargin(0); vLayout->addWidget(m_searchingLabel); vLayout->addWidget(m_detailSplitter); @@ -127,8 +127,8 @@ DatabaseWidget::DatabaseWidget(Database* db, QWidget* parent) m_detailSplitter->addWidget(m_entryView); m_detailSplitter->addWidget(m_detailsView); - m_detailSplitter->setStretchFactor(0, 80); - m_detailSplitter->setStretchFactor(1, 20); + m_detailSplitter->setStretchFactor(0, 100); + m_detailSplitter->setStretchFactor(1, 0); m_searchingLabel->setVisible(false); diff --git a/src/gui/DetailsWidget.cpp b/src/gui/DetailsWidget.cpp index 1ac20c9d8..77de24666 100644 --- a/src/gui/DetailsWidget.cpp +++ b/src/gui/DetailsWidget.cpp @@ -134,7 +134,7 @@ void DetailsWidget::updateEntryHeaderLine() { Q_ASSERT(m_currentEntry); const QString title = m_currentEntry->resolveMultiplePlaceholders(m_currentEntry->title()); - m_ui->entryTitleLabel->setText(hierarchy(m_currentEntry->group(), title)); + m_ui->entryTitleLabel->setRawText(hierarchy(m_currentEntry->group(), title)); m_ui->entryIcon->setPixmap(preparePixmap(m_currentEntry->iconPixmap(), 16)); } @@ -250,7 +250,7 @@ void DetailsWidget::updateEntryAutotypeTab() void DetailsWidget::updateGroupHeaderLine() { Q_ASSERT(m_currentGroup); - m_ui->groupTitleLabel->setText(hierarchy(m_currentGroup, {})); + m_ui->groupTitleLabel->setRawText(hierarchy(m_currentGroup, {})); m_ui->groupIcon->setPixmap(preparePixmap(m_currentGroup->iconPixmap(), 32)); } diff --git a/src/gui/DetailsWidget.ui b/src/gui/DetailsWidget.ui index 5446f6510..53787d713 100644 --- a/src/gui/DetailsWidget.ui +++ b/src/gui/DetailsWidget.ui @@ -25,11 +25,26 @@ + + 0 + + + 0 + + + 0 + + + 0 + - + QLayout::SetDefaultConstraint + + 9 + @@ -44,9 +59,9 @@ - + - + 0 0 @@ -61,19 +76,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -152,22 +154,75 @@ - - - - - Qt::Horizontal + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + - - QSizePolicy::Fixed - - + - 20 - 20 + 100 + 0 - + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + PointingHandCursor + + + + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + @@ -194,21 +249,8 @@ - - - - - 100 - 0 - - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - + + 0 @@ -222,20 +264,20 @@ - Password + Expiration Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - 100 - 0 - + + + + + 0 + 0 + @@ -261,24 +303,24 @@ - - - + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + - 100 - 0 + 20 + 20 - - PointingHandCursor - - - - - + - - + + 0 @@ -292,25 +334,22 @@ - Expiration + Password Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - + Qt::Vertical - 20 - 10 + 0 + 0 @@ -418,11 +457,26 @@ + + 0 + + + 0 + + + 0 + + + 0 + - + QLayout::SetDefaultConstraint + + 9 + @@ -437,9 +491,9 @@ - + - + 0 0 @@ -454,19 +508,6 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -503,22 +544,50 @@ - - - - - Qt::Horizontal + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + - - QSizePolicy::Fixed + + + + + + + 0 + 0 + - - - 20 - 20 - + + + 75 + true + - + + Expiration + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + @@ -543,7 +612,40 @@ - + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + @@ -567,45 +669,11 @@ - - - - - - - - 0 - 0 - - - - - 75 - true - - - - Expiration - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - + Qt::Vertical - - - 20 - 10 - -