ui/searchdialog.cpp \
ui/panelbase.cpp \
ui/panelbar.cpp \
- ui/panelcontent.cpp \
+ ui/panelcontentstack.cpp \
ui/paneltab.cpp \
ui/paneltabbar.cpp \
ui/tabbedpanel.cpp \
ui/searchdialog.h \
ui/panelbase.h \
ui/panelbar.h \
- ui/panelcontent.h \
ui/panelcommon.h \
+ ui/panelcontentstack.h \
ui/paneltab.h \
ui/paneltabbar.h \
ui/tabbedpanel.h \
+++ /dev/null
-/*
- Situare - A location system for Facebook
- Copyright (C) 2010 Ixonos Plc. Authors:
-
- Kaj Wallin - kaj.wallin@ixonos.com
- 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 <QAbstractState>
-#include <QDebug>
-#include <QVBoxLayout>
-
-#include "panelbase.h"
-#include "panelcommon.h"
-
-#include "panelcontent.h"
-
-PanelContent::PanelContent(QWidget *parent)
- : QWidget(parent)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- resize(PANEL_WIDTH, PANEL_HEIGHT);
-
- m_panelVBox = new QVBoxLayout(this);
- m_panelVBox->setMargin(0);
- m_panelVBox->setSpacing(0);
-
- m_panelBase = new PanelBase(this);
- m_panelBase->setLayout(m_panelVBox);
- m_panelBase->resize(this->size());
-}
-
-void PanelContent::setContentWidget(QWidget *widget)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- m_panelVBox->addWidget(widget);
-}
-
-void PanelContent::resizePanelContent(const QSize &size)
-{
- qDebug() << __PRETTY_FUNCTION__;
-
- resize(PANEL_WIDTH, size.height() - PANEL_TOP_PADDING - PANEL_BOTTOM_PADDING);
-
- m_panelBase->resize(this->size());
-}
+++ /dev/null
-/*
- Situare - A location system for Facebook
- Copyright (C) 2010 Ixonos Plc. Authors:
-
- Kaj Wallin - kaj.wallin@ixonos.com
- 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 PANELCONTENT_H
-#define PANELCONTENT_H
-
-#include <QWidget>
-
-class QVBoxLayout;
-
-class PanelBase;
-
-///< @todo Base class? Might be misleading comment and does not tell about what this class does
-/**
- * @brief Base class for panel content area
- *
- * @author Kaj Wallin - kaj.wallin (at) ixonos.com
- * @author Pekka Nissinen - pekka.nissinen@ixonos.com
- */
-class PanelContent : public QWidget
-{
- Q_OBJECT
-
-public:
- /**
- * @brief Constructor
- *
- * @param parent Parent
- */
- PanelContent(QWidget *parent = 0);
-
-/*******************************************************************************
- * MEMBER FUNCTIONS AND SLOTS
- ******************************************************************************/
-public:
- /**
- * @brief Sets the panel content widget
- *
- * @param widget Widget
- */
- void setContentWidget(QWidget *widget);
-
-public slots:
- /**
- * @brief Slot to redraw the panel content area after window resize event
- *
- * @param size Size of the new window
- */
- void resizePanelContent(const QSize &size);
-
-/*******************************************************************************
- * DATA MEMBERS
- *******************************************************************************/
-private:
- QVBoxLayout *m_panelVBox; ///< Vertical layout inside the panel
-
- PanelBase *m_panelBase; ///< Widget for panel base
-};
-
-#endif // PANELCONTENT_H
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Kaj Wallin - kaj.wallin@ixonos.com
+ 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 <QAbstractState>
+#include <QDebug>
+#include <QVBoxLayout>
+
+#include "panelbase.h"
+#include "panelcommon.h"
+
+#include "panelcontentstack.h"
+
+PanelContentStack::PanelContentStack(QWidget *parent)
+ : QStackedWidget(parent)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ resize(PANEL_WIDTH, PANEL_HEIGHT);
+
+ m_panelVBox = new QVBoxLayout(this);
+ m_panelVBox->setMargin(0);
+ m_panelVBox->setSpacing(0);
+
+ m_panelBase = new PanelBase(this);
+ m_panelBase->setLayout(m_panelVBox);
+ m_panelBase->resize(this->size());
+}
+
+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());
+}
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Kaj Wallin - kaj.wallin@ixonos.com
+ 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 PANELCONTENTSTACK_H
+#define PANELCONTENTSTACK_H
+
+#include <QStackedWidget>
+
+class QVBoxLayout;
+
+class PanelBase;
+
+/**
+ * @brief Stack class for tabbed pabel widgets
+ *
+ * @author Kaj Wallin - kaj.wallin (at) ixonos.com
+ * @author Pekka Nissinen - pekka.nissinen@ixonos.com
+ */
+class PanelContentStack : public QStackedWidget
+{
+ Q_OBJECT
+
+public:
+ /**
+ * @brief Constructor
+ *
+ * @param parent Parent
+ */
+ PanelContentStack(QWidget *parent = 0);
+
+/*******************************************************************************
+ * MEMBER FUNCTIONS AND SLOTS
+ ******************************************************************************/
+public slots:
+ /**
+ * @brief Slot to redraw the panel content area after window resize event
+ *
+ * @param size Size of the new window
+ */
+ void resizePanelContentStack(const QSize &size);
+
+/*******************************************************************************
+ * DATA MEMBERS
+ *******************************************************************************/
+private:
+ QVBoxLayout *m_panelVBox; ///< Vertical layout inside the panel
+
+ PanelBase *m_panelBase; ///< Widget for panel base
+};
+
+#endif // PANELCONTENTSTACK_H
#include <QStateMachine>
#include "panelbar.h"
-#include "panelcontent.h"
+#include "panelcontentstack.h"
#include "paneltabbar.h"
#include "tabbedpanel.h"
move(PANEL_CLOSED_X, PANEL_TOP_PADDING);
// --- TABS ---
- m_panelWidgetStack = new QStackedWidget(this);
-
m_panelTabBar = new PanelTabBar(this);
connect(m_panelTabBar, SIGNAL(currentChanged(int)),
m_panelBar->move(PANEL_TAB_WIDTH, 0);
// --- PANEL CONTENT ---
- m_panelContent = new PanelContent(this);
- m_panelContent->setContentWidget(m_panelWidgetStack);
- m_panelContent->move(PANEL_TAB_WIDTH + PANEL_BAR_WIDTH, 0);
+ m_panelContentStack = new PanelContentStack(this);
+ m_panelContentStack->move(PANEL_TAB_WIDTH + PANEL_BAR_WIDTH, 0);
// --- PANEL ANIMATION ---
m_panelStateMachine = new QStateMachine(this);
{
qDebug() << __PRETTY_FUNCTION__;
-
const int APPEND_INDEX = -1;
return insertTab(APPEND_INDEX, widget, icon);
{
qDebug() << __PRETTY_FUNCTION__;
- index = m_panelWidgetStack->insertWidget(index, widget);
+ index = m_panelContentStack->insertWidget(index, widget);
m_panelTabBar->insertTab(index, icon);
return index;
{
qDebug() << __PRETTY_FUNCTION__;
- if(QWidget *widget = m_panelWidgetStack->widget(index)) {
- m_panelWidgetStack->removeWidget(widget);
+ if(QWidget *widget = m_panelContentStack->widget(index)) {
+ m_panelContentStack->removeWidget(widget);
m_panelTabBar->removeTab(index);
}
}
m_panelBar->resizeBar(size);
- m_panelContent->resizePanelContent(size);
+ m_panelContentStack->resizePanelContentStack(size);
QPoint closedPosition(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH, PANEL_TOP_PADDING);
m_panelStateClosed->assignProperty(this, "pos", closedPosition);
QPoint openedPosition(size.width() - PANEL_TAB_WIDTH - PANEL_BAR_WIDTH - PANEL_WIDTH,
PANEL_TOP_PADDING);
m_panelStateOpened->assignProperty(this, "pos", openedPosition);
-
}
void TabbedPanel::showPanel(QWidget *widget)
{
qDebug() << __PRETTY_FUNCTION__;
- m_panelTabBar->selectTab(m_panelWidgetStack->indexOf(widget));
+ m_panelTabBar->selectTab(m_panelContentStack->indexOf(widget));
}
void TabbedPanel::setCurrentIndex(int index)
{
qDebug() << __PRETTY_FUNCTION__;
- if ((index < m_panelWidgetStack->count()) && (index >= 0)) {
- m_panelWidgetStack->setCurrentIndex(index);
+ if ((index < m_panelContentStack->count()) && (index >= 0)) {
+ m_panelContentStack->setCurrentIndex(index);
if(!m_isOpen)
emit toggleState();
class QPropertyAnimation;
class QSignalTransition;
-class QStackedWidget;
class QState;
class QStateMachine;
class PanelBar;
-class PanelContent;
+class PanelContentStack;
class PanelTabBar;
/**
QSignalTransition *m_panelTransitionClose; ///< Transition signal for closing the panel
QSignalTransition *m_panelTransitionOpen; ///< Transition signal for opening the panel
- QStackedWidget *m_panelWidgetStack; ///< Stack for panel widgets
-
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
PanelBar *m_panelBar; ///< Widget for panel bar
- PanelContent *m_panelContent; ///< Widget for panel content
+ PanelContentStack *m_panelContentStack; ///< Stack for panel widgets
PanelTabBar *m_panelTabBar; ///< Widget for panel tab bar
};