Skip to content

Commit

Permalink
Adjust UI foreground colour
Browse files Browse the repository at this point in the history
* Define UIColours::foreground

* Define highlightedTextColourId

* Remove UIColours::textEditor

---------

Co-authored-by: Jelle Bakker <jellebakker@jb-audio.com>
  • Loading branch information
xioTechnologies and JelleBakker authored Dec 1, 2023
1 parent ee2eea9 commit 1116518
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
26 changes: 17 additions & 9 deletions x-IMU3-GUI/Source/CustomLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,42 @@ CustomLookAndFeel::CustomLookAndFeel()
setDefaultSansSerifTypeface(UIFonts::Typefaces::getMontserratMedium()); // progress bar only

setColour(juce::CaretComponent::caretColourId, UIColours::backgroundDark);
setColour(juce::ComboBox::backgroundColourId, UIColours::textEditor);
setColour(juce::ComboBox::backgroundColourId, UIColours::foreground);
setColour(juce::ComboBox::textColourId, UIColours::backgroundDark);
setColour(juce::ComboBox::arrowColourId, juce::Colours::grey);
setColour(juce::DocumentWindow::textColourId, UIColours::foreground);
setColour(juce::GroupComponent::outlineColourId, juce::Colours::grey);
setColour(juce::GroupComponent::textColourId, UIColours::foreground);
setColour(juce::Label::textColourId, UIColours::foreground);
setColour(juce::Label::textWhenEditingColourId, UIColours::backgroundLightest);
setColour(juce::ListBox::backgroundColourId, {});
setColour(juce::PopupMenu::highlightedBackgroundColourId, UIColours::highlight);
setColour(juce::PopupMenu::backgroundColourId, UIColours::backgroundDark);
setColour(juce::PopupMenu::textColourId, UIColours::foreground);
setColour(juce::PopupMenu::headerTextColourId, juce::Colours::grey);
setColour(juce::ProgressBar::backgroundColourId, UIColours::textEditor);
setColour(juce::PopupMenu::highlightedBackgroundColourId, UIColours::highlight);
setColour(juce::PopupMenu::highlightedTextColourId, UIColours::foreground);
setColour(juce::ProgressBar::backgroundColourId, UIColours::foreground);
setColour(juce::ProgressBar::foregroundColourId, UIColours::highlight);
setColour(juce::ResizableWindow::backgroundColourId, UIColours::backgroundLightest);
setColour(juce::ScrollBar::thumbColourId, UIColours::backgroundLightest);
setColour(juce::ScrollBar::backgroundColourId, UIColours::backgroundDark);
setColour(juce::TableListBox::backgroundColourId, UIColours::backgroundDark);
setColour(juce::TextButton::buttonColourId, UIColours::backgroundLightest);
setColour(juce::TextButton::buttonOnColourId, UIColours::textEditor);
setColour(juce::TextButton::buttonOnColourId, UIColours::foreground);
setColour(juce::TextButton::textColourOnId, UIColours::backgroundDark);
setColour(juce::TextEditor::backgroundColourId, UIColours::textEditor);
setColour(juce::TextButton::textColourOffId, UIColours::foreground);
setColour(juce::TextEditor::backgroundColourId, UIColours::foreground);
setColour(juce::TextEditor::textColourId, UIColours::backgroundDark);
setColour(juce::TextEditor::highlightedTextColourId, UIColours::textEditor);
setColour(juce::TextEditor::highlightedTextColourId, UIColours::foreground);
setColour(juce::TextEditor::highlightColourId, UIColours::highlight);
setColour(juce::TextEditor::outlineColourId, {});
setColour(juce::TextEditor::focusedOutlineColourId, {});
setColour(juce::ToggleButton::tickDisabledColourId, juce::Colours::white);
setColour(juce::ToggleButton::textColourId, UIColours::foreground);
setColour(juce::ToggleButton::tickDisabledColourId, UIColours::foreground);
setColour(juce::ToggleButton::tickColourId, UIColours::backgroundLightest);
setColour(juce::TooltipWindow::outlineColourId, juce::Colours::grey);
setColour(juce::TooltipWindow::backgroundColourId, UIColours::backgroundDark);
setColour(juce::TooltipWindow::textColourId, UIColours::foreground);
setColour(juce::TooltipWindow::outlineColourId, juce::Colours::grey);
}

void CustomLookAndFeel::drawScrollbar(juce::Graphics& g, juce::ScrollBar& scrollbar, int x, int y, int width, int height,
Expand Down Expand Up @@ -375,7 +383,7 @@ void CustomLookAndFeel::drawDocumentWindowTitleBar(juce::DocumentWindow& window,

const auto font = UIFonts::getDefaultFont();
g.setFont(font);
g.setColour(juce::Colours::white);
g.setColour(UIColours::foreground);
g.drawText(window.getName(), bounds, juce::Justification::left, true);
}

Expand Down
2 changes: 1 addition & 1 deletion x-IMU3-GUI/Source/CustomLookAndFeel.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace UIColours
static const juce::Colour backgroundDark = juce::Colour::fromRGB(37, 37, 38);
static const juce::Colour backgroundLight = juce::Colour::fromRGB(45, 45, 48);
static const juce::Colour backgroundLightest = juce::Colour::fromRGB(62, 62, 66);
static const juce::Colour textEditor = juce::Colour::fromRGB(228, 228, 228);
static const juce::Colour foreground = juce::Colour::fromRGB(228, 228, 228);
static const juce::Colour highlight = juce::Colour::fromRGB(61, 138, 154);
static const juce::Colour warning = juce::Colour::fromRGB(247, 181, 0);

Expand Down
3 changes: 0 additions & 3 deletions x-IMU3-GUI/Source/DevicePanel/DevicePanelFooter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ DevicePanelFooter::DevicePanelFooter(DevicePanel& devicePanel_) : devicePanel(de
addAndMakeVisible(numberOfNotificationsLabel);
addAndMakeVisible(numberOfErrorsLabel);

numberOfErrorsLabel.setColour(juce::Label::textColourId, UIColours::textEditor);
numberOfNotificationsLabel.setColour(juce::Label::textColourId, UIColours::textEditor);

notificationsButton.onClick = errorsButton.onClick = [&]
{
DialogQueue::getSingleton().pushFront(std::make_unique<NotificationsAndErrorsDialog>(messages, [&]
Expand Down
2 changes: 1 addition & 1 deletion x-IMU3-GUI/Source/Dialogs/NotificationsAndErrorsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ juce::Colour NotificationsAndErrorsDialog::Message::getColour() const
switch (type)
{
case Message::Type::notification:
return juce::Colours::white;
return UIColours::foreground;
case Message::Type::error:
return UIColours::warning;
}
Expand Down
2 changes: 1 addition & 1 deletion x-IMU3-GUI/Source/DragOverlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DragOverlay : public juce::Component,
}
}();

g.setColour(juce::Colours::white);
g.setColour(UIColours::foreground);
g.drawRect(overlayBounds, 3);
}

Expand Down
2 changes: 1 addition & 1 deletion x-IMU3-GUI/Source/Widgets/CustomComboBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class CustomComboBox::LookAndFeel : public CustomLookAndFeel
public:
LookAndFeel()
{
setColour(juce::PopupMenu::backgroundColourId, UIColours::textEditor);
setColour(juce::PopupMenu::backgroundColourId, UIColours::foreground);
setColour(juce::PopupMenu::textColourId, UIColours::backgroundDark);
}

Expand Down

0 comments on commit 1116518

Please sign in to comment.