From 9a1874745e699284a8f1f3248690a2a1d7161591 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 25 Dec 2019 14:58:35 +0000 Subject: [PATCH] Forgot a destructor; Make some functions inline --- source/frontend/patchcanvas/theme.cpp | 30 ++--------------------- source/frontend/patchcanvas/theme.hpp | 34 ++++++++++++++++++++++++--- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/source/frontend/patchcanvas/theme.cpp b/source/frontend/patchcanvas/theme.cpp index bfb0be8ff..2c6519bf0 100644 --- a/source/frontend/patchcanvas/theme.cpp +++ b/source/frontend/patchcanvas/theme.cpp @@ -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; } //--------------------------------------------------------------------------------------------------------------------- diff --git a/source/frontend/patchcanvas/theme.hpp b/source/frontend/patchcanvas/theme.hpp index deee63051..e53aff390 100644 --- a/source/frontend/patchcanvas/theme.hpp +++ b/source/frontend/patchcanvas/theme.hpp @@ -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 ""; + } +} //---------------------------------------------------------------------------------------------------------------------