TTKMusicPlayer  4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musiclrcfloatwidget.cpp
Go to the documentation of this file.
1 #include "musiclrcfloatwidget.h"
5 #include "musicrightareawidget.h"
7 #include "musicwidgetheaders.h"
8 
10  : MusicAbstractFloatWidget(parent)
11 {
12  setStyleSheet(TTK::UI::BackgroundStyle05);
13 
15  m_floatPhotoWidget->hide();
16 
18  m_floatSettingWidget->hide();
19 
20  resizeGeometry(0, 0);
21 
22  m_updateButton = new QPushButton(tr(" Update"), this);
23  m_searchButton = new QPushButton(tr(" Search"), this);
24  m_moreButton = new QPushButton(tr(" More"), this);
25  m_wallpaperButton = new QPushButton(tr(" Wallp"), this);
26  m_photoButton = new QPushButton(tr(" Photo"), this);
27 
28 #ifdef Q_OS_UNIX
29  m_updateButton->setFocusPolicy(Qt::NoFocus);
30  m_searchButton->setFocusPolicy(Qt::NoFocus);
31  m_moreButton->setFocusPolicy(Qt::NoFocus);
32  m_wallpaperButton->setFocusPolicy(Qt::NoFocus);
33  m_photoButton->setFocusPolicy(Qt::NoFocus);
34 #endif
35 
36  m_updateButton->setGeometry(15, 10, 80, 20);
37  m_searchButton->setGeometry(15, 50, 80, 20);
38  m_moreButton->setGeometry(15, 90, 80, 20);
39  m_wallpaperButton->setGeometry(15, 130, 80, 20);
40  m_photoButton->setGeometry(15, 170, 80, 20);
41 
47 
48  m_updateButton->setCursor(QCursor(Qt::PointingHandCursor));
49  m_searchButton->setCursor(QCursor(Qt::PointingHandCursor));
50  m_moreButton->setCursor(QCursor(Qt::PointingHandCursor));
51  m_wallpaperButton->setCursor(QCursor(Qt::PointingHandCursor));
52  m_photoButton->setCursor(QCursor(Qt::PointingHandCursor));
53 #ifdef Q_OS_UNIX
54  m_wallpaperButton->setEnabled(false);
55 #endif
56  connect(m_updateButton, SIGNAL(clicked()), parent, SIGNAL(currentLrcUpdated()));
57  connect(m_searchButton, SIGNAL(clicked()), parent, SLOT(searchMusicLrcs()));
58  connect(m_wallpaperButton, SIGNAL(clicked()), SLOT(wallpaperButtonClicked()));
59  connect(m_photoButton, SIGNAL(clicked()), SLOT(showArtistPhotoWidget()));
60  connect(m_moreButton, SIGNAL(clicked()), SLOT(showFloatSettingWidget()));
61  connect(m_floatSettingWidget, SIGNAL(widgetClose()), SLOT(closeFloatSettingWidget()));
62 }
63 
65 {
66  delete m_moreButton;
67  delete m_updateButton;
68  delete m_searchButton;
69  delete m_wallpaperButton;
70  delete m_photoButton;
71  delete m_floatPhotoWidget;
72  delete m_floatSettingWidget;
73 }
74 
75 void MusicLrcFloatWidget::resizeGeometry(int width, int height)
76 {
77  m_rectEnter = QRect(566 + width, 138 + height / 2, 115, 210);
78  m_rectLeave = QRect(676 + width, 189 + height / 2, 115, 105);
79  setGeometry(m_rectLeave);
80 
81  m_floatSettingWidget->resizeGeometry(width, height);
82  m_floatPhotoWidget->resizeGeometry(width, height);
83 }
84 
86 {
88  {
90  }
91 }
92 
94 {
97  setBlockAnimation(true);
98 }
99 
101 {
102  m_floatSettingWidget->close();
103  setBlockAnimation(false);
104 }
105 
107 {
108  if(m_wallpaperButton->styleSheet().contains(TTK::UI::InteriorFloatWallpaper))
109  {
111  }
112  else
113  {
115  }
116 
117  if(MusicBottomAreaWidget::instance()->isLrcWidgetShowFullScreen())
118  {
120  }
122 }
static constexpr const char * InteriorFloatWallpaper
static MusicRightAreaWidget * instance()
static constexpr const char * InteriorFloatUpdate
static const QString BackgroundStyle05
Definition: musicuiobject.h:94
static const QString PushButtonStyle11
static MusicBottomAreaWidget * instance()
static const QString PushButtonStyle01
PushButton.
The class of the lrc setting float widget.
MusicLrcFloatSettingWidget * m_floatSettingWidget
static constexpr const char * InteriorFloatWallpaperOn
void resizeGeometry(int width, int height)
MusicLrcFloatPhotoWidget * m_floatPhotoWidget
QPushButton * m_wallpaperButton
The class of the float widget base.
The class of the lrc photo float widget.
static constexpr const char * InteriorFloatSearch
static const QString PushButtonStyle07
QPushButton * m_photoButton
void resizeGeometry(int width, int height)
static constexpr const char * InteriorFloatPhoto
QPushButton * m_searchButton
static constexpr const char * InteriorFloatMore
MusicLrcFloatWidget(QWidget *parent=nullptr)
QPushButton * m_moreButton
void resizeGeometry(int width, int height)
QPushButton * m_updateButton