Browse Source

Forgot a destructor; Make some functions inline

tags/v2.1-rc1
falkTX 4 years ago
parent
commit
9a1874745e
2 changed files with 33 additions and 31 deletions
  1. +2
    -28
      source/frontend/patchcanvas/theme.cpp
  2. +31
    -3
      source/frontend/patchcanvas/theme.hpp

+ 2
- 28
source/frontend/patchcanvas/theme.cpp View File

@@ -624,35 +624,9 @@ struct Theme::PrivateData {
Theme::Theme(const Theme::List idx)
: self(new PrivateData(idx)) {}

//---------------------------------------------------------------------------------------------------------------------

Theme::List getDefaultTheme()
{
return Theme::THEME_MODERN_DARK;
}

const char* getThemeName(const Theme::List idx)
{
switch (idx)
{
case Theme::THEME_MODERN_DARK:
return "Modern Dark";
case Theme::THEME_MODERN_DARK_TINY:
return "Modern Dark (Tiny)";
case Theme::THEME_MODERN_LIGHT:
return "Modern Light";
case Theme::THEME_CLASSIC_DARK:
return "Classic Dark";
case Theme::THEME_OOSTUDIO:
return "OpenOctave Studio";
default:
return "";
}
}

const char* getDefaultThemeName()
Theme::~Theme()
{
return "Modern Dark";
delete self;
}

//---------------------------------------------------------------------------------------------------------------------

+ 31
- 3
source/frontend/patchcanvas/theme.hpp View File

@@ -62,9 +62,37 @@ private:

//---------------------------------------------------------------------------------------------------------------------

Theme::List getDefaultTheme();
const char* getThemeName(Theme::List idx);
const char* getDefaultThemeName();
static inline
Theme::List getDefaultTheme()
{
return Theme::THEME_MODERN_DARK;
}

static inline
const char* getDefaultThemeName()
{
return "Modern Dark";
}

static inline
const char* getThemeName(const Theme::List idx)
{
switch (idx)
{
case Theme::THEME_MODERN_DARK:
return "Modern Dark";
case Theme::THEME_MODERN_DARK_TINY:
return "Modern Dark (Tiny)";
case Theme::THEME_MODERN_LIGHT:
return "Modern Light";
case Theme::THEME_CLASSIC_DARK:
return "Classic Dark";
case Theme::THEME_OOSTUDIO:
return "OpenOctave Studio";
default:
return "";
}
}

//---------------------------------------------------------------------------------------------------------------------



Loading…
Cancel
Save