mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-03-11 08:54:48 +00:00
Use QToolButton instead
This commit is contained in:
parent
336170f91f
commit
1b75fd9969
3 changed files with 6 additions and 5 deletions
|
|
@ -688,15 +688,16 @@ MainWindow::MainWindow()
|
|||
m_progressBar->setMaximum(100);
|
||||
statusBar()->addPermanentWidget(m_progressBar);
|
||||
|
||||
m_clearClipboardButton = new QPushButton(statusBar());
|
||||
m_clearClipboardButton = new QToolButton(statusBar());
|
||||
m_clearClipboardButton->setIcon(icons()->icon("sweep"));
|
||||
m_clearClipboardButton->setToolTip(tr("Clear the clipboard immediately"));
|
||||
m_clearClipboardButton->setObjectName("clearClipboardButton");
|
||||
m_clearClipboardButton->setVisible(false);
|
||||
m_clearClipboardButton->setStyleSheet("QToolButton { border: none; background-color: transparent; }");
|
||||
statusBar()->addPermanentWidget(m_clearClipboardButton);
|
||||
|
||||
connect(clipboard(), &Clipboard::updateCountdown, this, &MainWindow::updateProgressBar);
|
||||
connect(m_clearClipboardButton.data(), &QPushButton::clicked, this, &MainWindow::clearClipboard);
|
||||
connect(m_clearClipboardButton.data(), &QToolButton::clicked, this, &MainWindow::clearClipboard);
|
||||
m_actionMultiplexer.connect(SIGNAL(updateSyncProgress(int, QString)), this, SLOT(updateProgressBar(int, QString)));
|
||||
m_actionMultiplexer.connect(SIGNAL(databaseSyncInProgress()), this, SLOT(disableMenuAndToolbar()));
|
||||
m_actionMultiplexer.connect(SIGNAL(databaseSyncCompleted(QString)), this, SLOT(enableMenuAndToolbar()));
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@
|
|||
#include <QLabel>
|
||||
#include <QMainWindow>
|
||||
#include <QProgressBar>
|
||||
#include <QPushButton>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QTimer>
|
||||
#include <QToolButton>
|
||||
|
||||
#include "core/SignalMultiplexer.h"
|
||||
#include "gui/DatabaseWidget.h"
|
||||
|
|
@ -192,7 +192,7 @@ private:
|
|||
QPointer<QProgressBar> m_progressBar;
|
||||
QPointer<QLabel> m_progressBarLabel;
|
||||
QPointer<QLabel> m_statusBarLabel;
|
||||
QPointer<QPushButton> m_clearClipboardButton;
|
||||
QPointer<QToolButton> m_clearClipboardButton;
|
||||
|
||||
Q_DISABLE_COPY(MainWindow)
|
||||
|
||||
|
|
|
|||
|
|
@ -2508,7 +2508,7 @@ void TestGui::testClearClipboard()
|
|||
QTest::keyClick(entryView, Qt::Key_C, Qt::ControlModifier);
|
||||
QTRY_COMPARE(clipboard->text(), entryView->currentEntry()->password());
|
||||
|
||||
QPushButton* clearClipboardButton = m_mainWindow->findChild<QPushButton*>("clearClipboardButton");
|
||||
QToolButton* clearClipboardButton = m_mainWindow->findChild<QToolButton*>("clearClipboardButton");
|
||||
QTRY_VERIFY(clearClipboardButton->isVisible());
|
||||
clearClipboardButton->click();
|
||||
QCOMPARE(clipboard->text(), QString());
|
||||
|
|
|
|||
Loading…
Reference in a new issue