TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicvideofloatwidget.cpp
Go to the documentation of this file.
3 #include "musicwidgetheaders.h"
4 
7 {
8  setStyleSheet(TTK::UI::BackgroundStyle08);
9 
10  resizeGeometry(0, 0);
11  m_search = new QPushButton(tr(" Search"), this);
12  m_popup = new QPushButton(tr(" Popup"), this);
13  m_fullscreen = new QPushButton(tr(" Fullscreen"), this);
14  m_download = new QPushButton(tr(" Download"), this);
15  m_share = new QPushButton(tr(" Share"), this);
16 
17 #ifdef Q_OS_UNIX
18  m_search->setFocusPolicy(Qt::NoFocus);
19  m_popup->setFocusPolicy(Qt::NoFocus);
20  m_fullscreen->setFocusPolicy(Qt::NoFocus);
21  m_download->setFocusPolicy(Qt::NoFocus);
22  m_share->setFocusPolicy(Qt::NoFocus);
23 #endif
24 
25  m_search->setGeometry(15, 10, 80, 20);
26  m_popup->setGeometry(15, 50, 80, 20);
27  m_fullscreen->setGeometry(15, 90, 80, 20);
28  m_download->setGeometry(15, 130, 80, 20);
29  m_share->setGeometry(15, 170, 80, 20);
30 
36 
37  m_search->setCursor(QCursor(Qt::PointingHandCursor));
38  m_popup->setCursor(QCursor(Qt::PointingHandCursor));
39  m_fullscreen->setCursor(QCursor(Qt::PointingHandCursor));
40  m_download->setCursor(QCursor(Qt::PointingHandCursor));
41  m_share->setCursor(QCursor(Qt::PointingHandCursor));
42 
43  connect(m_search, SIGNAL(clicked()), SIGNAL(searchButtonClicked()));
44  connect(m_popup, SIGNAL(clicked()), SIGNAL(popupButtonClicked()));
45  connect(m_fullscreen, SIGNAL(clicked()), SIGNAL(fullscreenButtonClicked()));
46  connect(m_download, SIGNAL(clicked()), SIGNAL(downloadButtonClicked()));
47  connect(m_share, SIGNAL(clicked()), SIGNAL(shareButtonClicked()));
48 }
49 
51 {
52  delete m_search;
53  delete m_popup;
54  delete m_fullscreen;
55  delete m_download;
56  delete m_share;
57 }
58 
59 void MusicVideoFloatWidget::resizeGeometry(int width, int height)
60 {
61  m_rectEnter = QRect(566 + width, 138 + height / 2, 125, 210);
62  m_rectLeave = QRect(676 + width, 189 + height / 2, 125, 105);
63  setGeometry(m_rectLeave);
64 }
65 
67 {
68  return m_popup->text() != tr(" Popup");
69 }
70 
72 {
73  m_popup->setText(popup ? tr(" Inline") : tr(" Popup"));
74 }
75 
77 {
78  return m_fullscreen->text() != tr(" Fullscreen");
79 }
80 
82 {
83  m_fullscreen->setText(full ? tr(" Normal") : tr(" Fullscreen"));
84 }
static constexpr const char * VideoFloatDownload
MusicVideoFloatWidget(QWidget *parent=nullptr)
static const QString BackgroundStyle08
static constexpr const char * VideoFloatFresh
static constexpr const char * VideoFloatShare
static constexpr const char * VideoFloatFullscreen
The class of the float widget base.
static const QString PushButtonStyle07
static constexpr const char * VideoFloatSearch
void resizeGeometry(int width, int height)