Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component Colours Improvement #113

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading