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
VSTPluginUI::get_preferred_height ()
{
int preferred_height = _vst->state()->height;
preferred_height += _vst->state()->voffset;
return preferred_height;
return _vst->state()->height + _vst->state()->voffset;
}
int
VSTPluginUI::get_preferred_width ()
{
return _vst->state()->width;
return _vst->state()->width + _vst->state()->hoffset;
}
int

View File

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

View File

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