API Documentation
Loading...
Searching...
No Matches
SectionIconTab.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: SectionIconTab
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/RibbonArea.h>
35#include <NDEVR/SectionTab.h>
36#include <QIcon>
37class QPushButton;
38class QLabel;
39class QPropertyAnimation;
40class QGraphicsOpacityEffect;
41class QFrame;
42namespace NDEVR
43{
44 class ImageView;
45 class Button;
46 class VerticalLabel;
47 class DockItem;
48 class QCustomLabel;
49 class TranslatedString;
50 /**--------------------------------------------------------------------------------------------------
51 \brief Provides a tab that contains an icon and some buttons used for either a tab if the section
52 content is attached to a Container, or as the drag bar if the content is floating.
53 **/
55 {
56 Q_OBJECT
57 Q_PROPERTY(QColor background_color READ backgroundColor WRITE setBackgroundColor)
58 public:
59 explicit SectionIconTab(SectionContent* content, DockItem* widget);
60 void init();
61 virtual ~SectionIconTab();
62 void setFlat(bool flat);
63 void setFloatingWidget(FloatingWidget* widget) override;
64 void setSelected(bool is_selected) override;
65 void paintEvent(QPaintEvent *) override;
66 void resizeEvent(QResizeEvent *event) override;
67 void setFullscreen(bool fullscreen) override;
68 QSize sizeHint() const override;
69 QSize minimumSizeHint() const override;
70 QIcon getIcon() const override;
72 virtual TranslatedString getTitle() const override;
73 void setBackgroundColor(QColor color);
74 void mouseDoubleClickEvent(QMouseEvent* e) override;
75 void setIconID(const String& icon);
76 bool isDocked() { return m_is_docked; }
77 void setDocked(bool is_docked) override { m_is_docked = is_docked; }
78 void setLocation(RibbonArea area, bool is_docked) override;
79 public slots:
80 void setIcon(const QIcon& icon);
81 void setTitle(const TranslatedString& title);
82 void contextMenu(const QPoint& point);
83 void onVisible(bool is_visible);
88 protected:
89 QPalette::ColorRole preferredColorRoll() const;
91 bool event(QEvent *event) override;
95 protected:
99 QPropertyAnimation* m_color_animation;
103 QGraphicsOpacityEffect* m_opacity_effect;
108 };
109}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
A core widget that allows the user to click one of many button types.
Definition Button.h:66
The root class that allows iterface with the NDEVR API Widget Docking system.
Definition DockItem.h:54
Used with the NDEVR API Widget Docking system for widgets that are floating. These widgets appear as ...
Definition FloatingWidget.h:49
A widget that shows a raster image or icon.
Definition ImageView.h:43
Displays translated text. No user interaction functionality is provided. The visual appearance of the...
Definition QCustomLabel.h:46
The core container for objects using the NDEVR API Widget Docking system. Contains information used t...
Definition SectionContent.h:51
Provides a tab that contains an icon and some buttons used for either a tab if the section content is...
Definition SectionIconTab.h:55
void onVisible(bool is_visible)
QSize minimumSizeHint() const override
void paintEvent(QPaintEvent *) override
void setDocked(bool is_docked) override
Definition SectionIconTab.h:77
QSize sizeHint() const override
QIcon getIcon() const override
ImageView * m_icon_label
Definition SectionIconTab.h:97
bool isDocked()
Definition SectionIconTab.h:76
void contextMenu(const QPoint &point)
void setTitle(const TranslatedString &title)
void setFullscreen(bool fullscreen) override
bool event(QEvent *event) override
void setIcon(const QIcon &icon)
bool m_is_hovering
Definition SectionIconTab.h:107
DockItem * m_widget
Definition SectionIconTab.h:96
QGraphicsOpacityEffect * m_opacity_effect
Definition SectionIconTab.h:103
void setFloatingWidget(FloatingWidget *widget) override
bool m_is_flat
Definition SectionIconTab.h:105
void setLocation(RibbonArea area, bool is_docked) override
Button * m_fullscreen_button
Definition SectionIconTab.h:101
void setSelected(bool is_selected) override
void setIconID(const String &icon)
void resizeEvent(QResizeEvent *event) override
bool m_is_docked
Definition SectionIconTab.h:104
void setBackgroundColor(QColor color)
void setFlat(bool flat)
RibbonArea m_ribbon_area
Definition SectionIconTab.h:102
SectionIconTab(SectionContent *content, DockItem *widget)
void mouseDoubleClickEvent(QMouseEvent *e) override
QPropertyAnimation * m_color_animation
Definition SectionIconTab.h:99
bool m_is_selected
Definition SectionIconTab.h:106
virtual TranslatedString getTitle() const override
QPalette::ColorRole preferredColorRoll() const
Button * m_close_button
Definition SectionIconTab.h:100
QCustomLabel * m_title_label
Definition SectionIconTab.h:98
Provides a tab that is used for either a tab if the section content is attached to a Container,...
Definition SectionTab.h:48
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13
Definition ACIColor.h:37
RibbonArea
Requests a ribbon or tab area to be in a certain location and orientation relative to another widget.
Definition RibbonArea.h:71