API Documentation
Loading...
Searching...
No Matches
SectionWidgetTabsScrollArea.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: SectionWidgetTabsScrollArea
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/RibbonArea.h>
35#include <NDEVR/Buffer.h>
36#include <QWidget>
37class QScrollArea;
38class QFrame;
39class QBoxLayout;
40class QSpacerItem;
41namespace NDEVR
42{
43 class SelectionHighlightBar;
44 class ScrollEdge;
45 /* Custom scrollable implementation for tabs */
47 {
48 Q_OBJECT
49 public:
50 SectionWidgetTabsScrollArea(QWidget* parent = nullptr);
52 QSize sizeHint() const override;
53 QSize minimumSizeHint() const override;
54 QWidget* tabsContainer() const { return m_tabs_container_widget; }
55 void removeMainWidget(bool animate);
56 void insertMainWidget(uint04 index, QWidget* widget, bool animate);
57 void insertTabWidget(uint04 index, QWidget* widget);
58 void removeTabWidget(QWidget* widget);
59 bool hasTabWidget(QWidget* widget);
60 void setWidgetSelected(QWidget* widget);
61 void resizeEvent(QResizeEvent* event) override;
62 QScrollArea* scrollArea() { return m_scroll_area; }
63 void setArea(RibbonArea area);
64 RibbonArea area() const { return m_ribbon_area; }
65 uint04 indexOf(QWidget* widget) const;
66 uint04 count() const;
67 QWidget* widget(uint04 index);
68 void swap(uint04 a, uint04 b);
69 void move(uint04 from, uint04 to);
70 bool isAtBottom() const;
71 bool isAtTop() const;
72 bool isVertical() const;
73 bool isRelativeVertical() const;
74 bool isTextVertical() const;
75 void jumpToBottom();
76 void setAutoExpand(bool auto_expand);
77 void paintEvent(QPaintEvent* event) override;
78 void updateSeperatorSizes();
79 void showEvent(QShowEvent*) override;
80 bool event(QEvent* event) override;
81 QWidget* mainWidget() const;
82 signals:
84 protected:
85 QSize scrollSizeHint() const;
86 void setupSeperator(QFrame* line);
87 QBoxLayout* tabsLayout() { return m_tabs_layout; }
88 void resetScroller();
89 void recalculateScrollerSnaps();
90 void updateSelectionWidgetHighlight();
91 void updateEdgeLocations();
92 void updateSizePolicy();
93 protected:
94 virtual void wheelEvent(QWheelEvent*) override;
95 QScrollArea* m_scroll_area;
97 QBoxLayout* m_tabs_layout;
102 QSpacerItem* m_spacer_item;
105 QWidget* m_main_widget = nullptr;
112 bool m_is_bottom = false;
114 bool m_auto_expand = false;
116 uint04 m_main_widget_location = Constant<uint04>::NaN;
117 };
118}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:64
Definition SectionWidgetTabsScrollArea.cpp:18
Definition SectionWidgetTabsScrollArea.h:47
RibbonArea area() const
Definition SectionWidgetTabsScrollArea.h:64
Buffer< QFrame * > m_seperators
Definition SectionWidgetTabsScrollArea.h:103
QSpacerItem * m_spacer_item
Definition SectionWidgetTabsScrollArea.h:102
QWidget * m_tabs_container_widget
Definition SectionWidgetTabsScrollArea.h:96
bool m_auto_scroll_to_bottom
Definition SectionWidgetTabsScrollArea.h:113
QWidget * m_float_widget
Definition SectionWidgetTabsScrollArea.h:100
ScrollEdge * m_bottom_edge
Definition SectionWidgetTabsScrollArea.h:110
QBoxLayout * tabsLayout()
Definition SectionWidgetTabsScrollArea.h:87
QScrollArea * m_scroll_area
Definition SectionWidgetTabsScrollArea.h:95
SelectionHighlightBar * m_highlight_bar
Definition SectionWidgetTabsScrollArea.h:106
QScrollArea * scrollArea()
Definition SectionWidgetTabsScrollArea.h:62
uint04 m_update_count
Definition SectionWidgetTabsScrollArea.h:115
QWidget * tabsContainer() const
Definition SectionWidgetTabsScrollArea.h:54
QBoxLayout * m_tabs_layout
Definition SectionWidgetTabsScrollArea.h:97
RibbonArea m_ribbon_area
Definition SectionWidgetTabsScrollArea.h:107
QWidget * m_inner_scroll
Definition SectionWidgetTabsScrollArea.h:98
QTimer * m_bounds_updater
Definition SectionWidgetTabsScrollArea.h:108
Buffer< QWidget * > m_widgets
Definition SectionWidgetTabsScrollArea.h:104
QWidget * m_selected_widget
Definition SectionWidgetTabsScrollArea.h:99
bool m_is_shown
Definition SectionWidgetTabsScrollArea.h:111
ScrollEdge * m_top_edge
Definition SectionWidgetTabsScrollArea.h:109
QBoxLayout * m_inner_scroll_layout
Definition SectionWidgetTabsScrollArea.h:101
Definition SelectionHighlightBar.h:44
Definition ACIColor.h:37
RibbonArea
Definition RibbonArea.h:68
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120
Definition BaseValues.hpp:272