/*
The text box widget was contributed by Christian Schueller.
NanoGUI was developed by Wenzel Jakob <wenzel.jakob@epfl.ch>.
The widget drawing code is based on the NanoVG demo application
by Mikko Mononen.
All rights reserved. Use of this source code is governed by a
BSD-style license that can be found in the LICENSE.txt file.
*/
#pragma once
#include <nanogui/common.h>
#include <nanogui/object.h>
NAMESPACE_BEGIN(nanogui)
class NANOGUI_EXPORT Theme : public Object {
public:
Theme(NVGcontext *ctx);
/* Fonts */
struct NANOGUI_EXPORT GlobalDefaultFonts {
GlobalDefaultFonts() = delete;
GlobalDefaultFonts(const GlobalDefaultFonts &other) = delete;
GlobalDefaultFonts(const GlobalDefaultFonts &&other) = delete;
static constexpr auto Normal = "sans";
static constexpr auto Bold = "sans-bold";
static constexpr auto Mono = "mono";
static constexpr auto MonoBold = "mono-bold";
static constexpr auto Icons = "icons";
};
std::string mDefaultFont;
std::string mDefaultBoldFont;
std::string mDefaultMonoFont;
std::string mDefaultMonoBoldFont;
std::string mDefaultIconFont;
int mFontNormal;
int mFontBold;
int mFontMonoNormal;
int mFontMonoBold;
int mFontIcons;
float mIconScale;
/* Spacing-related parameters */
float mStandardFontSize;
float mButtonFontSize;
float mTextBoxFontSize;
float mWindowFontSize;
int mWindowCornerRadius;
int mWindowHeaderHeight;
int mWindowDropShadowSize;
int mButtonCornerRadius;
float mTabBorderWidth;
int mTabInnerMargin;
int mTabMinButtonWidth;
int mTabMaxButtonWidth;
int mTabControlWidth;
int mTabButtonHorizontalPadding;
int mTabButtonVerticalPadding;
/* Generic colors */
Color mDropShadow;
Color mTransparent;
Color mBorderDark;
Color mBorderLight;
Color mBorderMedium;
Color mTextColor;
Color mDisabledTextColor;
Color mTextColorShadow;
Color mIconColor;
/* Button colors */
Color mButtonGradientTopFocused;
Color mButtonGradientBotFocused;
Color mButtonGradientTopUnfocused;
Color mButtonGradientBotUnfocused;
Color mButtonGradientTopPushed;
Color mButtonGradientBotPushed;
float mTooltipOpacity;
Color mTooltipBackgroundColor;
Color mTooltipTextColor;
/* Window colors */
Color mWindowFillUnfocused;
Color mWindowFillFocused;
Color mWindowTitleUnfocused;
Color mWindowTitleFocused;
Color mWindowHeaderGradientTop;
Color mWindowHeaderGradientBot;
Color mWindowHeaderSepTop;
Color mWindowHeaderSepBot;
Color mWindowPopup;
Color mWindowPopupTransparent;
int mCheckBoxIcon;
static float defaultCheckBoxIconExtraScale() { return 1.2f; }
float mCheckBoxIconExtraScale;
int mMessageInformationIcon;
int mMessageQuestionIcon;
int mMessageWarningIcon;
int mMessageAltButtonIcon;
int mMessagePrimaryButtonIcon;
int mPopupChevronRightIcon;
int mPopupChevronLeftIcon;
static float defaultPopupIconExtraScale() { return 0.8f; }
float mPopupIconExtraScale;
int mTabHeaderLeftIcon;
int mTabHeaderRightIcon;
int mTextBoxUpIcon;
int mTextBoxDownIcon;
static float defaultTextBoxIconExtraScale() { return 0.8f; }
float mTextBoxIconExtraScale;
protected:
virtual ~Theme() { };
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
NAMESPACE_END(nanogui)