Skip to content

Commit

Permalink
Sheesh I forgot to commit half the code for the drag (#1188)
Browse files Browse the repository at this point in the history
This *really* closes #1136
  • Loading branch information
baconpaul authored Aug 26, 2024
1 parent d2bfeca commit af3d63b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 14 deletions.
10 changes: 10 additions & 0 deletions src-ui/app/edit-screen/components/ProcessorPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ ProcessorPane::ProcessorPane(SCXTEditor *e, int index, bool fz)
forZone(fz)
{
setContentAreaComponent(std::make_unique<juce::Component>());
setOptionalCursorForNameArea(juce::MouseCursor::DraggingHandCursor);
hasHamburger = true;

onHamburger = [safeThis = juce::Component::SafePointer(this)]() {
Expand Down Expand Up @@ -1110,6 +1111,7 @@ void ProcessorPane::itemDropped(const juce::DragAndDropTarget::SourceDetails &dr
{
sendToSerialization(cmsg::SwapGroupProcessors({index, pp->index}));
}
setIsAccented(false);
}

void ProcessorPane::mouseDrag(const juce::MouseEvent &e)
Expand Down Expand Up @@ -1143,5 +1145,13 @@ void ProcessorPane::setAsMultiZone(int32_t primaryType, const std::string &nm,
resized();
repaint();
}
void ProcessorPane::itemDragEnter(const juce::DragAndDropTarget::SourceDetails &dragSourceDetails)
{
setIsAccented(true);
}
void ProcessorPane::itemDragExit(const juce::DragAndDropTarget::SourceDetails &dragSourceDetails)
{
setIsAccented(false);
}

} // namespace scxt::ui::app::edit_screen
3 changes: 2 additions & 1 deletion src-ui/app/edit-screen/components/ProcessorPane.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ struct ProcessorPane : sst::jucegui::components::NamedPanel, HasEditor, juce::Dr

bool isInterestedInDragSource(const SourceDetails &dragSourceDetails) override;
void itemDropped(const SourceDetails &dragSourceDetails) override;

void itemDragEnter(const SourceDetails &dragSourceDetails) override;
void itemDragExit(const SourceDetails &dragSourceDetails) override;
void reapplyStyle();

bool multiZone{false};
Expand Down
45 changes: 32 additions & 13 deletions src-ui/theme/ThemeApplier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,13 @@ namespace edit
static constexpr sheet_t::Class ModulationJogButon{"multi.modulation.jogbutton"};
static constexpr sheet_t::Class ModulationToggle{"multi.modulation.toggle"};
static constexpr sheet_t::Class ModulationMenu{"multi.modulation.menu"};
static constexpr sheet_t::Class ModulationHSliderFilled{"multi.modulation.hsliderfilled"};

void applyColors(const sheet_t::ptr_t &, const ColorMap &);
void init()
{
sheet_t::addClass(ModulationJogButon).withBaseClass(jcmp::JogUpDownButton::Styles::styleClass);
sheet_t::addClass(ModulationToggle).withBaseClass(jcmp::ToggleButton::Styles::styleClass);
sheet_t::addClass(ModulationMenu).withBaseClass(jcmp::MenuButton::Styles::styleClass);
sheet_t::addClass(ModulationHSliderFilled)
.withBaseClass(jcmp::HSliderFilled::Styles::styleClass);
}

namespace zone
Expand All @@ -87,6 +84,7 @@ static constexpr sheet_t::Class ModulationVSlider{"multi.zone.modulation.vslider
static constexpr sheet_t::Class ModulationKnob{"multi.zone.modulation.knob"};
static constexpr sheet_t::Class ModulationDraggableTextEditableValue{
"multi.zone.modulation.draggabletexteditablevalue"};
static constexpr sheet_t::Class ModulationHSliderFilled{"multi.zone.modulation.hsliderfilled"};

void applyColors(const sheet_t::ptr_t &, const ColorMap &);
void init()
Expand All @@ -97,6 +95,8 @@ void init()
sheet_t::addClass(ModulationKnob).withBaseClass(jcmp::Knob::Styles::styleClass);
sheet_t::addClass(ModulationDraggableTextEditableValue)
.withBaseClass(jcmp::DraggableTextEditableValue::Styles::styleClass);
sheet_t::addClass(ModulationHSliderFilled)
.withBaseClass(jcmp::HSliderFilled::Styles::styleClass);
}

} // namespace zone
Expand All @@ -115,6 +115,7 @@ static constexpr sheet_t::Class ModulationKnob{"multi.group.modulation.knob"};
static constexpr sheet_t::Class ModulationVSlider{"multi.group.modulation.vslider"};
static constexpr sheet_t::Class ModulationDraggableTextEditableValue{
"multi.group.modulation.draggabletexteditablevalue"};
static constexpr sheet_t::Class ModulationHSliderFilled{"multi.group.modulation.hsliderfilled"};

void applyColors(const sheet_t::ptr_t &, const ColorMap &);
void init()
Expand All @@ -132,6 +133,8 @@ void init()
sheet_t::addClass(ModulationVSlider).withBaseClass(VSlider);
sheet_t::addClass(ModulationDraggableTextEditableValue)
.withBaseClass(DraggableTextEditableValue);
sheet_t::addClass(ModulationHSliderFilled)
.withBaseClass(jcmp::HSliderFilled::Styles::styleClass);
}

} // namespace group
Expand Down Expand Up @@ -198,7 +201,6 @@ void populateSharedGroupZoneMultiModulation(jstl::CustomTypeMap &map)
map.addCustomClass<jcmp::JogUpDownButton>(detail::edit::ModulationJogButon);
map.addCustomClass<jcmp::ToggleButton>(detail::edit::ModulationToggle);
map.addCustomClass<jcmp::MenuButton>(detail::edit::ModulationMenu);
map.addCustomClass<jcmp::HSliderFilled>(detail::edit::ModulationHSliderFilled);
}
void ThemeApplier::applyZoneMultiScreenModulationTheme(juce::Component *toThis)
{
Expand All @@ -207,6 +209,7 @@ void ThemeApplier::applyZoneMultiScreenModulationTheme(juce::Component *toThis)
map.addCustomClass<jcmp::MultiSwitch>(detail::edit::zone::ModulationMultiSwitch);
map.addCustomClass<jcmp::VSlider>(detail::edit::zone::ModulationVSlider);
map.addCustomClass<jcmp::Knob>(detail::edit::zone::ModulationKnob);
map.addCustomClass<jcmp::HSliderFilled>(detail::edit::zone::ModulationHSliderFilled);
map.addCustomClass<jcmp::DraggableTextEditableValue>(
detail::edit::zone::ModulationDraggableTextEditableValue);
populateSharedGroupZoneMultiModulation(map);
Expand All @@ -230,6 +233,7 @@ void ThemeApplier::applyGroupMultiScreenModulationTheme(juce::Component *toThis)
map.addCustomClass<jcmp::Knob>(detail::edit::group::ModulationKnob);
map.addCustomClass<jcmp::DraggableTextEditableValue>(
detail::edit::group::ModulationDraggableTextEditableValue);
map.addCustomClass<jcmp::HSliderFilled>(detail::edit::group::ModulationHSliderFilled);
populateSharedGroupZoneMultiModulation(map);
map.applyMapTo(toThis);
}
Expand Down Expand Up @@ -395,6 +399,8 @@ void applyColors(const sheet_t::ptr_t &base, const ColorMap &cols)
npol);
base->setColour(jcmp::NamedPanel::Styles::styleClass, jcmp::NamedPanel::Styles::selectedtab,
cols.get(ColorMap::accent_1a));
base->setColour(jcmp::NamedPanel::Styles::styleClass, jcmp::NamedPanel::Styles::accentedPanel,
cols.get(ColorMap::accent_1b));

