aboutsummaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/playlist.cpp10
-rw-r--r--src/ui/playlist.h47
2 files changed, 32 insertions, 25 deletions
diff --git a/src/ui/playlist.cpp b/src/ui/playlist.cpp
index 985678bc2..3ba49322e 100644
--- a/src/ui/playlist.cpp
+++ b/src/ui/playlist.cpp
@@ -74,6 +74,10 @@ PlayList::PlayList (QWidget *parent)
m_sortButton= new Button (this,Skin::PL_BT_SORT,Skin::PL_BT_SORT, Skin::CUR_PNORMAL);
m_sortButton->move (99,86);
m_playlistButton = new Button (this,Skin::PL_BT_LST,Skin::PL_BT_LST, Skin::CUR_PNORMAL);
+ m_resizeWidget = new QWidget(this);
+ m_resizeWidget->resize(25,25);
+ m_resizeWidget->setGeometry(width()-25, height()-25, 25, 25);
+ m_resizeWidget->setCursor(m_skin->getCursor (Skin::CUR_PSIZE));
m_pl_control = new PlaylistControl (this);
m_pl_control->move (0,0);
@@ -81,7 +85,7 @@ PlayList::PlayList (QWidget *parent)
m_length_totalLength = new SymbolDisplay (this,14);
m_length_totalLength->setAlignment (Qt::AlignLeft);
- m_length_totalLength -> show();
+ m_length_totalLength->show();
m_current_time = new SymbolDisplay (this,6);
m_current_time->show();
@@ -367,11 +371,12 @@ void PlayList::resizeEvent (QResizeEvent *e)
m_current_time->move (190+sx*25,101+29*sy);
m_plslider->move (255+sx*25,20);
+ m_resizeWidget->move(250 + sx * 25, 91 + sy * 29);
}
void PlayList::mousePressEvent (QMouseEvent *e)
{
m_pos = e->pos ();
- if ((m_pos.x() > width()-25) && (m_pos.y() > height()-25))
+ if (m_resizeWidget->underMouse())
{
m_resize = TRUE;
setCursor (m_skin->getCursor (Skin::CUR_PSIZE));
@@ -535,5 +540,6 @@ void PlayList::keyPressEvent (QKeyEvent *ke)
void PlayList::updateSkin()
{
setCursor(m_skin->getCursor(Skin::CUR_PNORMAL)); // TODO shaded
+ m_resizeWidget->setCursor(m_skin->getCursor (Skin::CUR_PSIZE));
update();
}
diff --git a/src/ui/playlist.h b/src/ui/playlist.h
index 903828574..1cf9fe454 100644
--- a/src/ui/playlist.h
+++ b/src/ui/playlist.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2006 by Ilya Kotov *
+ * Copyright (C) 2006-2009 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -22,14 +22,7 @@
#include <QWidget>
-class KeyboardManager;
-
-/**
- @author Ilya Kotov <forkotov02@hotmail.ru>
-*/
-
class QMenu;
-
class Skin;
class ListWidget;
class PlayListItem;
@@ -42,20 +35,27 @@ class SymbolDisplay;
class OutputState;
class PixmapWidget;
class PlaylistControl;
+class KeyboardManager;
+
+/**
+ @author Ilya Kotov <forkotov02@hotmail.ru>
+*/
class PlayList : public QWidget
{
Q_OBJECT
public:
- PlayList ( QWidget *parent = 0 );
+ PlayList (QWidget *parent = 0);
~PlayList();
- void load ( PlayListItem * );
- void setModel ( PlayListModel * );
+ void load (PlayListItem *);
+ void setModel (PlayListModel *);
void readSettings();
- //void setInfo ( const OutputState &,int,int );
PlayListItem *currentItem();
- ListWidget* listWidget() const{return m_listWidget;}
+ ListWidget* listWidget() const
+ {
+ return m_listWidget;
+ }
signals:
void play();
@@ -83,8 +83,8 @@ class PlayList : public QWidget
private:
- QString formatTime ( int sec );
- void drawPixmap ( int, int );
+ QString formatTime (int sec);
+ void drawPixmap (int, int);
void writeSettings();
void createMenus();
void createActions();
@@ -93,6 +93,7 @@ class PlayList : public QWidget
QMenu *m_selectMenu;
QMenu *m_sortMenu;
QMenu *m_playlistMenu;
+ QWidget *m_resizeWidget;
Button *m_buttonAdd;
Button *m_buttonSub;
Button *m_selectButton;
@@ -116,14 +117,14 @@ class PlayList : public QWidget
KeyboardManager* m_keyboardManager;
protected:
- virtual void paintEvent ( QPaintEvent * );
- virtual void resizeEvent ( QResizeEvent * );
- virtual void mouseMoveEvent ( QMouseEvent * );
- virtual void mousePressEvent ( QMouseEvent * );
- virtual void mouseReleaseEvent ( QMouseEvent * );
- virtual void changeEvent ( QEvent* );
- virtual void closeEvent ( QCloseEvent* );
- virtual void keyPressEvent ( QKeyEvent* );
+ virtual void paintEvent (QPaintEvent *);
+ virtual void resizeEvent (QResizeEvent *);
+ virtual void mouseMoveEvent (QMouseEvent *);
+ virtual void mousePressEvent (QMouseEvent *);
+ virtual void mouseReleaseEvent (QMouseEvent *);
+ virtual void changeEvent (QEvent*);
+ virtual void closeEvent (QCloseEvent*);
+ virtual void keyPressEvent (QKeyEvent*);
};
#endif