diff --git a/src/qt/forms/mainwindow.ui b/src/qt/forms/mainwindow.ui index 56b10c0..95ebcee 100644 --- a/src/qt/forms/mainwindow.ui +++ b/src/qt/forms/mainwindow.ui @@ -1366,13 +1366,13 @@ QPushButton:hover { 0 - 37 + 52 16777215 - 37 + 52 @@ -1413,26 +1413,146 @@ QLabel { - - - - 8 - 75 - true - - - - PointingHandCursor - - - Click to copy .onion address - - - - - - Qt::NoTextInteraction - + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 4 + + + + + + 8 + 75 + true + + + + I2P router status + + + [I2P] + + + + + + + + 8 + 75 + true + + + + PointingHandCursor + + + Click to copy .b32.i2p address + + + + + + Qt::NoTextInteraction + + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 4 + + + + + + 8 + 75 + true + + + + Tor V3 hidden service status + + + [Tor] + + + + + + + + 8 + 75 + true + + + + PointingHandCursor + + + Click to copy .onion address + + + + + + Qt::NoTextInteraction + + + + + + + diff --git a/src/qt/trianglesgui.cpp b/src/qt/trianglesgui.cpp index c966987..94699f4 100644 --- a/src/qt/trianglesgui.cpp +++ b/src/qt/trianglesgui.cpp @@ -353,24 +353,23 @@ TrianglesGUI::TrianglesGUI(bool fIsTestnet, QWidget *parent): labelV3Icon = ui->label_v3; labelV3Icon->setVisible(false); + // Tor icon next to onion address in the stacked address group (hidden until populated) + labelTorIcon = ui->label_tor_icon; + labelTorIcon->setVisible(false); + QTimer *timerOnion = new QTimer(this); connect(timerOnion, SIGNAL(timeout()), this, SLOT(updateOnionAddress())); timerOnion->start(5000); updateOnionAddress(); - // I2P address in status bar (hidden until populated) - labelI2PAddress = new QLabel(this); - labelI2PAddress->setObjectName("label_i2p"); - labelI2PAddress->setStyleSheet("color: #6a4cff; padding-left: 4px;"); + // I2P address in status bar (hidden until populated, click to copy) + labelI2PAddress = ui->label_i2p; labelI2PAddress->setVisible(false); labelI2PAddress->setCursor(Qt::PointingHandCursor); - statusBar()->addPermanentWidget(labelI2PAddress); + labelI2PAddress->installEventFilter(this); - labelI2PIcon = new QLabel(this); - labelI2PIcon->setObjectName("label_i2p_icon"); - labelI2PIcon->setText("[I2P]"); + labelI2PIcon = ui->label_i2p_icon; labelI2PIcon->setVisible(false); - statusBar()->addPermanentWidget(labelI2PIcon); QTimer *timerI2P = new QTimer(this); connect(timerI2P, SIGNAL(timeout()), this, SLOT(updateI2PAddress())); @@ -1347,6 +1346,16 @@ bool TrianglesGUI::eventFilter(QObject *object, QEvent *event) } return true; } + if (object == labelI2PAddress && event->type() == QEvent::MouseButtonPress) + { + QString addr = labelI2PAddress->text(); + if (!addr.isEmpty()) + { + QApplication::clipboard()->setText(addr); + QToolTip::showText(QCursor::pos(), tr("Copied!"), labelI2PAddress); + } + return true; + } return QMainWindow::eventFilter(object, event); } @@ -1806,6 +1815,15 @@ void TrianglesGUI::updateOnionAddress() labelV3Icon->setVisible(true); } + // Tor icon in the stacked address group — green when onion present, hidden otherwise + if (hasOnion) { + labelTorIcon->setStyleSheet("color: #7eb6ff; font-weight: bold;"); + labelTorIcon->setToolTip(tr("Tor V3 hidden service active")); + labelTorIcon->setVisible(true); + } else { + labelTorIcon->setVisible(false); + } + // Onion address text — respects user preference if (clientModel && clientModel->getOptionsModel() && !clientModel->getOptionsModel()->getShowOnionAddress()) { @@ -1819,7 +1837,7 @@ void TrianglesGUI::updateOnionAddress() } labelOnionAddress->setText(QString::fromStdString(onionAddress)); - labelOnionAddress->setToolTip(tr("This wallet's Tor .onion address. Selectable — right-click to copy.")); + labelOnionAddress->setToolTip(tr("This wallet's Tor .onion address. Click to copy.")); labelOnionAddress->setVisible(true); } @@ -1849,7 +1867,7 @@ void TrianglesGUI::updateI2PAddress() } labelI2PAddress->setText(QString::fromStdString(i2pAddress)); - labelI2PAddress->setToolTip(tr("This node's I2P .b32.i2p address. Selectable — right-click to copy.")); + labelI2PAddress->setToolTip(tr("This node's I2P .b32.i2p address. Click to copy.")); labelI2PAddress->setVisible(true); } diff --git a/src/qt/trianglesgui.h b/src/qt/trianglesgui.h index ff50d1f..186d36d 100644 --- a/src/qt/trianglesgui.h +++ b/src/qt/trianglesgui.h @@ -113,6 +113,7 @@ private: QLabel *labelV3Icon; QLabel *labelI2PAddress; QLabel *labelI2PIcon; + QLabel *labelTorIcon; QLabel *progressBarLabel; QProgressBar *progressBar;