Added support for the shade/close buttons on the playlist, and changed the way
that togglePL works a bit to play nicer.
This commit is contained in:
parent
13b9c47523
commit
0c5593076a
7 changed files with 49 additions and 8 deletions
20
Playlist.cpp
20
Playlist.cpp
|
@ -1,4 +1,4 @@
|
|||
|
||||
#include "MainWindow.h"
|
||||
#include "Playlist.h"
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
@ -105,7 +105,7 @@ PlaylistScroller::paintEvent (QPaintEvent *event)
|
|||
PlaylistWindow::PlaylistWindow (QWidget *parent) : QMainWindow (parent)
|
||||
{
|
||||
QSettings s;
|
||||
|
||||
m_mw = dynamic_cast<MainWindow *>(parent);
|
||||
#ifndef _WIN32
|
||||
setWindowIcon (QIcon (":icon.png"));
|
||||
#endif
|
||||
|
@ -123,6 +123,14 @@ PlaylistWindow::PlaylistWindow (QWidget *parent) : QMainWindow (parent)
|
|||
setCentralWidget (m_playlist);
|
||||
m_shaded = new PlaylistShade (this);
|
||||
|
||||
m_shadebtn = new Button (this, Skin::PLS_SHADE_BTN_0, Skin::PLS_SHADE_BTN_1, true);
|
||||
connect (m_shadebtn, SIGNAL (clicked()), this, SLOT (switchDisplay ()));
|
||||
m_shadebtn->move(size().width() - 21, 3);
|
||||
|
||||
m_closebtn = new Button (this, Skin::PLS_CLOSE_BTN_0, Skin::PLS_CLOSE_BTN_1, true);
|
||||
connect (m_closebtn, SIGNAL (clicked()), this, SLOT (togglePL ()));
|
||||
m_closebtn->move(size().width() - 11, 3);
|
||||
|
||||
if (!s.contains ("shaded"))
|
||||
s.setValue ("shaded", false);
|
||||
else
|
||||
|
@ -134,6 +142,11 @@ PlaylistWindow::PlaylistWindow (QWidget *parent) : QMainWindow (parent)
|
|||
|
||||
}
|
||||
|
||||
void PlaylistWindow::togglePL (void)
|
||||
{
|
||||
m_mw->togglePL(true);
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistWindow::switchDisplay (void)
|
||||
{
|
||||
|
@ -169,6 +182,9 @@ PlaylistWindow::resizeEvent (QResizeEvent *event)
|
|||
{
|
||||
QSettings s;
|
||||
|
||||
m_shadebtn->move(size().width() - 21, 3);
|
||||
m_closebtn->move(size().width() - 11, 3);
|
||||
|
||||
if (s.value("playlist/shaded").toBool ()) {
|
||||
s.setValue ("playlist/size", size ());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue