Moved around headers, should make it faster to compile.
This commit is contained in:
parent
1e8286a5b9
commit
2c20ddf6fc
24 changed files with 121 additions and 40 deletions
|
@ -1,7 +1,10 @@
|
|||
|
||||
#include "MainWindow.h"
|
||||
#include "Button.h"
|
||||
|
||||
#include "Skin.h"
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
Button::Button (QWidget *parent) : PixWidget (parent)
|
||||
{
|
||||
m_name_normal = 0;
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "MainWindow.h"
|
||||
#include "Display.h"
|
||||
|
||||
#include "TitleBar.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
|
||||
SkinDisplay::SkinDisplay (QWidget *parent) : QWidget(parent)
|
||||
|
@ -29,8 +31,8 @@ SkinDisplay::mousePressEvent (QMouseEvent *event)
|
|||
void
|
||||
SkinDisplay::mouseMoveEvent (QMouseEvent *event)
|
||||
{
|
||||
m_mw->move(event->globalPos().x() - m_diffX,
|
||||
event->globalPos().y() - m_diffY);
|
||||
m_mw->move (event->globalPos().x() - m_diffX,
|
||||
event->globalPos().y() - m_diffY);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -33,7 +33,6 @@ class SkinDisplay : public QWidget
|
|||
QWidget *m_mw;
|
||||
QWidget *m_tbar;
|
||||
|
||||
private:
|
||||
int m_diffX;
|
||||
int m_diffY;
|
||||
};
|
||||
|
|
|
@ -1,7 +1,18 @@
|
|||
#include "XMMSHandler.h"
|
||||
#include "MainDisplay.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include "TitleBar.h"
|
||||
#include "Button.h"
|
||||
#include "TextBar.h"
|
||||
#include "NumberDisplay.h"
|
||||
#include "TimeDisplay.h"
|
||||
#include "SmallNumberDisplay.h"
|
||||
#include "StereoMono.h"
|
||||
#include "Slider.h"
|
||||
#include "PlayStatus.h"
|
||||
#include "VolumeSlider.h"
|
||||
#include "Playlist.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QSettings>
|
||||
|
@ -56,6 +67,22 @@ MainDisplay::MainDisplay (QWidget *parent) : SkinDisplay(parent)
|
|||
this, SLOT(setPlaytime(uint)));
|
||||
}
|
||||
|
||||
void
|
||||
MainDisplay::mouseMoveEvent (QMouseEvent *event)
|
||||
{
|
||||
MainWindow *mw = dynamic_cast<MainWindow *>(window ());
|
||||
PlaylistWindow *pl = mw->getPL ();
|
||||
|
||||
m_mw->move (event->globalPos().x() - m_diffX,
|
||||
event->globalPos().y() - m_diffY);
|
||||
|
||||
if (!pl || !pl->isVisible ())
|
||||
return;
|
||||
|
||||
pl->move (event->globalPos().x() - m_diffX,
|
||||
event->globalPos().y() - m_diffY + size().height());
|
||||
}
|
||||
|
||||
void
|
||||
MainDisplay::setPixmaps (Skin *skin)
|
||||
{
|
||||
|
|
|
@ -15,6 +15,7 @@ class MainDisplay;
|
|||
#include <QPalette>
|
||||
|
||||
#include "Display.h"
|
||||
/*
|
||||
#include "TitleBar.h"
|
||||
#include "Button.h"
|
||||
#include "TextBar.h"
|
||||
|
@ -26,6 +27,18 @@ class MainDisplay;
|
|||
#include "PlayStatus.h"
|
||||
#include "VolumeSlider.h"
|
||||
#include "MainWindow.h"
|
||||
*/
|
||||
|
||||
class Button;
|
||||
class ToggleButton;
|
||||
class TextScroller;
|
||||
class TimeDisplay;
|
||||
class SmallNumberDisplay;
|
||||
class StereoMono;
|
||||
class Slider;
|
||||
class VolumeSlider;
|
||||
class PlayStatus;
|
||||
class MainWindow;
|
||||
|
||||
class MainDisplay : public SkinDisplay
|
||||
{
|
||||
|
@ -48,6 +61,8 @@ class MainDisplay : public SkinDisplay
|
|||
PlayStatus *m_playstatus;
|
||||
MainWindow *getMW(void) { return m_mw; }
|
||||
|
||||
void mouseMoveEvent (QMouseEvent *);
|
||||
|
||||
public slots:
|
||||
void setPixmaps(Skin *skin);
|
||||
void setStatus (uint status);
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
#include "ServerBrowser.h"
|
||||
#endif
|
||||
|
||||
#include "Playlist.h"
|
||||
#include "MainDisplay.h"
|
||||
#include "ShadedDisplay.h"
|
||||
|
||||
#include <QSettings>
|
||||
#include <QIcon>
|
||||
#include <QPluginLoader>
|
||||
|
@ -75,27 +79,15 @@ MainWindow::switchDisplay ()
|
|||
|
||||
}
|
||||
|
||||
void
|
||||
MainWindow::raisePL (void)
|
||||
{
|
||||
m_playlistwin->raise ();
|
||||
}
|
||||
|
||||
void
|
||||
MainWindow::moveEvent (QMoveEvent *event)
|
||||
{
|
||||
int x = event->oldPos().x();
|
||||
int y = event->oldPos().y() + size().height();
|
||||
|
||||
if (!m_playlistwin)
|
||||
return;
|
||||
|
||||
int x2 = m_playlistwin->pos().x();
|
||||
int y2 = m_playlistwin->pos().y();
|
||||
|
||||
int diffy = y - y2;
|
||||
int diffx = x - x2;
|
||||
|
||||
if ((diffy > -5 && diffy < 5) && (diffx > -10 && diffx < 10))
|
||||
{
|
||||
m_playlistwin->move (event->pos().x(),
|
||||
event->pos().y() + size().height());
|
||||
}
|
||||
|
||||
QSettings s;
|
||||
s.setValue ("mainwindow/pos", pos ());
|
||||
}
|
||||
|
|
14
MainWindow.h
14
MainWindow.h
|
@ -14,11 +14,20 @@ class MainWindow;
|
|||
#include <QHash>
|
||||
#include <QSettings>
|
||||
|
||||
#include "Skin.h"
|
||||
#include "XmmsQT4.h"
|
||||
|
||||
/*
|
||||
#include "Skin.h"
|
||||
#include "MainDisplay.h"
|
||||
#include "ShadedDisplay.h"
|
||||
#include "Playlist.h"
|
||||
*/
|
||||
|
||||
class XmmsQT4;
|
||||
class Skin;
|
||||
class MainDisplay;
|
||||
class ShadedDisplay;
|
||||
class PlaylistWindow;
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
|
@ -29,9 +38,10 @@ class MainWindow : public QMainWindow
|
|||
|
||||
MainDisplay *getMD () { return m_display; }
|
||||
ShadedDisplay *getSD () { return m_shaded; }
|
||||
PlaylistWindow *getPL () { return m_playlistwin; }
|
||||
|
||||
void setPL (PlaylistWindow *p) { m_playlistwin = p; }
|
||||
void raisePL (void) { m_playlistwin->raise (); }
|
||||
void raisePL (void);
|
||||
void moveEvent (QMoveEvent *event);
|
||||
void togglePL (bool UpdateButton);
|
||||
bool isTimemodeReverse(void) { QSettings s; return s.value("MainWindow/timemodereverse").toBool(); }
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#include "MainWindow.h"
|
||||
#include "NumberDisplay.h"
|
||||
|
||||
#include "TimeDisplay.h"
|
||||
#include "Skin.h"
|
||||
|
||||
NumberDisplay::NumberDisplay (QWidget *parent, TimeDisplay *td,uint w, uint startpx) : PixWidget (parent)
|
||||
{
|
||||
m_td = td;
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
class TimeDisplay;
|
||||
|
||||
#include "PixWidget.h"
|
||||
//#include "TimeDisplay.h"
|
||||
|
||||
class NumberDisplay : public PixWidget
|
||||
{
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#include "MainWindow.h"
|
||||
|
||||
#include "Skin.h"
|
||||
#include "PixWidget.h"
|
||||
|
||||
PixWidget::PixWidget (QWidget *parent) : QWidget (parent)
|
||||
{
|
||||
Skin *skin = Skin::getInstance();
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
#include "Skin.h"
|
||||
|
||||
#include <QPixmap>
|
||||
#include <QPainter>
|
||||
#include <QWidget>
|
||||
|
||||
class Skin;
|
||||
|
||||
class PixWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "PlayStatus.h"
|
||||
#include "Skin.h"
|
||||
|
||||
PlayStatus::PlayStatus (QWidget *parent) : PixWidget (parent)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#include "MainWindow.h"
|
||||
#include "Playlist.h"
|
||||
#include "PlaylistList.h"
|
||||
|
||||
#include "PlaylistShade.h"
|
||||
#include "PlaylistMenu.h"
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
@ -434,6 +436,13 @@ PlaylistWidget::setActive (bool active)
|
|||
update ();
|
||||
}
|
||||
|
||||
|
||||
uint
|
||||
PlaylistWidget::getOffset (void)
|
||||
{
|
||||
return m_list->getOffset ();
|
||||
}
|
||||
|
||||
void
|
||||
PlaylistWidget::mouseDoubleClickEvent (QMouseEvent *event)
|
||||
{
|
||||
|
|
15
Playlist.h
15
Playlist.h
|
@ -2,12 +2,6 @@
|
|||
#define __PLAYLIST_H__
|
||||
|
||||
#include "XMMSHandler.h"
|
||||
#include "Skin.h"
|
||||
#include "PlaylistList.h"
|
||||
#include "PixWidget.h"
|
||||
#include "Button.h"
|
||||
#include "PlaylistShade.h"
|
||||
#include "PlaylistMenu.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QFont>
|
||||
|
@ -16,6 +10,13 @@ class MainWindow;
|
|||
class PlaylistWidget;
|
||||
class PlaylistScroller;
|
||||
|
||||
#include "Button.h"
|
||||
|
||||
class Skin;
|
||||
class PlaylistList;
|
||||
class PlaylistShade;
|
||||
class PlaylistMenu;
|
||||
|
||||
class dragButton : public Button {
|
||||
public:
|
||||
dragButton (QWidget *parent) : Button (parent) {}
|
||||
|
@ -75,7 +76,7 @@ class PlaylistWidget : public QWidget {
|
|||
|
||||
void setActive (bool);
|
||||
void switchDisplay (void);
|
||||
uint getOffset (void) const { return m_list->getOffset (); };
|
||||
uint getOffset (void);
|
||||
|
||||
public slots:
|
||||
void setPixmaps (Skin *skin);
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
#include "XMMSHandler.h"
|
||||
|
||||
#include "ShadedDisplay.h"
|
||||
#include "TitleBar.h"
|
||||
#include "Button.h"
|
||||
|
||||
#include "SmallNumberDisplay.h"
|
||||
#include "TextBar.h"
|
||||
|
||||
ShadedDisplay::ShadedDisplay (QWidget *parent) : SkinDisplay (parent)
|
||||
{
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
|
||||
class ShadedDisplay;
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "Display.h"
|
||||
#include "SmallNumberDisplay.h"
|
||||
#include "TextBar.h"
|
||||
#include "Button.h"
|
||||
|
||||
class MainWindow;
|
||||
class Button;
|
||||
class SmallNumberDisplay;
|
||||
class TextScroller;
|
||||
|
||||
class ShadedDisplay : public SkinDisplay
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "MainWindow.h"
|
||||
|
||||
#include "Slider.h"
|
||||
#include "Skin.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMouseEvent>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "SmallNumberDisplay.h"
|
||||
#include "Skin.h"
|
||||
|
||||
SmallNumberDisplay::SmallNumberDisplay (QWidget *parent, int w) : PixWidget (parent)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "StereoMono.h"
|
||||
#include "Skin.h"
|
||||
|
||||
StereoMono::StereoMono (QWidget *parent) : PixWidget (parent)
|
||||
{
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include "TimeDisplay.h"
|
||||
#include "NumberDisplay.h"
|
||||
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include <QPen>
|
||||
|
||||
TimeDisplay::TimeDisplay (QWidget *parent, int time) : PixWidget (parent)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "SkinChooser.h"
|
||||
#include "Medialib.h"
|
||||
#include "SettingsWindow.h"
|
||||
#include "Button.h"
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
class TitleBar;
|
||||
|
||||
#include "PixWidget.h"
|
||||
#include "Button.h"
|
||||
|
||||
class Button;
|
||||
|
||||
class TitleBar : public PixWidget
|
||||
{
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
#include "VolumeSlider.h"
|
||||
#include <QMouseEvent>
|
||||
|
||||
#include "Skin.h"
|
||||
|
||||
// NOTE!
|
||||
// This file has lots of seemingly strange math.
|
||||
// I will document it as we go, but please keep in mind
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
#define __VOLUMESLIDER_H__
|
||||
|
||||
#include "PixWidget.h"
|
||||
#include "Button.h"
|
||||
|
||||
class VolumeSlider;
|
||||
class MainDisplay;
|
||||
class Button;
|
||||
|
||||
class VolButton : public PixWidget
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue