UI changes - Calendar widget, BitcoinAmountField styling, other minor fixes

This commit is contained in:
felixrojauro
2015-11-26 16:27:54 +01:00
parent 849a807d38
commit 18f49ef4e5
12 changed files with 781 additions and 317 deletions

View File

@@ -25,6 +25,7 @@
#include <QMenu>
#include <QLabel>
#include <QDateTimeEdit>
#include <QCalendarWidget>
TransactionView::TransactionView(QWidget *parent) :
QWidget(parent), model(0), transactionProxyModel(0),
@@ -44,11 +45,7 @@ TransactionView::TransactionView(QWidget *parent) :
#endif
dateWidget = new QComboBox(this);
#ifdef Q_OS_MAC
dateWidget->setFixedWidth(121);
#else
dateWidget->setFixedWidth(120);
#endif
dateWidget->addItem(tr("All"), All);
dateWidget->addItem(tr("Today"), Today);
dateWidget->addItem(tr("This week"), ThisWeek);
@@ -59,11 +56,6 @@ TransactionView::TransactionView(QWidget *parent) :
hlayout->addWidget(dateWidget);
typeWidget = new QComboBox(this);
#ifdef Q_OS_MAC
typeWidget->setFixedWidth(121);
#else
typeWidget->setFixedWidth(120);
#endif
typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
@@ -87,11 +79,6 @@ TransactionView::TransactionView(QWidget *parent) :
#if QT_VERSION >= 0x040700
/* Do not move this to the XML file, Qt before 4.7 will choke on it */
amountWidget->setPlaceholderText(tr("Min amount"));
#endif
#ifdef Q_OS_MAC
amountWidget->setFixedWidth(97);
#else
amountWidget->setFixedWidth(100);
#endif
amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));
hlayout->addWidget(amountWidget);
@@ -381,9 +368,13 @@ void TransactionView::showDetails()
QWidget *TransactionView::createDateRangeWidget()
{
QString strCalendarsStyleSheet = "QToolButton {height: 60px; width: 120px;}\
QAbstractItemView {selection-background-color: #F5E5E5;selection-color: #000000;}\
QListView {background-color:white;}\
";
dateRangeWidget = new QFrame();
dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
dateRangeWidget->setContentsMargins(1,1,1,1);
dateRangeWidget->setStyleSheet("");
QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
layout->setContentsMargins(0,0,0,0);
layout->addSpacing(23);
@@ -392,7 +383,10 @@ QWidget *TransactionView::createDateRangeWidget()
dateFrom = new QDateTimeEdit(this);
dateFrom->setDisplayFormat("dd/MM/yy");
dateFrom->setCalendarPopup(true);
dateFrom->setMinimumWidth(100);
dateFrom->calendarWidget()->setStyleSheet( strCalendarsStyleSheet );
dateFrom->setMinimumWidth(100);
dateFrom->setDate(QDate::currentDate().addDays(-7));
layout->addWidget(dateFrom);
layout->addWidget(new QLabel(tr("to")));
@@ -400,6 +394,9 @@ QWidget *TransactionView::createDateRangeWidget()
dateTo = new QDateTimeEdit(this);
dateTo->setDisplayFormat("dd/MM/yy");
dateTo->setCalendarPopup(true);
dateTo->calendarWidget()->setStyleSheet( strCalendarsStyleSheet );
dateTo->setMinimumWidth(100);
dateTo->setDate(QDate::currentDate());
layout->addWidget(dateTo);