mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-02 03:20:06 +00:00
Projucer: Selected colour scheme is now stored and recalled. Multiple fixes for unreadable text in the GUI editor
This commit is contained in:
parent
359238f0ed
commit
cf0e97fcc7
13 changed files with 151 additions and 69 deletions
|
|
@ -419,17 +419,10 @@ protected:
|
|||
owner (owner_)
|
||||
{
|
||||
setEditable (true, true, false);
|
||||
|
||||
setColour (backgroundColourId, Colours::white);
|
||||
setColour (textColourId, Colours::black);
|
||||
setColour (outlineColourId, findColour (ComboBox::outlineColourId));
|
||||
|
||||
setColour (TextEditor::textColourId, Colours::black);
|
||||
setColour (TextEditor::backgroundColourId, Colours::white);
|
||||
setColour (TextEditor::outlineColourId, findColour (ComboBox::outlineColourId));
|
||||
lookAndFeelChanged();
|
||||
}
|
||||
|
||||
TextEditor* createEditorComponent()
|
||||
TextEditor* createEditorComponent() override
|
||||
{
|
||||
TextEditor* ed = Label::createEditorComponent();
|
||||
ed->setInputRestrictions (14, "0123456789.-%");
|
||||
|
|
@ -437,10 +430,16 @@ protected:
|
|||
return ed;
|
||||
}
|
||||
|
||||
void textWasEdited()
|
||||
void textWasEdited() override
|
||||
{
|
||||
owner.textWasEdited();
|
||||
}
|
||||
|
||||
void lookAndFeelChanged() override
|
||||
{
|
||||
setColour (backgroundColourId, findColour (widgetBackgroundColourId));
|
||||
setColour (textColourId, findColour (widgetTextColourId));
|
||||
}
|
||||
};
|
||||
|
||||
ComponentLayout* layout;
|
||||
|
|
|
|||
|
|
@ -71,9 +71,15 @@ public:
|
|||
return;
|
||||
|
||||
if (rowIsSelected)
|
||||
{
|
||||
g.fillAll (findColour (TextEditor::highlightColourId));
|
||||
g.setColour (findColour (defaultHighlightedTextColourId));
|
||||
}
|
||||
else
|
||||
{
|
||||
g.setColour (findColour (defaultTextColourId));
|
||||
}
|
||||
|
||||
g.setColour (findColour (defaultTextColourId));
|
||||
g.setFont (height * 0.6f);
|
||||
g.drawText (returnValues [row] + " " + baseClasses [row] + "::" + methods [row],
|
||||
30, 0, width - 32, height,
|
||||
|
|
|
|||
|
|
@ -93,13 +93,13 @@ ResourceEditorPanel::ResourceEditorPanel (JucerDocument& doc)
|
|||
listBox->getHeader().addColumn ("reload", 4, 100, 100, 100, TableHeaderComponent::notResizableOrSortable);
|
||||
listBox->getHeader().setStretchToFitActive (true);
|
||||
|
||||
listBox->setColour (ListBox::backgroundColourId, findColour (secondaryBackgroundColourId));
|
||||
listBox->setColour (ListBox::outlineColourId, Colours::transparentBlack);
|
||||
listBox->setOutlineThickness (1);
|
||||
listBox->updateContent();
|
||||
|
||||
document.addChangeListener (this);
|
||||
handleCommandMessage (1);
|
||||
|
||||
lookAndFeelChanged();
|
||||
}
|
||||
|
||||
ResourceEditorPanel::~ResourceEditorPanel()
|
||||
|
|
@ -120,7 +120,7 @@ void ResourceEditorPanel::paintRowBackground (Graphics& g, int /*rowNumber*/,
|
|||
}
|
||||
|
||||
void ResourceEditorPanel::paintCell (Graphics& g, int rowNumber, int columnId, int width, int height,
|
||||
bool /*rowIsSelected*/)
|
||||
bool rowIsSelected)
|
||||
{
|
||||
if (const BinaryResources::BinaryResource* const r = document.getResources() [rowNumber])
|
||||
{
|
||||
|
|
@ -133,6 +133,11 @@ void ResourceEditorPanel::paintCell (Graphics& g, int rowNumber, int columnId, i
|
|||
else if (columnId == 3)
|
||||
text = File::descriptionOfSizeInBytes ((int64) r->data.getSize());
|
||||
|
||||
if (rowIsSelected)
|
||||
g.setColour (findColour (defaultHighlightedTextColourId));
|
||||
else
|
||||
g.setColour (findColour (defaultTextColourId));
|
||||
|
||||
g.setFont (13.0f);
|
||||
g.drawText (text, 4, 0, width - 6, height, Justification::centredLeft, true);
|
||||
}
|
||||
|
|
@ -179,6 +184,12 @@ int ResourceEditorPanel::getColumnAutoSizeWidth (int columnId)
|
|||
return widest + 10;
|
||||
}
|
||||
|
||||
void ResourceEditorPanel::lookAndFeelChanged()
|
||||
{
|
||||
listBox->setColour (ListBox::backgroundColourId, findColour (secondaryBackgroundColourId));
|
||||
listBox->setColour (ListBox::outlineColourId, Colours::transparentBlack);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
class ResourceSorter
|
||||
{
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ public:
|
|||
void selectedRowsChanged (int lastRowSelected) override;
|
||||
|
||||
private:
|
||||
void lookAndFeelChanged() override;
|
||||
|
||||
JucerDocument& document;
|
||||
ScopedPointer<TableListBox> listBox;
|
||||
TextButton addButton, reloadAllButton, delButton;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue