⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (945 Bytes)
Feature #13788
» ThemeToggleButton.hpp
Christian Meyer
, 07/02/2025 12:09 AM
#ifndef _THEME_TOGGLE_BUTTON_H_
#define _THEME_TOGGLE_BUTTON_H_
#include
<Wt/WPushButton.h>
#include
<Wt/WPopupMenu.h>
#include
<Wt/WMenuItem.h>
#include
<Wt/WJavaScriptSlot.h>
#include
<Wt/WJavaScript.h>
#include
<Wt/WString.h>
#include
<string>
namespace
Bootstrap5
{
namespace
Theme
{
const
std
::
string
Auto
=
"auto"
;
const
std
::
string
Light
=
"light"
;
const
std
::
string
Dark
=
"dark"
;
};
class
ThemeToggleButton
:
public
Wt
::
WPushButton
{
public:
ThemeToggleButton
();
~
ThemeToggleButton
()
=
default
;
// for now this only notifies with manual Selection
Wt
::
Signal
<
std
::
string
>&
themeChanged
()
{
return
s_themeChanged
;
}
private
:
void
prepareContent
();
void
setupConnections
();
private
:
Wt
::
WPopupMenu
*
popMenu
;
Wt
::
JSlot
themeSelect
;
Wt
::
JSignal
<
std
::
string
>
selected
;
Wt
::
Signal
<
std
::
string
>
s_themeChanged
;
};
}
// end namespace Bootstrap5
#endif // _THEME_TOGGLE_BUTTON_H_
« Previous
1
2
Next »
(2-2/2)
Loading...