NDEVR
API Documentation
ThemeButton.h
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: NDEVR
28File: ThemeButton
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include <NDEVR/NDEVRProxyStyle.h>
34#include <NDEVR/Button.h>
35#include <NDEVR/WidgetOptions.h>
36namespace NDEVR
37{
38 class WindowManager;
39 class NDEVRProxyStyle;
44 class ColorThemeButton : public QObject
45 {
46 Q_OBJECT
47 public:
53 ColorThemeButton(Button* button, bool use_big_icons = false);
58 void setMakeUpper(bool make_upper);
73 protected slots:
82 protected:
86 bool m_make_upper = false;
87 };
88
92 class TouchDesktopThemeButton : public QObject
93 {
94 Q_OBJECT
95 public:
106 void setUseLargeIcons(bool use_large_icons);
115 void invert(bool is_inverted = true);
121 protected:
125 bool m_use_large_icons = false;
126 bool m_invert = false;
127 };
128}
A core widget that allows the user to click one of many button types.
Definition Button.h:68
void setMakeUpper(bool make_upper)
Sets whether the button label text should be uppercased.
bool m_use_big_icons
Whether to use large icon variants.
Definition ThemeButton.h:85
void setConstantTheme(NDEVRLightingTheme theme)
Locks the button to always display a specific theme.
NDEVRLightingTheme clickedTarget() const
Returns the theme that will be activated when the button is clicked.
bool m_make_upper
Whether to uppercase the button label.
Definition ThemeButton.h:86
void styleDestroyed()
Slot invoked when the proxy style is destroyed, to clean up connections.
Button * m_button
The button widget this theme button controls.
Definition ThemeButton.h:84
NDEVRLightingTheme m_constant_theme
The locked theme, or e_num_of_themes if not locked.
Definition ThemeButton.h:83
void themeChangedSlot()
Slot invoked when the application theme changes to update the button appearance.
void clearConstantTheme()
Clears any locked constant theme, restoring normal toggle behavior.
ColorThemeButton(Button *button, bool use_big_icons=false)
Constructs a color theme button attached to an existing Button widget.
Responsible for setting up the core style of the application including size of various widgets and co...
Definition NDEVRTheme.h:95
void setUseLargeIcons(bool use_large_icons)
Sets whether to use large icon variants on the button.
Button * m_button
The button widget this toggle controls.
WidgetOptions::WidgetMode themeTarget() const
Returns the widget mode that will be activated when the button is clicked.
WindowManager * m_manager
The window manager providing mode context.
void themeChanged()
Updates the button appearance to reflect the current widget mode.
WidgetOptions::WidgetMode m_constant_theme
The locked mode, or e_size if not locked.
TouchDesktopThemeButton(WindowManager *manager, Button *button)
Constructs a touch/desktop mode toggle button.
bool m_invert
Whether the toggle behavior is inverted.
bool m_use_large_icons
Whether to use large icon variants.
void invert(bool is_inverted=true)
Inverts the button behavior so it shows the opposite mode.
WidgetMode
The UI layout mode, determining size and workflow optimizations.
@ e_size
The number of widget modes; used for sizing arrays.
Manages all windows and logic surrounding dialogs and views for displaying and managing any environme...
The primary namespace for the NDEVR SDK.
NDEVRLightingTheme
Enumerates the available UI color themes.
Definition NDEVRTheme.h:46
@ e_num_of_themes
The total number of available themes.
Definition NDEVRTheme.h:49