base->setColour(jcmp::MenuButton::Styles::styleClass, jcmp::MenuButton::Styles::menuarrow_hover,
cols.get(ColorMap::accent_1a));
Expand Down Expand Up @@ -429,15 +435,6 @@ void applyColors(const sheet_t::ptr_t &base, const ColorMap &cols)
base->setColour(ModulationMenu, jcmp::MenuButton::Styles::menuarrow_hover,
cols.get(ColorMap::accent_2a));

base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::value,
cols.get(ColorMap::accent_2b));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::value_hover,
cols.getHover(ColorMap::accent_2b));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::handle,
cols.get(ColorMap::accent_2a));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::handle_hover,
cols.getHover(ColorMap::accent_2a));

base->setColour(ModulationToggle, jcmp::ToggleButton::Styles::value,
cols.get(ColorMap::accent_2a));
base->setColour(ModulationToggle, jcmp::ToggleButton::Styles::value_hover,
Expand All @@ -458,6 +455,15 @@ void applyColors(const sheet_t::ptr_t &base, const ColorMap &cols)
base->setColour(ModulationMultiSwitch, jcmp::MultiSwitch::Styles::valuelabel_hover,
cols.getHover(ColorMap::generic_content_high));

base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::value,
cols.get(ColorMap::accent_2b));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::value_hover,
cols.getHover(ColorMap::accent_2b));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::handle,
cols.get(ColorMap::accent_2a));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::handle_hover,
cols.getHover(ColorMap::accent_2a));

base->setColour(ModulationVSlider, jcmp::VSlider::Styles::value, cols.get(ColorMap::accent_2a));
base->setColour(ModulationVSlider, jcmp::VSlider::Styles::value_hover,
cols.getHover(ColorMap::accent_2a));
Expand Down Expand Up @@ -530,6 +536,19 @@ void applyColors(const sheet_t::ptr_t &base, const ColorMap &cols)
base->setColour(ModulationVSlider, jcmp::VSlider::Styles::value_hover,
cols.getHover(ColorMap::accent_2a));

base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::value,
cols.get(ColorMap::accent_2b));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::value_hover,
cols.getHover(ColorMap::accent_2b));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::handle,
cols.get(ColorMap::accent_2a));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::handle_hover,
cols.getHover(ColorMap::accent_2a));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::gutter,
cols.get(ColorMap::bg_2));
base->setColour(ModulationHSliderFilled, jcmp::HSliderFilled::Styles::gutter_hover,
cols.getHover(ColorMap::bg_2));

base->setColour(ModulationKnob, jcmp::Knob::Styles::value, cols.get(ColorMap::accent_2a));
base->setColour(ModulationKnob, jcmp::Knob::Styles::value_hover,
cols.getHover(ColorMap::accent_2a));
Expand Down

0 comments on commit af3d63b

Please sign in to comment.