commit 3ef43380a536fdbf50bbf454958eb64cbd201105
parent 284bedf9e4148b435204b0aff616c66a1f1d7cd2
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Thu, 21 Nov 2024 21:52:56 +0100
display algorithmic wavetables in a darker color
Diffstat:
4 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/source/xtJucePlugin/weTablesTreeItem.cpp b/source/xtJucePlugin/weTablesTreeItem.cpp
@@ -143,6 +143,13 @@ namespace xtJucePlugin
menu.showMenuAsync({});
}
+ juce::Colour TablesTreeItem::getTextColor(const juce::Colour _colour)
+ {
+ if (xt::wave::isAlgorithmicTable(m_index))
+ return _colour.withAlpha(0.7f);
+ return TreeItem::getTextColor(_colour);
+ }
+
void TablesTreeItem::onTableChanged(xt::TableId _index)
{
if(_index != m_index)
diff --git a/source/xtJucePlugin/weTablesTreeItem.h b/source/xtJucePlugin/weTablesTreeItem.h
@@ -30,6 +30,7 @@ namespace xtJucePlugin
const auto& getTableId() const { return m_index; }
+ juce::Colour getTextColor(const juce::Colour _colour) override;
private:
void onTableChanged(xt::TableId _index);
void onTableChanged();
diff --git a/source/xtJucePlugin/weTreeItem.cpp b/source/xtJucePlugin/weTreeItem.cpp
@@ -17,7 +17,7 @@ namespace xtJucePlugin
{
const auto* style = dynamic_cast<const genericUI::TreeViewStyle*>(&getOwnerView()->getLookAndFeel());
- _g.setColour(style ? style->getColor() : juce::Colour(0xffffffff));
+ _g.setColour(getTextColor(style ? style->getColor() : juce::Colour(0xffffffff)));
bool haveFont = false;
if(style)
diff --git a/source/xtJucePlugin/weTreeItem.h b/source/xtJucePlugin/weTreeItem.h
@@ -10,6 +10,8 @@ namespace xtJucePlugin
void setText(const std::string& _text);
protected:
+ virtual juce::Colour getTextColor(const juce::Colour _colour) { return _colour; }
+
void paintItem(juce::Graphics& _g, int _width, int _height) override;
bool paintInBold() const;