ui/routewaypointlistview.cpp \
user/user.cpp \
ui/locationsearchpanel.cpp \
- ui/textmodifier.cpp
+ ui/textmodifier.cpp \
+ ui/listitemcontextbuttonbar.cpp
HEADERS += application.h \
common.h \
coordinates/geocoordinate.h \
ui/routewaypointlistview.h \
user/user.h \
ui/locationsearchpanel.h \
- ui/textmodifier.h
+ ui/textmodifier.h \
+ ui/listitemcontextbuttonbar.h
QT += network \
webkit
DEFINES += QT_NO_DEBUG_OUTPUT
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Sami Rämö - sami.ramo@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 "listitemcontextbuttonbar.h"
+
+ListItemContextButtonBar::ListItemContextButtonBar(QWidget *parent) :
+ QWidget(parent),
+ m_contextButtons(0)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+}
+
+void ListItemContextButtonBar::setContextButtons(QWidget *contextButtons)
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ // Hide previous buttons (if any)
+ if (m_contextButtons)
+ m_contextButtons->setParent(0);
+
+ m_contextButtons = contextButtons;
+
+ m_contextButtons->setParent(this);
+// m_contextButtons->setVisible(true);
+
+// setFixedHeight(m_contextButtons->height());
+
+// emit positionChangeRequested();
+}
--- /dev/null
+/*
+ Situare - A location system for Facebook
+ Copyright (C) 2010 Ixonos Plc. Authors:
+
+ Sami Rämö - sami.ramo@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 LISTITEMCONTEXTBUTTONBAR_H
+#define LISTITEMCONTEXTBUTTONBAR_H
+
+#include <QWidget>
+
+class ListItemContextButtonBar : public QWidget
+{
+ Q_OBJECT
+public:
+ explicit ListItemContextButtonBar(QWidget *parent = 0);
+
+ /**
+ * @brief Sets the context buttons to the context button bar
+ *
+ * @param contextButtons Pointer to context buttons
+ */
+ void setContextButtons(QWidget *contextButtons);
+
+signals:
+
+public slots:
+
+private:
+ QWidget *m_contextButtons; ///< Widget for context buttons
+
+};
+
+#endif // LISTITEMCONTEXTBUTTONBAR_H
return m_genericButtons;
}
+QWidget* PanelBase::itemButtons() const
+{
+ qDebug() << __PRETTY_FUNCTION__;
+
+ return m_itemButtons;
+}
+
void PanelBase::onListItemSelectionChanged()
{
qDebug() << __PRETTY_FUNCTION__;
{
qDebug() << __PRETTY_FUNCTION__;
- int x = event->size().width() / 2 - m_itemButtons->width() / 2;
- const int Y = 0;
- m_itemButtons->move(x, Y);
+// int x = event->size().width() / 2 - m_itemButtons->width() / 2;
+// const int Y = 0;
+// m_itemButtons->move(x, Y);
}
*/
QWidget* genericPanelButtons() const;
+ QWidget* itemButtons() const;
+
protected slots:
void onListItemSelectionChanged();
const int PANEL_BAR_WIDTH = 5; ///< Width of the slider bar
const int PANEL_TAB_BAR_WIDTH = 74; ///< Panel tab bar total width
const int PANEL_BAR_TABBED_WIDTH = PANEL_BAR_WIDTH + PANEL_TAB_BAR_WIDTH; ///< Width of the tabbed bar
-const int PANEL_WIDTH = 384; ///< Width of the panel
+const int PANEL_WIDTH = 384; ///< Width of the panel contents area
const int PANEL_HEIGHT = DEFAULT_SCREEN_HEIGHT - PANEL_TOP_PADDING
- PANEL_BOTTOM_PADDING; ///< Height of the panel
#include <QStackedWidget>
#include <QStateMachine>
+#include "listitemcontextbuttonbar.h"
#include "panelbar.h"
#include "panelbase.h"
#include "panelcontentstack.h"
m_panelBar = new PanelBar(this);
m_panelBar->move(PANEL_TAB_BAR_WIDTH, PANEL_TOP_Y);
- // --- CONTEXT BUTTON BAR ---
+ // --- GENERIC PANEL CONTEXT BUTTON BAR ---
m_panelContextButtonBar = new PanelContextButtonBar(this);
m_panelContextButtonBar->move(PANEL_CONTEXT_BUTTON_BAR_LEFT_X, PANEL_HEIGHT);
connect(m_panelContextButtonBar, SIGNAL(positionChangeRequested()),
this, SLOT(repositionContextButtonBar()));
+ // --- LIST ITEM RELATED CONTEXT BUTTONS BAR ---
+ m_itemContextButtonBar = new ListItemContextButtonBar(this);
+
// --- PANEL CONTENT ---
m_panelContentStack = new PanelContentStack(this);
m_panelContentStack->move(PANEL_TAB_BAR_WIDTH + PANEL_BAR_WIDTH, PANEL_TOP_Y);
+ m_panelContentStack->stackUnder(m_itemContextButtonBar);
// --- PANEL ANIMATION ---
QStateMachine *panelStateMachine = new QStateMachine(this);
qDebug() << __PRETTY_FUNCTION__;
m_panelContextButtonBar->move(PANEL_CONTEXT_BUTTON_BAR_LEFT_X, height());
-
+
calculateMask();
}
m_panelContextButtonBar->setContextButtons(
static_cast<PanelBase *>(m_panelContentStack->widget(index))->genericPanelButtons());
+ QWidget *itemContextButtons = static_cast<PanelBase *>(m_panelContentStack->widget(index))->itemButtons();
+ m_itemContextButtonBar->setContextButtons(itemContextButtons);
+
+ const int FROM_PANEL_CONTENTS_LEFT = PANEL_WIDTH / 2 - itemContextButtons->width() / 2;
+ const int Y = 0;
+
+ m_itemContextButtonBar->move(PANEL_TAB_BAR_WIDTH + PANEL_BAR_WIDTH
+ + FROM_PANEL_CONTENTS_LEFT, Y);
+
emit currentChanged(index);
}
}
class QState;
class QStateMachine;
+class ListItemContextButtonBar;
class PanelBar;
class PanelContentStack;
class PanelContextButtonBar;
QState *m_stateClosed; ///< State of the closed panel
QState *m_stateOpened; ///< State of the opened panel
+ ListItemContextButtonBar *m_itemContextButtonBar;
PanelBar *m_panelBar; ///< Widget for panel bar
PanelContentStack *m_panelContentStack; ///< Stack for panel widgets
PanelContextButtonBar * m_panelContextButtonBar; ///< Widget for panel context button bar