diff --git a/ChannelListWidget.cpp b/ChannelListWidget.cpp index c468f63b5a339f931149762c2d42d22753076687..c50f26b299294364baacdb7cc1c3614040eca355 100644 --- a/ChannelListWidget.cpp +++ b/ChannelListWidget.cpp @@ -3,6 +3,7 @@ #include <Windows.h> #include <qboxlayout.h> #include <QFile> +#include <QApplication> ChannelTree::ChannelTree(ChannelListWidget * widget, QWidget *parent) : QTreeWidget(parent) @@ -102,6 +103,23 @@ ChannelListWidget::ChannelListWidget(QWidget *parent) { m_state = full; + QIcon myIcon = QApplication::style()->standardIcon(QStyle::SP_TitleBarMinButton); + auto avalSize = myIcon.availableSizes(); + for (auto& singleSize : avalSize) { + QImage tempImage = myIcon.pixmap(singleSize).toImage(); + tempImage.invertPixels(); + m_minIcon.addPixmap(QPixmap::fromImage(std::move(tempImage))); + } + + myIcon = QApplication::style()->standardIcon(QStyle::SP_TitleBarMaxButton); + avalSize = myIcon.availableSizes(); + for (auto& singleSize : avalSize) { + QImage tempImage = myIcon.pixmap(singleSize).toImage(); + tempImage.invertPixels(); + m_maxIcon.addPixmap(QPixmap::fromImage(std::move(tempImage))); + } + + setAttribute(Qt::WA_TranslucentBackground); setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::SplashScreen); move(320, 200); @@ -113,7 +131,7 @@ ChannelListWidget::ChannelListWidget(QWidget *parent) layout->setSpacing(0); m_button = new QPushButton(this); - m_button->setText("-"); + m_button->setIcon(m_minIcon); connect(m_button, &QPushButton::pressed, this, &ChannelListWidget::buttonPressed); QFile style("plugins\\qtTsOverlay\\button.styl"); style.open(QIODevice::ReadOnly); @@ -148,12 +166,12 @@ void ChannelListWidget::buttonPressed() if (m_state == full) { m_state = minimum; - m_button->setText("O"); + m_button->setIcon(m_maxIcon); } else { m_state = full; - m_button->setText("-"); + m_button->setIcon(m_minIcon); } emit treeStateChanged(m_state); diff --git a/ChannelListWidget.h b/ChannelListWidget.h index 74b8541d6ba92edf7ec444f5ebd18e1995c6a153..7a4bdb77790459389ee9a07283d18f208124edb9 100644 --- a/ChannelListWidget.h +++ b/ChannelListWidget.h @@ -5,6 +5,7 @@ #include <QSizeGrip> #include <QLabel> #include <QPushButton> +#include <QIcon> enum TreeState { full, @@ -67,6 +68,8 @@ private: QSizeGrip *m_grip; Background *m_background; QPushButton* m_button; + QIcon m_minIcon; + QIcon m_maxIcon; private slots: void buttonPressed(); diff --git a/Release/x64/qtTsOverlay_x64.dll b/Release/x64/qtTsOverlay_x64.dll index ce839c20acd6c5f7fb6523d3dc4920cec54bb7aa..39156a774f2085c68a942041a2abd6e7b9bd0b87 100644 Binary files a/Release/x64/qtTsOverlay_x64.dll and b/Release/x64/qtTsOverlay_x64.dll differ diff --git a/Release/x64/qtTsOverlay_x64.exp b/Release/x64/qtTsOverlay_x64.exp index 0c5c38b3f304e07c5782ccd898bea262c7dfa8d8..f6aa0159686b4619eb52bce65c263924b1ffa118 100644 Binary files a/Release/x64/qtTsOverlay_x64.exp and b/Release/x64/qtTsOverlay_x64.exp differ diff --git a/Release/x64/qtTsOverlay_x64.lib b/Release/x64/qtTsOverlay_x64.lib index 9bb0edc0a89839e4e8a001f2f1284fcbd4bf009c..e3ef7704bef271b26eab58ce3ad22ec2c2549307 100644 Binary files a/Release/x64/qtTsOverlay_x64.lib and b/Release/x64/qtTsOverlay_x64.lib differ