aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactionview.cpp
diff options
context:
space:
mode:
authorp2k <patrick.p2k.schneider@gmail.com>2011-10-07 13:21:45 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-10-09 21:19:44 +0200
commit527137e3ee542da5ecd4d04364fac0eb0067a2a4 (patch)
treee3ef2f32ef2d23e8d54175703fa3e36cd3ca0c1a /src/qt/transactionview.cpp
parentd934e7e3ddd7d919e58f76705439cdb15c745951 (diff)
Improved Mac experience; QDoubleSpinBox for BitcoinAmountField
Now it can't be told if this is was a Windows App before. All Mac design principles are fulfilled and some cosmetics have been applied to suit the native look and feel. The biggest change there is the proper use of the Dock icon which takes the role of the Tray icon on Mac. The QDoubleSpinBox improves entering of Bitcoin amounts, no two separate fields are required anymore. All functionality and validation effects have been retained; pressing the comma key will be internally translated to a period to keep it consistent throughout the application and eases entering in countries which use the comma as decimal separator. Additionally, Notificator now supports Growl, Mac's native notification system. This is provided via Apple Script in order to avoid linking to Growl on compile time. Other changes involve encapsulation of Toolbar and Menubar creation, loading of Qt's own translation and some clean up.
Diffstat (limited to 'src/qt/transactionview.cpp')
-rw-r--r--src/qt/transactionview.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp
index b2777b7b20..92dda5784c 100644
--- a/src/qt/transactionview.cpp
+++ b/src/qt/transactionview.cpp
@@ -38,13 +38,20 @@ TransactionView::TransactionView(QWidget *parent) :
QHBoxLayout *hlayout = new QHBoxLayout();
hlayout->setContentsMargins(0,0,0,0);
+#ifdef Q_WS_MAC
+ hlayout->setSpacing(5);
+ hlayout->addSpacing(26);
+#else
hlayout->setSpacing(0);
-
hlayout->addSpacing(23);
+#endif
dateWidget = new QComboBox(this);
- dateWidget->setMaximumWidth(120);
- dateWidget->setMinimumWidth(120);
+#ifdef Q_WS_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);
@@ -55,8 +62,11 @@ TransactionView::TransactionView(QWidget *parent) :
hlayout->addWidget(dateWidget);
typeWidget = new QComboBox(this);
- typeWidget->setMaximumWidth(120);
- typeWidget->setMinimumWidth(120);
+#ifdef Q_WS_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) |
@@ -79,8 +89,11 @@ TransactionView::TransactionView(QWidget *parent) :
#if QT_VERSION >= 0x040700
amountWidget->setPlaceholderText(tr("Min amount"));
#endif
- amountWidget->setMaximumWidth(100);
- amountWidget->setMinimumWidth(100);
+#ifdef Q_WS_MAC
+ amountWidget->setFixedWidth(97);
+#else
+ amountWidget->setFixedWidth(100);
+#endif
amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));
hlayout->addWidget(amountWidget);
@@ -96,7 +109,11 @@ TransactionView::TransactionView(QWidget *parent) :
vlayout->setSpacing(0);
int width = view->verticalScrollBar()->sizeHint().width();
// Cover scroll bar width with spacing
+#ifdef Q_WS_MAC
+ hlayout->addSpacing(width+2);
+#else
hlayout->addSpacing(width);
+#endif
// Always show scroll bar
view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
view->setTabKeyNavigation(false);