diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-08-04 19:04:42 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-08-04 19:04:42 +0200 |
commit | 2351a3fc9f32568a3e90b01f6d9ee9d0cc6b281e (patch) | |
tree | 962a301ba2b071c5ea327c26c2561d21fcd069ad | |
parent | 1b392019664239e68d7f529465abe2bdef230989 (diff) |
minimize amount of text in status bar; show only icons, if the user wants explanation they can view the tooltip
-rw-r--r-- | src/qt/bitcoingui.cpp | 41 | ||||
-rw-r--r-- | src/qt/bitcoingui.h | 2 |
2 files changed, 14 insertions, 29 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 6e7606549a..c9feca5d9f 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -108,34 +108,21 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): // Create status bar statusBar(); - // Status bar "Connections" notification - QFrame *frameConnections = new QFrame(); - frameConnections->setFrameStyle(QFrame::Panel | QFrame::Sunken); - frameConnections->setMinimumWidth(150); - frameConnections->setMaximumWidth(150); - QHBoxLayout *frameConnectionsLayout = new QHBoxLayout(frameConnections); - frameConnectionsLayout->setContentsMargins(3,0,3,0); - frameConnectionsLayout->setSpacing(3); - labelConnectionsIcon = new QLabel(); - labelConnectionsIcon->setToolTip(tr("Number of connections to other clients")); - frameConnectionsLayout->addWidget(labelConnectionsIcon); - labelConnections = new QLabel(); - labelConnections->setToolTip(tr("Number of connections to other clients")); - frameConnectionsLayout->addWidget(labelConnections); - frameConnectionsLayout->addStretch(); - // Status bar "Blocks" notification QFrame *frameBlocks = new QFrame(); - frameBlocks->setFrameStyle(QFrame::Panel | QFrame::Sunken); - frameBlocks->setMinimumWidth(150); - frameBlocks->setMaximumWidth(150); + //frameBlocks->setFrameStyle(QFrame::Panel | QFrame::Sunken); + frameBlocks->setContentsMargins(0,0,0,0); + frameBlocks->setMinimumWidth(56); + frameBlocks->setMaximumWidth(56); QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); frameBlocksLayout->setContentsMargins(3,0,3,0); frameBlocksLayout->setSpacing(3); + labelConnectionsIcon = new QLabel(); labelBlocksIcon = new QLabel(); + frameBlocksLayout->addStretch(); + frameBlocksLayout->addWidget(labelConnectionsIcon); + frameBlocksLayout->addStretch(); frameBlocksLayout->addWidget(labelBlocksIcon); - labelBlocks = new QLabel(); - frameBlocksLayout->addWidget(labelBlocks); frameBlocksLayout->addStretch(); // Progress bar for blocks download @@ -147,7 +134,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); - statusBar()->addPermanentWidget(frameConnections); statusBar()->addPermanentWidget(frameBlocks); createTrayIcon(); @@ -312,7 +298,7 @@ void BitcoinGUI::setNumConnections(int count) default: icon = ":/icons/connect_4"; break; } labelConnectionsIcon->setPixmap(QIcon(icon).pixmap(16,16)); - labelConnections->setText(tr("%n connection(s)", "", count)); + labelConnectionsIcon->setToolTip(tr("%n active connections to Bitcoin network", "", count)); } void BitcoinGUI::setNumBlocks(int count) @@ -359,13 +345,16 @@ void BitcoinGUI::setNumBlocks(int count) } // In the label we want to be less specific - QString labelText = text; bool spinning = true; if(secs < 30*60) { - labelText = "Up to date"; + tooltip = tr("Up to date") + QString("\n") + tooltip; spinning = false; } + else + { + tooltip = tr("Catching up...") + QString("\n") + tooltip; + } tooltip += QString("\n"); tooltip += tr("Last received block was generated %1.").arg(text); @@ -379,10 +368,8 @@ void BitcoinGUI::setNumBlocks(int count) { labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(16,16)); } - labelBlocks->setText(labelText); labelBlocksIcon->setToolTip(tooltip); - labelBlocks->setToolTip(tooltip); progressBarLabel->setToolTip(tooltip); progressBar->setToolTip(tooltip); } diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 4fc17dd36f..c48fa8cfd8 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -54,9 +54,7 @@ private: AddressBookPage *receiveCoinsPage; SendCoinsDialog *sendCoinsPage; - QLabel *labelConnections; QLabel *labelConnectionsIcon; - QLabel *labelBlocks; QLabel *labelBlocksIcon; QLabel *progressBarLabel; QProgressBar *progressBar; |