From 345f5d930e24ba55565243ebdf996f1bcd35350f Mon Sep 17 00:00:00 2001 From: Thomas Frauendorfer Date: Mon, 12 May 2008 20:45:41 +0200 Subject: [PATCH] Cleanup TextBar.h and remove now unused VolumeSlider --- src/TextBar.cpp | 7 ++++ src/TextBar.h | 13 ++------ src/VolumeSlider.cpp | 60 ---------------------------------- src/VolumeSlider.h | 38 --------------------- src/mainwindow/maindisplay.cpp | 1 + 5 files changed, 11 insertions(+), 108 deletions(-) delete mode 100644 src/VolumeSlider.cpp delete mode 100644 src/VolumeSlider.h diff --git a/src/TextBar.cpp b/src/TextBar.cpp index 0d48b05..b12c58b 100644 --- a/src/TextBar.cpp +++ b/src/TextBar.cpp @@ -15,8 +15,15 @@ #include "Display.h" #include "TextBar.h" +#include "Skin.h" +#include +#include +#include +#include +#include #include +#include TextScroller::TextScroller (QWidget *parent, uint w, uint h, const QString &name) : diff --git a/src/TextBar.h b/src/TextBar.h index 08b6471..4b7faf0 100644 --- a/src/TextBar.h +++ b/src/TextBar.h @@ -16,18 +16,11 @@ #ifndef __TEXTBOX_H__ #define __TEXTBOX_H__ -#include - -#include -#include #include -#include -#include -#include -#include -#include +class QPixmap; +class QTimer; -#include "Skin.h" +class Skin; class TextScroller : public QWidget { diff --git a/src/VolumeSlider.cpp b/src/VolumeSlider.cpp deleted file mode 100644 index f520176..0000000 --- a/src/VolumeSlider.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/** - * This file is a part of Promoe, an XMMS2 Client. - * - * Copyright (C) 2005-2008 XMMS2 Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#include "VolumeSlider.h" - -#include "Skin.h" - -Slider::Slider (QWidget *parent, uint name_min, uint name_max, - uint name_on, uint name_off, int min, int max) : PixmapSlider (parent) -{ - Skin *skin = Skin::getInstance(); - - connect (skin, SIGNAL (skinChanged (Skin *)), - this, SLOT (setPixmaps(Skin *))); - - setSliderOffset (QPoint (0, 1)); - - m_name_min = name_min; - m_name_max = name_max; - m_name_on = name_on; - m_name_off = name_off; - - setMinimum (min); - setMaximum (max); - -} - -void -Slider::setPixmaps (Skin *skin) -{ - QPixmapList bglist; - for (uint32_t i = m_name_min; i <= m_name_max; i++) { - bglist.append (skin->getItem(i)); - } - setBackground (bglist); - - if (!skin->getItem(m_name_on).isNull() && !skin->getItem(m_name_off).isNull()) { - setSliders (skin->getItem(m_name_on), skin->getItem(m_name_off)); - } else { - setSliders (QPixmap (), QPixmap ()); - } - - QPixmap pixmap_slider = skin->getItem(m_name_min); - setFixedSize(pixmap_slider.size()); - resize(pixmap_slider.size()); - - update(); -} diff --git a/src/VolumeSlider.h b/src/VolumeSlider.h deleted file mode 100644 index ea18ba8..0000000 --- a/src/VolumeSlider.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * This file is a part of Promoe, an XMMS2 Client. - * - * Copyright (C) 2005-2008 XMMS2 Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -#ifndef __VOLUMESLIDER_H__ -#define __VOLUMESLIDER_H__ - -#include "pixmapslider.h" -class Skin; - -class Slider : public PixmapSlider -{ - Q_OBJECT - public: - Slider (QWidget *parent, uint min, uint max, uint on, uint off, int, int); - - public slots: - void setPixmaps (Skin *skin); - - private: - uint m_name_min; - uint m_name_max; - uint m_name_on; - uint m_name_off; -}; - -#endif diff --git a/src/mainwindow/maindisplay.cpp b/src/mainwindow/maindisplay.cpp index 0abc144..be7b075 100644 --- a/src/mainwindow/maindisplay.cpp +++ b/src/mainwindow/maindisplay.cpp @@ -28,6 +28,7 @@ #include "TextBar.h" #include "NumberDisplay.h" #include "TimeDisplay.h" +#include "Skin.h" #include "SmallNumberDisplay.h" #include "stereomono.h" #include "posbar.h"