Added a preliminary class and images for panel context button bar
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 18 Aug 2010 19:05:48 +0000 (22:05 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 18 Aug 2010 19:05:48 +0000 (22:05 +0300)
images.qrc
res/images/panel_context_button_bar_tile.png [new file with mode: 0644]
res/images/panel_context_button_bar_top.png [new file with mode: 0644]
src/src.pro
src/ui/panelcontextbuttonbar.cpp [new file with mode: 0644]
src/ui/panelcontextbuttonbar.h [new file with mode: 0644]
src/ui/tabbedpanel.cpp
src/ui/tabbedpanel.h

index 01708f4..807345e 100644 (file)
@@ -31,6 +31,8 @@
         <file>res/images/menu_bar_drop_shadow.png</file>
         <file>res/images/own_location.png</file>
         <file>res/images/panel_bar_tile.png</file>
+        <file>res/images/panel_context_button_bar_tile.png</file>
+        <file>res/images/panel_context_button_bar_top.png</file>
         <file>res/images/profile_pic_border.png</file>
         <file>res/images/refresh.png</file>
         <file>res/images/refresh_s.png</file>
diff --git a/res/images/panel_context_button_bar_tile.png b/res/images/panel_context_button_bar_tile.png
new file mode 100644 (file)
index 0000000..08c6de1
Binary files /dev/null and b/res/images/panel_context_button_bar_tile.png differ
diff --git a/res/images/panel_context_button_bar_top.png b/res/images/panel_context_button_bar_top.png
new file mode 100644 (file)
index 0000000..6cc4454
Binary files /dev/null and b/res/images/panel_context_button_bar_top.png differ
index c7b9559..07de0ac 100644 (file)
@@ -73,6 +73,7 @@ SOURCES += main.cpp \
     ui/panelbar.cpp \
     ui/panelbase.cpp \
     ui/panelcontentstack.cpp \
+    ui/panelcontextbuttonbar.cpp \
     ui/paneltab.cpp \
     ui/paneltabbar.cpp \
     ui/tabbedpanel.cpp \
@@ -150,6 +151,7 @@ HEADERS += application.h \
     ui/panelbase.h \
     ui/panelcommon.h \
     ui/panelcontentstack.h \
+    ui/panelcontextbuttonbar.h \
     ui/paneltab.h \
     ui/paneltabbar.h \
     ui/tabbedpanel.h \
diff --git a/src/ui/panelcontextbuttonbar.cpp b/src/ui/panelcontextbuttonbar.cpp
new file mode 100644 (file)
index 0000000..0a6ce46
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+    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 "panelcontextbuttonbar.h"
+
+const int CONTEXT_BUTTON_BAR_RECT_X = 0;
+const int CONTEXT_BUTTON_BAR_WIDTH = 78;
+const int CONTEXT_BUTTON_BAR_HEIGHT = 16;
+const int CONTEXT_BUTTON_BAR_TOP_HEIGHT = 32;
+
+PanelContextButtonBar::PanelContextButtonBar(QWidget *parent)
+    : QWidget(parent)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    m_barTile.load(":/res/images/panel_context_button_bar_tile.png");
+    m_barTop.load(":/res/images/panel_context_button_bar_top.png");
+
+    m_barRect.setRect(CONTEXT_BUTTON_BAR_RECT_X, CONTEXT_BUTTON_BAR_TOP_HEIGHT,
+                      CONTEXT_BUTTON_BAR_WIDTH, CONTEXT_BUTTON_BAR_HEIGHT);
+
+    resize(CONTEXT_BUTTON_BAR_WIDTH, CONTEXT_BUTTON_BAR_HEIGHT + CONTEXT_BUTTON_BAR_TOP_HEIGHT);
+}
+
+void PanelContextButtonBar::paintEvent(QPaintEvent *event)
+{
+    qDebug() << __PRETTY_FUNCTION__;
+
+    Q_UNUSED(event);
+
+    const int CONTEXT_BUTTON_BAR_TOP_X = 0;
+    const int CONTEXT_BUTTON_BAR_TOP_Y = 0;
+
+    QPainter painter(this);
+
+    painter.drawPixmap(CONTEXT_BUTTON_BAR_TOP_X, CONTEXT_BUTTON_BAR_TOP_Y, m_barTop);
+    painter.drawTiledPixmap(m_barRect, m_barTile);
+
+}
diff --git a/src/ui/panelcontextbuttonbar.h b/src/ui/panelcontextbuttonbar.h
new file mode 100644 (file)
index 0000000..4e39c0a
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+    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 PANELCONTEXTBUTTONBAR_H
+#define PANELCONTEXTBUTTONBAR_H
+
+#include <QWidget>
+
+class PanelContextButtonBar : public QWidget
+{
+    Q_OBJECT
+
+public:
+    /**
+     * @brief Constructor
+     *
+     * @param parent Parent
+     */
+    PanelContextButtonBar(QWidget *parent = 0);
+
+/*******************************************************************************
+ * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+ ******************************************************************************/
+protected:
+    /**
+     * @brief Draws the bar
+     *
+     * @param event Paint event
+     */
+    void paintEvent(QPaintEvent *event);
+
+/*******************************************************************************
+ * DATA MEMBERS
+ ******************************************************************************/
+private:
+    QPixmap m_barTile;  ///< Pixmap for button bar
+    QPixmap m_barTop;   ///< Pixmap for button bar top
+
+    QRect m_barRect;    ///< Rect for the button bar
+};
+
+#endif // PANELCONTEXTBUTTONBAR_H
index 7da73c4..9bdd962 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "panelbar.h"
 #include "panelcontentstack.h"
