Merge pull request #520 from jpcima/editor-problems

Editor problems
This commit is contained in:
JP Cimalando 2020-10-23 12:18:45 +02:00 committed by GitHub
commit b04f6a73b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View file

@ -194,11 +194,11 @@ else()
endif()
if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
target_compile_definitions(sfizz-vstgui PRIVATE "DEVELOPMENT")
target_compile_definitions(sfizz-vstgui PUBLIC "DEVELOPMENT")
endif()
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
target_compile_definitions(sfizz-vstgui PRIVATE "RELEASE")
target_compile_definitions(sfizz-vstgui PUBLIC "RELEASE")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")

View file

@ -423,7 +423,7 @@ void Editor::Impl::createFrameContents()
box->setBackgroundColor(theme->boxBackground);
box->setTitleFontColor(theme->titleBoxText);
box->setTitleBackgroundColor(theme->titleBoxBackground);
auto font = owned(new CFontDesc("Roboto", fontsize));
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
box->setTitleFont(font);
return box;
};
@ -436,7 +436,7 @@ void Editor::Impl::createFrameContents()
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFontColor(theme->text);
lbl->setHoriAlign(align);
auto font = owned(new CFontDesc("Roboto", fontsize));
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFont(font);
return lbl;
};
@ -463,7 +463,7 @@ void Editor::Impl::createFrameContents()
lbl->setBackColor(CColor(0x00, 0x00, 0x00, 0x00));
lbl->setFontColor(theme->text);
lbl->setHoriAlign(align);
auto font = owned(new CFontDesc("Roboto", fontsize));
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
lbl->setFont(font);
return lbl;
};
@ -476,7 +476,7 @@ void Editor::Impl::createFrameContents()
#if 0
auto createButton = [this](const CRect& bounds, int tag, const char* label, CHoriTxtAlign align, int fontsize) {
CTextButton* button = new CTextButton(bounds, this, tag, label);
auto font = owned(new CFontDesc("Roboto", fontsize));
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
button->setFont(font);
button->setTextAlignment(align);
return button;
@ -484,7 +484,7 @@ void Editor::Impl::createFrameContents()
#endif
auto createClickableLabel = [this, &theme](const CRect& bounds, int tag, const char* label, CHoriTxtAlign align, int fontsize) {
STextButton* button = new STextButton(bounds, this, tag, label);
auto font = owned(new CFontDesc("Roboto", fontsize));
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
button->setFont(font);
button->setTextAlignment(align);
button->setTextColor(theme->text);
@ -499,7 +499,7 @@ void Editor::Impl::createFrameContents()
};
auto createValueButton = [this, &theme](const CRect& bounds, int tag, const char* label, CHoriTxtAlign align, int fontsize) {
STextButton* button = new STextButton(bounds, this, tag, label);
auto font = owned(new CFontDesc("Roboto", fontsize));
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
button->setFont(font);
button->setTextAlignment(align);
button->setTextColor(theme->valueText);
@ -515,7 +515,7 @@ void Editor::Impl::createFrameContents()
auto createValueMenu = [this, &theme](const CRect& bounds, int tag, const char*, CHoriTxtAlign align, int fontsize) {
SValueMenu* vm = new SValueMenu(bounds, this, tag);
vm->setHoriAlign(align);
auto font = owned(new CFontDesc("Roboto", fontsize));
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
vm->setFont(font);
vm->setFontColor(theme->valueText);
vm->setBackColor(theme->valueBackground);
@ -526,7 +526,7 @@ void Editor::Impl::createFrameContents()
};
auto createGlyphButton = [this, &theme](UTF8StringPtr glyph, const CRect& bounds, int tag, int fontsize) {
STextButton* btn = new STextButton(bounds, this, tag, glyph);
btn->setFont(new CFontDesc("Sfizz Fluent System R20", fontsize));
btn->setFont(makeOwned<CFontDesc>("Sfizz Fluent System R20", fontsize));
btn->setTextColor(theme->icon);
btn->setHoverColor(theme->iconHighlight);
btn->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));
@ -559,14 +559,14 @@ void Editor::Impl::createFrameContents()
};
auto createPiano = [](const CRect& bounds, int, const char*, CHoriTxtAlign, int fontsize) {
SPiano* piano = new SPiano(bounds);
auto font = owned(new CFontDesc("Roboto", fontsize));
auto font = makeOwned<CFontDesc>("Roboto", fontsize);
piano->setFont(font);
return piano;
};
auto createChevronDropDown = [this, &theme](const CRect& bounds, int, const char*, CHoriTxtAlign, int fontsize) {
SActionMenu* menu = new SActionMenu(bounds, this);
menu->setTitle(u8"\ue0d7");
menu->setFont(new CFontDesc("Sfizz Fluent System R20", fontsize));
menu->setFont(makeOwned<CFontDesc>("Sfizz Fluent System R20", fontsize));
menu->setFontColor(theme->icon);
menu->setHoverColor(theme->iconHighlight);
menu->setFrameColor(CColor(0x00, 0x00, 0x00, 0x00));

View file

@ -92,7 +92,7 @@ void SPiano::draw(CDrawContext* dc)
CRect textRect(
rect.left, dim.labelBounds.top,
rect.right, dim.labelBounds.bottom);
dc->setFont(font_);
dc->setFont(font);
dc->setFontColor(labelStroke_);
std::string text = std::to_string(static_cast<int>(o) - 1);
dc->drawString(text.c_str(), textRect, kCenterText);