MeshLib C++ Docs
Loading...
Searching...
No Matches

#include <MRViewer/MRColorTheme.h>

Public Types

enum class  Preset { Preset::Dark , Preset::Default = Dark , Preset::Light , Preset::Count }
enum class  Type { Type::Default , Type::User }
enum class  RibbonColorsType {
  RibbonColorsType::Background , RibbonColorsType::BackgroundSecStyle , RibbonColorsType::HeaderBackground , RibbonColorsType::HeaderSeparator ,
  RibbonColorsType::TopPanelBackground , RibbonColorsType::TopPanelSearchBackground , RibbonColorsType::QuickAccessBackground , RibbonColorsType::Borders ,
  RibbonColorsType::TabHovered , RibbonColorsType::TabClicked , RibbonColorsType::TabActive , RibbonColorsType::TabActiveHovered ,
  RibbonColorsType::TabActiveClicked , RibbonColorsType::TabText , RibbonColorsType::TabActiveText , RibbonColorsType::DialogTab ,
  RibbonColorsType::DialogTabHovered , RibbonColorsType::DialogTabActive , RibbonColorsType::DialogTabActiveHovered , RibbonColorsType::DialogTabText ,
  RibbonColorsType::DialogTabActiveText , RibbonColorsType::ToolbarHovered , RibbonColorsType::ToolbarClicked , RibbonColorsType::ModalBackground ,
  RibbonColorsType::Text , RibbonColorsType::TextEnabled , RibbonColorsType::TextDisabled , RibbonColorsType::TextSelectedBg ,
  RibbonColorsType::RibbonButtonHovered , RibbonColorsType::RibbonButtonClicked , RibbonColorsType::RibbonButtonActive , RibbonColorsType::RibbonButtonActiveHovered ,
  RibbonColorsType::RibbonButtonActiveClicked , RibbonColorsType::ThirdpartyBackground , RibbonColorsType::ProgressBarBackground , RibbonColorsType::FrameBackground ,
  RibbonColorsType::CollapseHeaderBackground , RibbonColorsType::SelectedObjectText , RibbonColorsType::SelectedObjectFrame , RibbonColorsType::GradientStart ,
  RibbonColorsType::GradientEnd , RibbonColorsType::TextContrastBackground , RibbonColorsType::GradBtnStart , RibbonColorsType::GradBtnHoverStart ,
  RibbonColorsType::GradBtnActiveStart , RibbonColorsType::GradBtnDisableStart , RibbonColorsType::GradBtnEnd , RibbonColorsType::GradBtnHoverEnd ,
  RibbonColorsType::GradBtnActiveEnd , RibbonColorsType::GradBtnDisableEnd , RibbonColorsType::GradBtnText , RibbonColorsType::GradBtnSecStyleStart ,
  RibbonColorsType::GradBtnSecStyleHoverStart , RibbonColorsType::GradBtnSecStyleActiveStart , RibbonColorsType::GradBtnSecStyleEnd , RibbonColorsType::GradBtnSecStyleHoverEnd ,
  RibbonColorsType::GradBtnSecStyleActiveEnd , RibbonColorsType::Grid , RibbonColorsType::Count
}
 Color types used in ribbon. More...
enum class  ViewportColorsType {
  ViewportColorsType::Background , ViewportColorsType::Borders , ViewportColorsType::AxisX , ViewportColorsType::AxisY ,
  ViewportColorsType::AxisZ , ViewportColorsType::Count
}

Static Public Member Functions

static ColorThemeinstance ()
static Preset getPreset ()
static const char * getPresetName (Preset type)
static Type getThemeType ()
static const std::string & getThemeName ()
static void setupByTypeName (Type type, const std::string &name)
 Setup this struct.
static void setupDefaultDark ()
static void setupDefaultLight ()
static void setupUserTheme (const std::string &themeName)
static void setupFromFile (const std::filesystem::path &path, Type type=Type::User)
 Setup this struct from serialized color-theme file.
static void setupFromJson (const Json::Value &value, Type type=Type::User)
 Setup this struct from Json value.
static void serializeCurrentToFile (const std::filesystem::path &path)
static void serializeCurrentToJson (Json::Value &root)
static bool isInitialized ()
 True if this structure is filled with colors, false if empty.
static void setRibbonColor (const Color &color, RibbonColorsType type)
 Getter and setter for ribbon colors.
static const ColorgetRibbonColor (RibbonColorsType type)
static const char * getRibbonColorTypeName (RibbonColorsType type)
static void setViewportColor (const Color &color, ViewportColorsType type)
 Getter and setter for viewport colors.
static const ColorgetViewportColor (ViewportColorsType type)
static const char * getViewportColorTypeName (ViewportColorsType type)
static std::filesystem::path getUserThemesDirectory ()
 Returns directory where user's custom themes are stored.
static void updateUserThemesList ()
 Find available custom themes.
static std::vector< std::string > foundUserThemes ()
 Return list of found custom themes.
static void resetImGuiStyle ()
 Reset ImGui style sizes and colors, and apply menu scaling to it.
static boost::signals2::connection onChanged (const std::function< void()> &slot, boost::signals2::connect_position position=boost::signals2::at_back)
 Connects given slot to receive signal on every Color Theme change, triggered in apply.

Detailed Description

This singleton is born to manage color-themes loading and saving, and apply it to app It can handle scene colors (default mesh colors, etc.) and Dear ImGui colors


The documentation for this class was generated from the following file: