From bfeb13f5a3998f2781bb45984972ffc9ae75395a Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Tue, 24 Nov 2020 19:59:33 +0000 Subject: [PATCH] Add tooltips for dock title bar buttons --- sdrgui/gui/channelsdock.cpp | 2 ++ sdrgui/gui/featuresdock.cpp | 2 ++ sdrgui/gui/samplingdevicesdock.cpp | 2 ++ sdrgui/mainwindow.cpp | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/sdrgui/gui/channelsdock.cpp b/sdrgui/gui/channelsdock.cpp index f8e1d0ebd..2b1010e21 100644 --- a/sdrgui/gui/channelsdock.cpp +++ b/sdrgui/gui/channelsdock.cpp @@ -44,11 +44,13 @@ ChannelsDock::ChannelsDock(QWidget *parent, Qt::WindowFlags flags) : m_normalButton = new QPushButton(); QIcon normalIcon = style()->standardIcon(QStyle::SP_TitleBarNormalButton, 0, this); m_normalButton->setIcon(normalIcon); + m_normalButton->setToolTip("Dock/undock"); m_normalButton->setFixedSize(12, 12); m_closeButton = new QPushButton(); QIcon closeIcon = style()->standardIcon(QStyle::SP_TitleBarCloseButton, 0, this); m_closeButton->setIcon(closeIcon); + m_closeButton->setToolTip("Close"); m_closeButton->setFixedSize(12, 12); m_titleBarLayout->addWidget(m_addChannelButton); diff --git a/sdrgui/gui/featuresdock.cpp b/sdrgui/gui/featuresdock.cpp index 1f32f0634..844e7973f 100644 --- a/sdrgui/gui/featuresdock.cpp +++ b/sdrgui/gui/featuresdock.cpp @@ -50,11 +50,13 @@ FeaturesDock::FeaturesDock(QWidget *parent, Qt::WindowFlags flags) : m_normalButton = new QPushButton(); QIcon normalIcon = style()->standardIcon(QStyle::SP_TitleBarNormalButton, 0, this); m_normalButton->setIcon(normalIcon); + m_normalButton->setToolTip("Dock/undock"); m_normalButton->setFixedSize(12, 12); m_closeButton = new QPushButton(); QIcon closeIcon = style()->standardIcon(QStyle::SP_TitleBarCloseButton, 0, this); m_closeButton->setIcon(closeIcon); + m_closeButton->setToolTip("Close"); m_closeButton->setFixedSize(12, 12); m_titleBarLayout->addWidget(m_addFeatureButton); diff --git a/sdrgui/gui/samplingdevicesdock.cpp b/sdrgui/gui/samplingdevicesdock.cpp index 95f49b7eb..48e0cfa04 100644 --- a/sdrgui/gui/samplingdevicesdock.cpp +++ b/sdrgui/gui/samplingdevicesdock.cpp @@ -51,11 +51,13 @@ SamplingDevicesDock::SamplingDevicesDock(QWidget *parent, Qt::WindowFlags flags) m_normalButton = new QPushButton(); QIcon normalIcon = style()->standardIcon(QStyle::SP_TitleBarNormalButton, 0, this); m_normalButton->setIcon(normalIcon); + m_normalButton->setToolTip("Dock/undock"); m_normalButton->setFixedSize(12, 12); m_closeButton = new QPushButton(); QIcon closeIcon = style()->standardIcon(QStyle::SP_TitleBarCloseButton, 0, this); m_closeButton->setIcon(closeIcon); + m_closeButton->setToolTip("Close"); m_closeButton->setFixedSize(12, 12); m_titleBarLayout->addWidget(m_changeDeviceButton); diff --git a/sdrgui/mainwindow.cpp b/sdrgui/mainwindow.cpp index d49660f44..e7fdcf688 100644 --- a/sdrgui/mainwindow.cpp +++ b/sdrgui/mainwindow.cpp @@ -162,6 +162,11 @@ MainWindow::MainWindow(qtwebapp::LoggerWithFile *logger, const MainParser& parse ui->menu_Window->addAction(ui->channelDock->toggleViewAction()); ui->menu_Window->addAction(ui->featureDock->toggleViewAction()); + ui->spectraDisplayDock->setStyleSheet("QAbstractButton#qt_dockwidget_closebutton{qproperty-toolTip: \"Close\";}"); + ui->spectraDisplayDock->setStyleSheet("QAbstractButton#qt_dockwidget_floatbutton{qproperty-toolTip: \"Dock/undock\";}"); + ui->presetDock->setStyleSheet("QAbstractButton#qt_dockwidget_closebutton{qproperty-toolTip: \"Close\";}"); + ui->presetDock->setStyleSheet("QAbstractButton#qt_dockwidget_floatbutton{qproperty-toolTip: \"Dock/undock\";}"); + ui->tabInputsView->setStyleSheet("QWidget { background: rgb(50,50,50); } " "QToolButton::checked { background: rgb(128,70,0); } " "QComboBox::item:selected { color: rgb(255,140,0); } "