Mercurial > hg > bitcoin
changeset 1250:0574aa6d8add draft
minimize amount of text in status bar; show only icons, if the user wants explanation they can view the tooltip
author | Wladimir J. van der Laan <laanwj@gmail.com> |
---|---|
date | Thu, 04 Aug 2011 19:04:42 +0200 |
parents | 46abd0f14659 |
children | 3d004b475420 |
files | src/qt/bitcoingui.cpp src/qt/bitcoingui.h |
diffstat | 2 files changed, 14 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -108,34 +108,21 @@ // 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 @@ statusBar()->addWidget(progressBarLabel); statusBar()->addWidget(progressBar); - statusBar()->addPermanentWidget(frameConnections); statusBar()->addPermanentWidget(frameBlocks); createTrayIcon(); @@ -312,7 +298,7 @@ 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 @@ } // 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 @@ { labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(16,16)); } - labelBlocks->setText(labelText); labelBlocksIcon->setToolTip(tooltip); - labelBlocks->setToolTip(tooltip); progressBarLabel->setToolTip(tooltip); progressBar->setToolTip(tooltip); }