Skip to content

Commit

Permalink
component colours improvement (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
luismrguimaraes authored Aug 24, 2024
1 parent b8c3c42 commit d04372a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 24 deletions.
10 changes: 6 additions & 4 deletions include/sst/jucegui/components/DraggableTextEditableValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@ struct DraggableTextEditableValue : public juce::Component,
public style::SettingsConsumer,
public style::StyleConsumer
{
struct Styles : base_styles::Outlined, base_styles::BaseLabel, base_styles::ValueBearing
struct Styles : base_styles::Base,
base_styles::Outlined,
base_styles::BaseLabel,
base_styles::ValueBearing
{
SCLASS(draggabletexteditor);
PROP(background_editing);
static void initialize()
{
style::StyleSheet::addClass(styleClass)
.withBaseClass(base_styles::Base::styleClass)
.withBaseClass(base_styles::Outlined::styleClass)
.withBaseClass(base_styles::BaseLabel::styleClass)
.withBaseClass(base_styles::ValueBearing::styleClass)
.withProperty(background_editing);
.withBaseClass(base_styles::ValueBearing::styleClass);
}
};

Expand Down
15 changes: 6 additions & 9 deletions src/sst/jucegui/components/DraggableTextEditableValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,17 @@ void DraggableTextEditableValue::setFromEditor()

void DraggableTextEditableValue::paint(juce::Graphics &g)
{
if (underlyingEditor->isVisible())
{
g.setColour(getColour(Styles::background_editing));
g.fillRoundedRectangle(getLocalBounds().toFloat(), 3.f);
}
g.setColour(getColour(Styles::background));
if (isHovered)
g.setColour(getColour(Styles::background_hover));
g.fillRoundedRectangle(getLocalBounds().toFloat(), 3.f);

g.setColour(getColour(Styles::brightoutline));
g.drawRoundedRectangle(getLocalBounds().toFloat(), 3.f, 1.f);
if (continuous() && !underlyingEditor->isVisible())
{
g.setFont(getFont(Styles::labelfont));
g.setColour(getColour(Styles::labelcolor));
g.setColour(getColour(Styles::value));
if (isHovered)
g.setColour(getColour(Styles::labelcolor_hover));
g.setColour(getColour(Styles::value_hover));
g.drawText(continuous()->getValueAsString(), getLocalBounds(),
juce::Justification::centred);
}
Expand Down
1 change: 0 additions & 1 deletion src/sst/jucegui/components/MultiSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ void MultiSwitch::paint(juce::Graphics &g)
else
isH = isHovered && txt.contains(hoverX, getHeight() / 2);

// Draw the background
if (i == data->getValue() - data->getMin())
{
// Selected option
Expand Down
10 changes: 0 additions & 10 deletions src/sst/jucegui/style/StyleSheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,6 @@ struct DarkSheet : public StyleSheetBuiltInImpl
setColour(n::styleClass, n::connectorcol, juce::Colour(160, 160, 160));
}

{
using n = components::DraggableTextEditableValue::Styles;
setColour(n::styleClass, n::background_editing, juce::Colour(0x30, 0x30, 0x30));
}

{
using n = components::ToolTip::Styles;
setFont(n::styleClass, n::datafont,
Expand Down Expand Up @@ -477,11 +472,6 @@ struct LightSheet : public StyleSheetBuiltInImpl
setColour(n::styleClass, n::connectorcol, juce::Colour(160, 160, 160));
}

{
using n = components::DraggableTextEditableValue::Styles;
setColour(n::styleClass, n::background_editing, juce::Colour(0xC0, 0xC0, 0xC0));
}

{
using n = components::ToolTip::Styles;
setFont(n::styleClass, n::datafont,
Expand Down

0 comments on commit d04372a

Please sign in to comment.