Added new bitmaps for scalable panels, made a separate class for side panel base
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Mon, 14 Jun 2010 14:06:53 +0000 (17:06 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Mon, 14 Jun 2010 14:06:53 +0000 (17:06 +0300)
res/images/menu_bar_drop_shadow.png [new file with mode: 0755]
res/images/side_bar_middle_left.png [new file with mode: 0644]
res/images/side_bar_middle_right.png [new file with mode: 0644]
res/images/side_bar_tile_left.png [new file with mode: 0644]
res/images/side_bar_tile_right.png [new file with mode: 0644]
res/images/sliding_bar_button.png [new file with mode: 0644]
res/images/sliding_bar_tile.png [new file with mode: 0644]
src/ui/sidepanelbase.cpp [new file with mode: 0644]
src/ui/sidepanelbase.h [new file with mode: 0644]

diff --git a/res/images/menu_bar_drop_shadow.png b/res/images/menu_bar_drop_shadow.png
new file mode 100755 (executable)
index 0000000..1dbcbc7
Binary files /dev/null and b/res/images/menu_bar_drop_shadow.png differ
diff --git a/res/images/side_bar_middle_left.png b/res/images/side_bar_middle_left.png
new file mode 100644 (file)
index 0000000..02e7096
Binary files /dev/null and b/res/images/side_bar_middle_left.png differ
diff --git a/res/images/side_bar_middle_right.png b/res/images/side_bar_middle_right.png
new file mode 100644 (file)
index 0000000..80eb378
Binary files /dev/null and b/res/images/side_bar_middle_right.png differ
diff --git a/res/images/side_bar_tile_left.png b/res/images/side_bar_tile_left.png
new file mode 100644 (file)
index 0000000..a724a27
Binary files /dev/null and b/res/images/side_bar_tile_left.png differ
diff --git a/res/images/side_bar_tile_right.png b/res/images/side_bar_tile_right.png
new file mode 100644 (file)
index 0000000..62bb01e
Binary files /dev/null and b/res/images/side_bar_tile_right.png differ
diff --git a/res/images/sliding_bar_button.png b/res/images/sliding_bar_button.png
new file mode 100644 (file)
index 0000000..e218c3a
Binary files /dev/null and b/res/images/sliding_bar_button.png differ
diff --git a/res/images/sliding_bar_tile.png b/res/images/sliding_bar_tile.png
new file mode 100644 (file)
index 0000000..2c832bb
Binary files /dev/null and b/res/images/sliding_bar_tile.png differ
diff --git a/src/ui/sidepanelbase.cpp b/src/ui/sidepanelbase.cpp
new file mode 100644 (file)
index 0000000..c999a6e
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+    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 "sidepanelbase.h"
+
+SidePanelBase::SidePanelBase(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 SidePanelBase::paintEvent(QPaintEvent *)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    QPainter painter(this);
+
+    QRect shadowRect = QRect(0, 0, this->rect().width(), m_menuDropShadowTile.height());
+    painter.drawTiledPixmap(shadowRect, m_menuDropShadowTile);
+}
diff --git a/src/ui/sidepanelbase.h b/src/ui/sidepanelbase.h
new file mode 100644 (file)
index 0000000..7011f27
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+    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 SIDEPANELBASE_H
+#define SIDEPANELBASE_H
+
+#include <QPaintEvent>
+#include <QPixmap>
+#include <QWidget>
+
+/**
+ * @brief Base class for panel inner content
+ *
+ * @author Pekka Nissinen - pekka.nissinen@ixonos.com
+ *
+ * @class SidePanelBase sidepanelbase.h "ui/sidepanelbase.h"
+ */
+class SidePanelBase : public QWidget
+{
+    Q_OBJECT
+
+public:
+    /**
+     * @brief Constructor
+     *
+     * @param parent Parent
+     */
+    SidePanelBase(QWidget *parent);
+
+/*******************************************************************************
+ * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+ ******************************************************************************/
+protected:
+    /**
+     * @brief Draws the panel content base
+     *
+     * @param * QPaintEvent unused
+     */
+    void paintEvent(QPaintEvent *);
+
+/*******************************************************************************
+ * DATA MEMBERS
+ *******************************************************************************/
+private:
+    QPixmap m_menuDropShadowTile; ///< Pixmap for menu drop shadow
+};
+
+#endif // SIDEPANELBASE_H