diff --git a/examples/Info/DistrhoPluginInfo.h b/examples/Info/DistrhoPluginInfo.h index 0305639b..d0c4583d 100644 --- a/examples/Info/DistrhoPluginInfo.h +++ b/examples/Info/DistrhoPluginInfo.h @@ -27,6 +27,8 @@ #define DISTRHO_PLUGIN_NUM_INPUTS 2 #define DISTRHO_PLUGIN_NUM_OUTPUTS 2 #define DISTRHO_PLUGIN_WANT_TIMEPOS 1 +#define DISTRHO_UI_DEFAULT_WIDTH 405 +#define DISTRHO_UI_DEFAULT_HEIGHT 256 #define DISTRHO_UI_FILE_BROWSER 0 #define DISTRHO_UI_USER_RESIZABLE 1 #define DISTRHO_UI_USE_NANOVG 1 diff --git a/examples/Info/InfoExampleUI.cpp b/examples/Info/InfoExampleUI.cpp index d0ef002c..24f37320 100644 --- a/examples/Info/InfoExampleUI.cpp +++ b/examples/Info/InfoExampleUI.cpp @@ -26,12 +26,9 @@ using DGL_NAMESPACE::ResizeHandle; class InfoExampleUI : public UI { - static const uint kInitialWidth = 405; - static const uint kInitialHeight = 256; - public: InfoExampleUI() - : UI(kInitialWidth, kInitialHeight), + : UI(DISTRHO_UI_DEFAULT_WIDTH, DISTRHO_UI_DEFAULT_HEIGHT), fSampleRate(getSampleRate()), fResizable(isResizable()), fScale(1.0f), @@ -47,7 +44,7 @@ public: loadSharedResources(); #endif - setGeometryConstraints(kInitialWidth, kInitialHeight, true); + setGeometryConstraints(DISTRHO_UI_DEFAULT_WIDTH, DISTRHO_UI_DEFAULT_HEIGHT, true); // no need to show resize handle if window is user-resizable if (fResizable) @@ -192,7 +189,7 @@ protected: void onResize(const ResizeEvent& ev) override { - fScale = static_cast(ev.size.getHeight())/static_cast(kInitialHeight); + fScale = static_cast(ev.size.getHeight())/static_cast(DISTRHO_UI_DEFAULT_HEIGHT); UI::onResize(ev); }