API Documentation
Loading...
Searching...
No Matches
SelectionHighlightBar.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: SelectionHighlightBar
29Included in API: False
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/WidgetOptions.h>
34#include <NDEVR/Bounds.h>
35#include <NDEVR/VectorFunctions.h>
36#include <QPainter>
37#include <QApplication>
38#include <QStylePainter>
39#include <QPropertyAnimation>
40#include <QWidget>
41namespace NDEVR
42{
43 /**--------------------------------------------------------------------------------------------------
44 \brief Provides a highlighted animation for selecting docked tabs using the NDEVR API Widget
45 Docking system.
46 **/
47 class SelectionHighlightBar : public QWidget
48 {
49 Q_OBJECT
51 public:
52 SelectionHighlightBar(QWidget* parent = nullptr);
53 double animationPercent() const;
55 void moveHighlight(QWidget* widget);
56 void moveHighlight(const Bounds<1, int>& bounds);
57 void setVertical(bool vertical);
59 QSize sizeHint() const override;
60 protected:
61 void paintEvent(QPaintEvent*) override;
62 private:
63 void startAnimation();
64 private:
65 QPropertyAnimation* m_move_animation;
66 Bounds<1, int> m_old_draw_bounds;
67 Bounds<1, int> m_draw_bounds;
68 enum QEasingCurve::Type m_animation_type;
69 bool m_is_vertical;
70 int m_speed;
71 double m_animation_percent;
72 };
73}
74
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
Provides a highlighted animation for selecting docked tabs using the NDEVR API Widget Docking system.
Definition SelectionHighlightBar.h:48
void setAnimationPercent(double animation_percent)
void paintEvent(QPaintEvent *) override
double animation_percent
Definition SelectionHighlightBar.h:50
QSize sizeHint() const override
void moveHighlight(QWidget *widget)
double animationPercent() const
SelectionHighlightBar(QWidget *parent=nullptr)
void moveHighlight(const Bounds< 1, int > &bounds)
Bounds< 1, int > currentBounds() const
void setVertical(bool vertical)
Definition ACIColor.h:37