Added description label in the RegisterHistoryItem widget

This commit is contained in:
Nav
2021-09-21 21:21:00 +01:00
parent 59b7069a9c
commit e76bb07ef1
3 changed files with 22 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
#include "RegisterHistoryItem.hpp"
#include <QStyle>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QByteArray>
using namespace Bloom::Widgets;
@@ -24,15 +24,20 @@ RegisterHistoryItem::RegisterHistoryItem(
).toHex()).toUpper());
this->valueLabel->setObjectName("value-label");
auto labelLayout = new QVBoxLayout();
labelLayout->setSpacing(5);
labelLayout->setContentsMargins(0, 0, 0, 0);
labelLayout->addWidget(this->dateLabel, 0, Qt::AlignmentFlag::AlignTop);
labelLayout->addWidget(this->valueLabel, 0, Qt::AlignmentFlag::AlignTop);
labelLayout->addStretch(1);
this->descriptionLayout->setText("Register Written");
this->descriptionLayout->setObjectName("description-label");
this->layout->setSpacing(1);
this->layout->addLayout(labelLayout);
auto subLabelLayout = new QHBoxLayout();
subLabelLayout->setSpacing(0);
subLabelLayout->setContentsMargins(0, 0, 0, 0);
subLabelLayout->addWidget(this->valueLabel, 0, Qt::AlignmentFlag::AlignLeft);
subLabelLayout->addStretch(1);
subLabelLayout->addWidget(this->descriptionLayout, 0, Qt::AlignmentFlag::AlignRight);
this->layout->setSpacing(5);
this->layout->addWidget(this->dateLabel, 0, Qt::AlignmentFlag::AlignTop);
this->layout->addLayout(subLabelLayout);
this->layout->addStretch(1);
auto onClick = [this] {
this->setSelected(true);

View File

@@ -1,7 +1,7 @@
#pragma once
#include <QDateTime>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include "Item.hpp"
@@ -11,9 +11,10 @@ namespace Bloom::Widgets
class RegisterHistoryItem: public Item
{
Q_OBJECT
QHBoxLayout* layout = new QHBoxLayout(this);
QVBoxLayout* layout = new QVBoxLayout(this);
QLabel* dateLabel = new QLabel(this);
QLabel* valueLabel = new QLabel(this);
QLabel* descriptionLayout = new QLabel(this);
public:
RegisterHistoryItem(

View File

@@ -111,6 +111,11 @@ QPushButton:disabled {
color: #8a8a8d;
}
#target-register-history-widget #register-history-item #description-label {
font-size: 13px;
color: #8a8a8d;
}
#target-register-history-widget #separator-label {
/*font-style: italic;*/
color: #8a8a8d;