13
0

fix minimum VST GUI window size (gtk padding)

This commit is contained in:
Robin Gareus 2014-02-22 02:30:57 +01:00
parent dfdf9a35f1
commit 8843679e1f
3 changed files with 7 additions and 6 deletions

View File

@ -61,15 +61,13 @@ VSTPluginUI::preset_selected ()
int int
VSTPluginUI::get_preferred_height () VSTPluginUI::get_preferred_height ()
{ {
int preferred_height = _vst->state()->height; return _vst->state()->height + _vst->state()->voffset;
preferred_height += _vst->state()->voffset;
return preferred_height;
} }
int int
VSTPluginUI::get_preferred_width () VSTPluginUI::get_preferred_width ()
{ {
return _vst->state()->width; return _vst->state()->width + _vst->state()->hoffset;
} }
int int

View File

@ -97,6 +97,7 @@ struct LIBARDOUR_API _VSTState
int wantIdle; int wantIdle;
int voffset; int voffset;
int hoffset;
int gui_shown; int gui_shown;
int destroy; int destroy;
int vst_version; int vst_version;

View File

@ -224,8 +224,10 @@ fst_new (void)
fst->has_editor = 0; fst->has_editor = 0;
#ifdef PLATFORM_WINDOWS #ifdef PLATFORM_WINDOWS
fst->voffset = 36; fst->voffset = 36;
fst->hoffset = 0;
#else /* linux + wine */ #else /* linux + wine */
fst->voffset = 24; fst->voffset = 24;
fst->hoffset = 6;
#endif #endif
fst->program_set_without_editor = 0; fst->program_set_without_editor = 0;
return fst; return fst;
@ -463,9 +465,9 @@ fst_move_window_into_view (VSTState* fst)
{ {
if (fst->windows_window) { if (fst->windows_window) {
#ifdef PLATFORM_WINDOWS #ifdef PLATFORM_WINDOWS
SetWindowPos ((HWND)(fst->windows_window), 0, 0, fst->voffset, fst->width, fst->height, 0); SetWindowPos ((HWND)(fst->windows_window), 0, fst->hoffset, fst->voffset, fst->width, fst->height, 0);
#else /* linux + wine */ #else /* linux + wine */
SetWindowPos ((HWND)(fst->windows_window), 0, 0, 0, fst->width, fst->height, 0); SetWindowPos ((HWND)(fst->windows_window), 0, 0, 0, fst->width + fst->hoffset, fst->height + fst->voffset, 0);
#endif #endif
ShowWindow ((HWND)(fst->windows_window), SW_SHOWNA); ShowWindow ((HWND)(fst->windows_window), SW_SHOWNA);
} }