TTKMusicPlayer  3.7.0.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_update = new QPushButton(tr(" Update"), this);
23  m_search = new QPushButton(tr(" Search"), this);
24  m_more = new QPushButton(tr(" More"), this);
25  m_wallpaper = new QPushButton(tr(" Wallp"), this);
26  m_photo = new QPushButton(tr(" Photo"), this);
27 
28 #ifdef Q_OS_UNIX
29  m_update->setFocusPolicy(Qt::NoFocus);
30  m_search->setFocusPolicy(Qt::NoFocus);
31  m_more->setFocusPolicy(Qt::NoFocus);
32  m_wallpaper->setFocusPolicy(Qt::NoFocus);
33  m_photo->setFocusPolicy(Qt::NoFocus);
34 #endif
35 
36  m_update->setGeometry(15, 10, 80, 20);
37  m_search->setGeometry(15, 50, 80, 20);
38  m_more->setGeometry(15, 90, 80, 20);
39  m_wallpaper->setGeometry(15, 130, 80, 20);
40  m_photo->setGeometry(15, 170, 80, 20);
41 
47 
48  m_update->setCursor(QCursor(Qt::PointingHandCursor));
49  m_search->setCursor(QCursor(Qt::PointingHandCursor));
50  m_more->setCursor(QCursor(Qt::PointingHandCursor));
51  m_wallpaper->setCursor(QCursor(Qt::PointingHandCursor));
52  m_photo->setCursor(QCursor(Qt::PointingHandCursor));
53 #ifdef Q_OS_UNIX
54  m_wallpaper->setEnabled(false);
55 #endif
56  connect(m_update, SIGNAL(clicked()), parent, SIGNAL(currentLrcUpdated()));
57  connect(m_search, SIGNAL(clicked()), parent, SLOT(searchMusicLrcs()));
58  connect(m_wallpaper, SIGNAL(clicked()), SLOT(wallpaperButtonClicked()));
59  connect(m_photo, SIGNAL(clicked()), SLOT(showArtistPhotoWidget()));
60  connect(m_more, SIGNAL(clicked()), SLOT(showFloatSettingWidget()));
61  connect(m_floatSettingWidget, SIGNAL(widgetClose()), SLOT(closeFloatSettingWidget()));
62 }
63 
65 {
66  delete m_more;
67  delete m_update;
68  delete m_search;
69  delete m_wallpaper;
70  delete m_photo;
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_wallpaper->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:93
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
The class of the float widget base.
The class of the lrc photo float widget.
static constexpr const char * InteriorFloatSearch
static const QString PushButtonStyle07
void resizeGeometry(int width, int height)
static constexpr const char * InteriorFloatPhoto
static constexpr const char * InteriorFloatMore
MusicLrcFloatWidget(QWidget *parent=nullptr)
void resizeGeometry(int width, int height)