Skip to content
Snippets Groups Projects
Commit a9f4a966 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Placeholders for experimental hamburger-bar

parent 016b5571
No related branches found
No related tags found
No related merge requests found
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file GUI/coregui/Views/ImportDataWidgets/RealDataSelectorToolBar.h
//! @brief Defines class RealDataSelectorToolBar
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#include "RealDataSelectorHBar.h"
namespace {
const int toolbar_icon_size = 32;
}
RealDataSelectorHBar::RealDataSelectorHBar(RealDataSelectorActions* actions, QWidget* parent)
: QToolBar(parent)
, m_dropDownMenuAction(nullptr)
{
setIconSize(QSize(toolbar_icon_size, toolbar_icon_size));
setProperty("_q_custom_style_disabled", QVariant(true));
m_dropDownMenuAction = new QAction(QStringLiteral("Add new material"), parent);
m_dropDownMenuAction->setIcon(QIcon(":/images/toolbar32dark_newitem.svg"));
m_dropDownMenuAction->setToolTip(QStringLiteral("Drop down menu with additional actions to import/modify datasets"));
connect(m_dropDownMenuAction, &QAction::triggered,
this, &RealDataSelectorHBar::onDropDownMenuAction);
addAction(m_dropDownMenuAction);
}
void RealDataSelectorHBar::onDropDownMenuAction()
{
}
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file GUI/coregui/Views/ImportDataWidgets/RealDataSelectorToolBar.h
//! @brief Defines class RealDataSelectorToolBar
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#ifndef REALDATASELECTORHBAR_H
#define REALDATASELECTORHBAR_H
#include "WinDllMacros.h"
#include <QToolBar>
class RealDataSelectorActions;
class QToolButton;
//! Toolbar on top of selector tree with hamburger-like menu button.
class BA_CORE_API_ RealDataSelectorHBar : public QToolBar
{
Q_OBJECT
public:
RealDataSelectorHBar(RealDataSelectorActions* actions, QWidget* parent = nullptr);
private slots:
void onDropDownMenuAction();
private:
QAction* m_dropDownMenuAction;
};
#endif // REALDATASELECTORHBAR_H
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "minisplitter.h" #include "minisplitter.h"
#include "RealDataSelectorActions.h" #include "RealDataSelectorActions.h"
#include "RealDataSelectorToolBar.h" #include "RealDataSelectorToolBar.h"
#include "RealDataSelectorHBar.h"
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QItemSelectionModel> #include <QItemSelectionModel>
...@@ -26,6 +27,7 @@ RealDataSelectorWidget::RealDataSelectorWidget(QWidget* parent) ...@@ -26,6 +27,7 @@ RealDataSelectorWidget::RealDataSelectorWidget(QWidget* parent)
: QWidget(parent) : QWidget(parent)
, m_selectorActions(new RealDataSelectorActions(this)) , m_selectorActions(new RealDataSelectorActions(this))
, m_toolBar(new RealDataSelectorToolBar(m_selectorActions, this)) , m_toolBar(new RealDataSelectorToolBar(m_selectorActions, this))
, m_hamBar(new RealDataSelectorHBar(m_selectorActions, this))
, m_splitter(new Manhattan::MiniSplitter) , m_splitter(new Manhattan::MiniSplitter)
, m_selectorWidget(new ItemSelectorWidget) , m_selectorWidget(new ItemSelectorWidget)
, m_propertiesWidget(new RealDataPropertiesWidget) , m_propertiesWidget(new RealDataPropertiesWidget)
...@@ -44,6 +46,7 @@ RealDataSelectorWidget::RealDataSelectorWidget(QWidget* parent) ...@@ -44,6 +46,7 @@ RealDataSelectorWidget::RealDataSelectorWidget(QWidget* parent)
mainLayout->setSpacing(0); mainLayout->setSpacing(0);
mainLayout->setContentsMargins(0, 0, 0, 0); mainLayout->setContentsMargins(0, 0, 0, 0);
mainLayout->addWidget(m_toolBar); mainLayout->addWidget(m_toolBar);
mainLayout->addWidget(m_hamBar);
mainLayout->addWidget(m_splitter); mainLayout->addWidget(m_splitter);
setLayout(mainLayout); setLayout(mainLayout);
......
...@@ -26,6 +26,7 @@ class RealDataModel; ...@@ -26,6 +26,7 @@ class RealDataModel;
class SessionItem; class SessionItem;
class RealDataSelectorActions; class RealDataSelectorActions;
class RealDataSelectorToolBar; class RealDataSelectorToolBar;
class RealDataSelectorHBar;
namespace Manhattan { class MiniSplitter;} namespace Manhattan { class MiniSplitter;}
//! The RealDataSelectorWidget represents left panel of ImportDataView. Contains a widget to //! The RealDataSelectorWidget represents left panel of ImportDataView. Contains a widget to
...@@ -53,6 +54,7 @@ public slots: ...@@ -53,6 +54,7 @@ public slots:
private: private:
RealDataSelectorActions* m_selectorActions; RealDataSelectorActions* m_selectorActions;
RealDataSelectorToolBar* m_toolBar; RealDataSelectorToolBar* m_toolBar;
RealDataSelectorHBar* m_hamBar;
Manhattan::MiniSplitter* m_splitter; Manhattan::MiniSplitter* m_splitter;
ItemSelectorWidget* m_selectorWidget; ItemSelectorWidget* m_selectorWidget;
RealDataPropertiesWidget* m_propertiesWidget; RealDataPropertiesWidget* m_propertiesWidget;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment