Skip to content

Commit

Permalink
Reset Indents on SkinChange
Browse files Browse the repository at this point in the history
We need to reset the indents on the typeahead on skin
change since it can change the font; but also since these
are set before the font change if we don't so you get a very-first-time
mis-indent setting as described in surge-synthesizer#5574

Closes surge-synthesizer#5574
  • Loading branch information
baconpaul committed Dec 6, 2021
1 parent 28d1054 commit 937f10b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/surge-xt/gui/widgets/PatchSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ void PatchSelector::onSkinChanged()
typeAhead->setColour(juce::TextEditor::backgroundColourId, transBlack);
typeAhead->setColour(juce::TextEditor::focusedOutlineColourId, transBlack);
typeAhead->setFont(Surge::GUI::getFontManager()->patchNameFont);
typeAhead->setIndents(4, (typeAhead->getHeight() - typeAhead->getTextHeight()) / 2);

typeAhead->setColour(juce::TextEditor::textColourId,
skin->getColor(Colors::Dialog::Entry::Text));
Expand Down Expand Up @@ -947,8 +948,8 @@ void PatchSelector::toggleTypeAheadSearch(bool b)
std::to_string(storage->patchDB->numberOfJobsOutstanding()) + " items left";
}
typeAhead->setJustification(juce::Justification::centred);
typeAhead->setText(txt, juce::NotificationType::dontSendNotification);
typeAhead->setIndents(4, (typeAhead->getHeight() - typeAhead->getTextHeight()) / 2);
typeAhead->setText(txt, juce::NotificationType::dontSendNotification);

if (!typeAhead->isVisible() && sge)
sge->vkbForward++;
Expand Down

0 comments on commit 937f10b

Please sign in to comment.