2022-09-05 17:29:42 +08:00
|
|
|
#ifndef SideTabBarH
|
|
|
|
#define SideTabBarH
|
|
|
|
/*******************************************************************************
|
|
|
|
** Qt Advanced Docking System
|
|
|
|
** Copyright (C) 2017 Uwe Kindler
|
|
|
|
**
|
|
|
|
** This library is free software; you can redistribute it and/or
|
|
|
|
** modify it under the terms of the GNU Lesser General Public
|
|
|
|
** License as published by the Free Software Foundation; either
|
|
|
|
** version 2.1 of the License, or (at your option) any later version.
|
|
|
|
**
|
|
|
|
** This library 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
|
|
|
|
** Lesser General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU Lesser General Public
|
|
|
|
** License along with this library; If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
/// \file DockWidgetTab.h
|
|
|
|
/// \author Syarif Fakhri
|
|
|
|
/// \date 05.09.2022
|
|
|
|
/// \brief Declaration of CSideTabBar class
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
// INCLUDES
|
|
|
|
//============================================================================
|
2022-10-26 15:50:16 +08:00
|
|
|
#include <QFrame>
|
|
|
|
#include "DockWidgetSideTab.h"
|
2022-09-05 17:29:42 +08:00
|
|
|
#include "ads_globals.h"
|
|
|
|
|
|
|
|
namespace ads
|
|
|
|
{
|
|
|
|
struct SideTabBarPrivate;
|
|
|
|
class CDockContainerWidget;
|
|
|
|
class CDockWidgetSideTab;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Side tab widget that is shown at the edges of a dock container.
|
|
|
|
*/
|
2022-10-26 15:50:16 +08:00
|
|
|
class ADS_EXPORT CSideTabBar : public QFrame
|
2022-09-05 17:29:42 +08:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2022-10-26 15:50:16 +08:00
|
|
|
Q_PROPERTY(int sideTabBarArea READ sideTabBarArea)
|
2022-09-14 14:25:11 +08:00
|
|
|
Q_PROPERTY(Qt::Orientation orientation READ orientation)
|
|
|
|
|
2022-09-05 17:29:42 +08:00
|
|
|
private:
|
|
|
|
SideTabBarPrivate* d; ///< private data (pimpl)
|
|
|
|
friend struct SideTabBarPrivate;
|
|
|
|
friend class DockWidgetSideTab;
|
|
|
|
|
2022-09-14 14:17:28 +08:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent* event) override;
|
2022-09-14 14:25:11 +08:00
|
|
|
|
2022-09-05 17:29:42 +08:00
|
|
|
public:
|
2022-10-26 15:50:16 +08:00
|
|
|
using Super = QFrame;
|
2022-09-05 17:29:42 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Default Constructor
|
|
|
|
*/
|
2022-10-26 15:50:16 +08:00
|
|
|
CSideTabBar(CDockContainerWidget* parent, CDockWidgetSideTab::SideTabBarArea area);
|
2022-09-05 17:29:42 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Virtual Destructor
|
|
|
|
*/
|
|
|
|
virtual ~CSideTabBar();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Inserts the given dock widget tab at the given position.
|
|
|
|
*/
|
|
|
|
void insertSideTab(int Index, CDockWidgetSideTab* SideTab);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes the given DockWidgetSideTab from the tabbar
|
|
|
|
*/
|
|
|
|
void removeSideTab(CDockWidgetSideTab* SideTab);
|
|
|
|
|
2022-09-14 14:25:11 +08:00
|
|
|
/**
|
|
|
|
* Returns orientation of side tab.
|
|
|
|
*/
|
|
|
|
Qt::Orientation orientation() const;
|
|
|
|
|
2022-09-14 17:39:57 +08:00
|
|
|
/*
|
|
|
|
* get the side tab widget at position, returns nullptr if it's out of bounds
|
|
|
|
*/
|
|
|
|
CDockWidgetSideTab* tabAt(int index) const;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Gets the count of the tab widgets
|
|
|
|
*/
|
|
|
|
int tabCount() const;
|
|
|
|
|
2022-10-26 15:50:16 +08:00
|
|
|
/**
|
|
|
|
* Getter for side tab bar area property
|
|
|
|
*/
|
|
|
|
CDockWidgetSideTab::SideTabBarArea sideTabBarArea() const;
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void sideTabAutoHideToggleRequested();
|
2022-09-05 17:29:42 +08:00
|
|
|
};
|
2022-10-26 21:40:35 +08:00
|
|
|
} // namespace ads
|
|
|
|
//-----------------------------------------------------------------------------
|
2022-09-05 17:29:42 +08:00
|
|
|
#endif
|