From 95188b14f57c97b6388dbb0f6efdf081f8b943a1 Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Tue, 13 Apr 2021 22:12:24 +0200 Subject: [PATCH] Make fonts consistent on knobs and labels --- plugins/editor/layout/main.fl | 8 ++++---- plugins/editor/src/editor/Editor.cpp | 7 ++++++- plugins/editor/src/editor/layout/main.hpp | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/plugins/editor/layout/main.fl b/plugins/editor/layout/main.fl index 0429d773..da053746 100644 --- a/plugins/editor/layout/main.fl +++ b/plugins/editor/layout/main.fl @@ -212,7 +212,7 @@ widget_class mainView {open } } } - Fl_Group {subPanels_[kPanelControls]} { + Fl_Group {subPanels_[kPanelControls]} {open xywh {5 110 790 285} hide class LogicalGroup } { @@ -220,8 +220,8 @@ widget_class mainView {open xywh {5 110 790 285} box ROUNDED_BOX class RoundedGroup } { - Fl_Group controlsPanel_ {open - xywh {5 110 790 285} box THIN_DOWN_FRAME + Fl_Group controlsPanel_ {selected + xywh {5 110 790 285} box THIN_DOWN_FRAME labelsize 12 class ControlsPanel } {} } @@ -351,7 +351,7 @@ widget_class mainView {open class ValueLabel } Fl_Spinner oscillatorQualitySlider_ { - comment {tag=kTagSetOscillatorQuality} selected + comment {tag=kTagSetOscillatorQuality} xywh {630 195 80 25} labelsize 12 textsize 12 class ValueMenu } diff --git a/plugins/editor/src/editor/Editor.cpp b/plugins/editor/src/editor/Editor.cpp index f5b76c99..7e55c6b4 100644 --- a/plugins/editor/src/editor/Editor.cpp +++ b/plugins/editor/src/editor/Editor.cpp @@ -876,6 +876,7 @@ void Editor::Impl::createFrameContents() box->setNameLabelFont(font); box->setKnobFont(font); box->setCCLabelText(label); + box->setCCLabelFont(font); OnThemeChanged.push_back([box, palette]() { box->setNameLabelFontColor(palette->knobText); box->setCCLabelFontColor(palette->knobLabelText); @@ -896,8 +897,12 @@ void Editor::Impl::createFrameContents() container->setBackground(background); return container; }; - auto createControlsPanel = [this, &palette](const CRect& bounds, int, const char*, CHoriTxtAlign, int) { + auto createControlsPanel = [this, &palette](const CRect& bounds, int, const char*, CHoriTxtAlign, int fontsize) { auto* panel = new SControlsPanel(bounds); + auto font = makeOwned("Roboto", fontsize); + panel->setNameLabelFont(font); + panel->setKnobFont(font); + panel->setCCLabelFont(font); OnThemeChanged.push_back([panel, palette]() { panel->setNameLabelFontColor(palette->knobText); panel->setCCLabelFontColor(palette->knobLabelText); diff --git a/plugins/editor/src/editor/layout/main.hpp b/plugins/editor/src/editor/layout/main.hpp index ea9dfa3f..3e75eb92 100644 --- a/plugins/editor/src/editor/layout/main.hpp +++ b/plugins/editor/src/editor/layout/main.hpp @@ -115,7 +115,7 @@ view__0->addView(view__43); view__43->setVisible(false); auto* const view__44 = createRoundedGroup(CRect(0, 0, 790, 285), -1, "", kCenterText, 14); view__43->addView(view__44); -auto* const view__45 = createControlsPanel(CRect(0, 0, 790, 285), -1, "", kCenterText, 14); +auto* const view__45 = createControlsPanel(CRect(0, 0, 790, 285), -1, "", kCenterText, 12); controlsPanel_ = view__45; view__44->addView(view__45); auto* const view__46 = createLogicalGroup(CRect(5, 109, 795, 425), -1, "", kCenterText, 14);