Simplified panel structure yet again by merging PanelBase class into PanelContentStac...
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Mon, 16 Aug 2010 13:22:01 +0000 (16:22 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Mon, 16 Aug 2010 13:22:01 +0000 (16:22 +0300)
Deleted the old unused class files.

src/src.pro
src/ui/panelbase.cpp [deleted file]
src/ui/panelbase.h [deleted file]
src/ui/panelcontentstack.cpp
src/ui/panelcontentstack.h

index 4085e45..81e5c75 100644 (file)
@@ -64,7 +64,6 @@ SOURCES += main.cpp \
     ui/listitemdelegate.cpp \
     ui/friendlistitemdelegate.cpp \
     ui/searchdialog.cpp \
-    ui/panelbase.cpp \    
     ui/panelbar.cpp \
     ui/panelcontentstack.cpp \
     ui/paneltab.cpp \
@@ -135,7 +134,6 @@ HEADERS += application.h \
     ui/listitem.h \
     ui/listitemdelegate.h \
     ui/searchdialog.h \
-    ui/panelbase.h \    
     ui/panelbar.h \
     ui/panelcommon.h \
     ui/panelcontentstack.h \
diff --git a/src/ui/panelbase.cpp b/src/ui/panelbase.cpp
deleted file mode 100644 (file)
index 5186828..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
-    Situare - A location system for Facebook
-    Copyright (C) 2010  Ixonos Plc. Authors:
-
-        Pekka Nissinen - pekka.nissinen@ixonos.com
-
-    Situare is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License
-    version 2 as published by the Free Software Foundation.
-
-    Situare 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.
-
-    You should have received a copy of the GNU General Public License
-    along with Situare; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
-    USA.
-*/
-
-#include <QDebug>
-#include <QPainter>
-#include <QPalette>
-#include <QRect>
-
-#include "panelbase.h"
-
-PanelBase::PanelBase(QWidget *parent)
-    : QWidget(parent)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    m_menuDropShadowTile.load(":res/images/menu_bar_drop_shadow.png");
-
-    QPalette pal = palette();
-    pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
-    setPalette(pal);
-    setAutoFillBackground(true);
-}
-
-void PanelBase::paintEvent(QPaintEvent *event)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    Q_UNUSED(event);
-
-    QPainter painter(this);
-
-    QRect shadowRect = QRect(0, 0, this->rect().width(), m_menuDropShadowTile.height());
-    painter.drawTiledPixmap(shadowRect, m_menuDropShadowTile);
-}
diff --git a/src/ui/panelbase.h b/src/ui/panelbase.h
deleted file mode 100644 (file)
index f0a7db2..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-    Situare - A location system for Facebook
-    Copyright (C) 2010  Ixonos Plc. Authors:
-
-        Pekka Nissinen - pekka.nissinen@ixonos.com
-
-    Situare is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License
-    version 2 as published by the Free Software Foundation.
-
-    Situare 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.
-
-    You should have received a copy of the GNU General Public License
-    along with Situare; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
-    USA.
-*/
-
-#ifndef PANELBASE_H
-#define PANELBASE_H
-
-#include <QPaintEvent>
-#include <QPixmap>
-#include <QWidget>
-
-///< @todo Base class? Might be misleading comment and does not tell about what this class does
-///< @todo Why not directly inheriting QStackedWidget?
-/**
- * @brief Base class for panel inner content
- *
- * @author Pekka Nissinen - pekka.nissinen@ixonos.com
- */
-class PanelBase : public QWidget
-{
-    Q_OBJECT
-
-public:
-    /**
-     * @brief Constructor
-     *
-     * @param parent Parent
-     */
-    PanelBase(QWidget *parent = 0);
-
-/*******************************************************************************
- * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
- ******************************************************************************/
-protected:
-    /**
-     * @brief Draws the panel content base
-     *
-     * @param event Paint event
-     */
-    void paintEvent(QPaintEvent *event);
-
-/*******************************************************************************
- * DATA MEMBERS
- *******************************************************************************/
-private:
-    QPixmap m_menuDropShadowTile; ///< Pixmap for menu drop shadow
-};
-
-#endif // PANELBASE_H
index b23af29..d59e401 100644 (file)
     USA.
 */
 
-#include <QAbstractState>
 #include <QDebug>
-#include <QVBoxLayout>
+#include <QPainter>
 
-#include "panelbase.h"
 #include "panelcommon.h"
 
 #include "panelcontentstack.h"
@@ -36,13 +34,24 @@ PanelContentStack::PanelContentStack(QWidget *parent)
 
     resize(PANEL_WIDTH, PANEL_HEIGHT);
 
-    m_panelVBox = new QVBoxLayout(this);
-    m_panelVBox->setMargin(0);
-    m_panelVBox->setSpacing(0);
+    m_menuDropShadowTile.load(":res/images/menu_bar_drop_shadow.png");
 
-    m_panelBase = new PanelBase(this);
-    m_panelBase->setLayout(m_panelVBox);
-    m_panelBase->resize(this->size());
+    QPalette pal = palette();
+    pal.setColor(QPalette::Background, QColor(0, 0, 0, 128));
+    setPalette(pal);
+    setAutoFillBackground(true);
+}
+
+void PanelContentStack::paintEvent(QPaintEvent *event)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    Q_UNUSED(event);
+
+    QPainter painter(this);
+
+    QRect shadowRect = QRect(0, 0, this->rect().width(), m_menuDropShadowTile.height());
+    painter.drawTiledPixmap(shadowRect, m_menuDropShadowTile);
 }
 
 void PanelContentStack::resizePanelContentStack(const QSize &size)
@@ -50,6 +59,4 @@ void PanelContentStack::resizePanelContentStack(const QSize &size)
     qDebug() << __PRETTY_FUNCTION__;
 
     resize(PANEL_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
-
-    m_panelBase->resize(this->size());
 }
index 9715035..e8515a8 100644 (file)
 
 #include <QStackedWidget>
 
-class QVBoxLayout;
-
-class PanelBase;
-
 /**
  * @brief Stack class for tabbed pabel widgets
  *
@@ -48,6 +44,17 @@ public:
     PanelContentStack(QWidget *parent = 0);
 
 /*******************************************************************************
+ * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+ ******************************************************************************/
+protected:
+    /**
+     * @brief Draws the panel content base
+     *
+     * @param event Paint event
+     */
+    void paintEvent(QPaintEvent *event);
+
+/*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
 public slots:
@@ -62,9 +69,7 @@ public slots:
  * DATA MEMBERS
  *******************************************************************************/
 private:
-    QVBoxLayout *m_panelVBox;   ///< Vertical layout inside the panel
-
-    PanelBase *m_panelBase;     ///< Widget for panel base
+    QPixmap m_menuDropShadowTile;   ///< Pixmap for menu drop shadow
 };
 
 #endif // PANELCONTENTSTACK_H