Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Feb 27, 2024
1 parent 919f625 commit 7943e71
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ gen:
endif

jack: carla dgl
$(MAKE) $(CARLA_EXTRA_ARGS) $(ILDAEIL_FX_ARGS) -C plugins/Standalone
$(MAKE) $(CARLA_EXTRA_ARGS) $(DGL_EXTRA_ARGS) $(ILDAEIL_FX_ARGS) -C plugins/Standalone

# ---------------------------------------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion dpf
19 changes: 12 additions & 7 deletions plugins/Common/IldaeilUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,7 @@ class IldaeilUI : public UI,
fUpdateGeometryConstraints = true;
}

#if ILDAEIL_STANDALONE
#if DISTRHO_UI_USER_RESIZABLE
void onResize(const ResizeEvent& ev) override
{
UI::onResize(ev);
Expand All @@ -701,13 +701,18 @@ class IldaeilUI : public UI,
return;
if (fShowingHostWindow)
return;
if (fDrawingState != kDrawingPluginEmbedUI)
return;

if (fDrawingState == kDrawingPluginEmbedUI)
{
const uint extraHeight = kButtonHeight * getScaleFactor() + ImGui::GetStyle().WindowPadding.y * 2;

fPluginHostWindow.setSize(ev.size.getWidth(), ev.size.getHeight() - extraHeight);
}
const double scaleFactor = getScaleFactor();
const uint extraHeight = kButtonHeight * scaleFactor + ImGui::GetStyle().WindowPadding.y * 2;
uint width = ev.size.getWidth();
uint height = ev.size.getHeight() - extraHeight;
#ifdef DISTRHO_OS_MAC
width /= scaleFactor;
height /= scaleFactor;
#endif
fPluginHostWindow.setSize(width, height);
}
#endif

Expand Down
6 changes: 5 additions & 1 deletion plugins/Standalone/DistrhoPluginInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@
#define DISTRHO_PLUGIN_WANT_TIMEPOS 1
#define DISTRHO_PLUGIN_WANT_DIRECT_ACCESS 1
#define DISTRHO_UI_USE_CUSTOM 1
#define DISTRHO_UI_USER_RESIZABLE 1
#define DISTRHO_UI_CUSTOM_INCLUDE_PATH "DearImGui.hpp"
#define DISTRHO_UI_CUSTOM_WIDGET_TYPE DGL_NAMESPACE::ImGuiTopLevelWidget
#define DISTRHO_UI_DEFAULT_WIDTH kInitialWidth
#define DISTRHO_UI_DEFAULT_HEIGHT kInitialHeight

#define ILDAEIL_STANDALONE 1

#ifndef __APPLE__
// FIXME
#define DISTRHO_UI_USER_RESIZABLE 1
#endif

static constexpr const uint kInitialWidth = 640;
static constexpr const uint kInitialHeight = 480;

Expand Down

0 comments on commit 7943e71

Please sign in to comment.