+#include "panelcontextbuttonbar.h"
 #include "paneltabbar.h"
 
 #include "tabbedpanel.h"
@@ -62,6 +63,10 @@ TabbedPanel::TabbedPanel(QWidget *parent)
     m_panelBar = new PanelBar(this);
     m_panelBar->move(PANEL_TAB_WIDTH, PANEL_TOP_Y);
 
+    // --- CONTEXT BUTTON BAR ---
+    m_panelContextButtonBar = new PanelContextButtonBar(this);
+    m_panelContextButtonBar->move(1, 300);
+
     // --- PANEL CONTENT ---
     m_panelContentStack = new PanelContentStack(this);
     m_panelContentStack->move(PANEL_TAB_WIDTH + PANEL_BAR_WIDTH, PANEL_TOP_Y);
index 9f59572..52c3cfb 100644 (file)
@@ -34,6 +34,7 @@ class QStateMachine;
 
 class PanelBar;
 class PanelContentStack;
+class PanelContextButtonBar;
 class PanelTabBar;
 
 /**
@@ -168,19 +169,20 @@ signals:
 private:
     bool m_isOpen;      ///< Boolean used to track the current state of the statemachine
 
-    QPropertyAnimation *m_panelAnimation;       ///< Animation for panel state changes
+    QPropertyAnimation *m_panelAnimation;           ///< Animation for panel state changes
 
-    QSignalTransition *m_panelTransitionClose;  ///< Transition signal for closing the panel
-    QSignalTransition *m_panelTransitionOpen;   ///< Transition signal for opening the panel
+    QSignalTransition *m_panelTransitionClose;      ///< Transition signal for closing the panel
+    QSignalTransition *m_panelTransitionOpen;       ///< Transition signal for opening the panel
 
-    QState *m_panelStateClosed;                 ///< State of the closed panel
-    QState *m_panelStateOpened;                 ///< State of the opened panel
+    QState *m_panelStateClosed;                     ///< State of the closed panel
+    QState *m_panelStateOpened;                     ///< State of the opened panel
 
-    QStateMachine *m_panelStateMachine;         ///< State machine for sliding the panel
+    QStateMachine *m_panelStateMachine;             ///< State machine for sliding the panel
 
-    PanelBar *m_panelBar;                       ///< Widget for panel bar
-    PanelContentStack *m_panelContentStack;     ///< Stack for panel widgets
-    PanelTabBar *m_panelTabBar;                 ///< Widget for panel tab bar
+    PanelBar *m_panelBar;                           ///< Widget for panel bar
+    PanelContentStack *m_panelContentStack;         ///< Stack for panel widgets
+    PanelContextButtonBar * m_panelContextButtonBar;///< Widget for panel context button bar
+    PanelTabBar *m_panelTabBar;                     ///< Widget for panel tab bar
 };
 
 #endif // TABBEDPANEL_H