Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/plugdata-team/plugdata i…
Browse files Browse the repository at this point in the history
…nto develop
  • Loading branch information
timothyschoen committed Nov 21, 2023
2 parents 2b59b0c + b07e6da commit 27c90b4
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ set(JUCE_COMPILE_DEFINITIONS
JUCE_USE_COREIMAGE_LOADER=0
JUCE_SILENCE_XCODE_15_LINKER_WARNING=1
JUCE_USE_XRENDER=1
JUCE_ALSA=1
JUCE_JACK=1
JUCE_JACK_CLIENT_NAME="plugdata"
)

set(PLUGDATA_COMPILE_DEFINITIONS
Expand Down
1 change: 1 addition & 0 deletions Source/Components/ZoomableDragAndDropContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ void ZoomableDragAndDropContainer::startDragging(var const& sourceDescription,
#endif

dragOperationStarted(dragImageComponent->sourceDetails);
TopLevelWindow::getActiveTopLevelWindow()->repaint();
}

bool ZoomableDragAndDropContainer::isDragAndDropActive() const
Expand Down
5 changes: 3 additions & 2 deletions Source/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ void PluginEditor::paint(Graphics& g)
{
auto baseColour = findColour(PlugDataColour::toolbarBackgroundColourId);

if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) {
if (ProjectInfo::isStandalone && !isActiveWindow()) {
baseColour = baseColour.brighter(baseColour.getBrightness() / 2.5f);
}

Expand Down Expand Up @@ -618,7 +618,8 @@ void PluginEditor::createNewWindow(TabBarButtonComponent* tabButton)

bool PluginEditor::isActiveWindow()
{
return !ProjectInfo::isStandalone || (TopLevelWindow::getActiveTopLevelWindow() == getTopLevelComponent());
bool isDraggingTab = ZoomableDragAndDropContainer::isDragAndDropActive();
return !ProjectInfo::isStandalone || isDraggingTab || (TopLevelWindow::getActiveTopLevelWindow() == getTopLevelComponent());
}

void PluginEditor::newProject()
Expand Down
10 changes: 6 additions & 4 deletions Source/Sidebar/Palettes.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class PaletteDraggableList : public Component
class PaletteComponent : public Component {
public:
PaletteComponent(PluginEditor* e, ValueTree tree)
: paletteTree(tree)
: editor(e), paletteTree(tree)
{
paletteDraggableList = new PaletteDraggableList(e, tree);

Expand Down Expand Up @@ -327,7 +327,7 @@ class PaletteComponent : public Component {
{
// toolbar bar
auto backgroundColour = findColour(PlugDataColour::toolbarBackgroundColourId);
if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) {
if (ProjectInfo::isStandalone && !editor->isActiveWindow()) {
backgroundColour = backgroundColour.brighter(backgroundColour.getBrightness() / 2.5f);
}

Expand All @@ -354,6 +354,7 @@ class PaletteComponent : public Component {
private:
PaletteDraggableList* paletteDraggableList;
ValueTree paletteTree;
PluginEditor* editor;
BouncingViewport viewport;

Label nameLabel;
Expand Down Expand Up @@ -389,7 +390,8 @@ class PaletteSelector : public TextButton {
void paint(Graphics& g) override
{
auto backgroundColour = findColour(PlugDataColour::toolbarBackgroundColourId);
if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) {
auto* editor = findParentComponentOfClass<PluginEditor>();
if (ProjectInfo::isStandalone && editor && !editor->isActiveWindow()) {
backgroundColour = backgroundColour.brighter(backgroundColour.getBrightness() / 2.5f);
}

Expand Down Expand Up @@ -700,7 +702,7 @@ class Palettes : public Component
}

auto backgroundColour = findColour(PlugDataColour::toolbarBackgroundColourId);
if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) {
if (ProjectInfo::isStandalone && !editor->isActiveWindow()) {
backgroundColour = backgroundColour.brighter(backgroundColour.getBrightness() / 2.5f);
}
g.setColour(backgroundColour);
Expand Down
2 changes: 1 addition & 1 deletion Source/Sidebar/Sidebar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void Sidebar::paint(Graphics& g)
g.fillRect(0, 30, getWidth(), getHeight());

auto toolbarColour = findColour(PlugDataColour::toolbarBackgroundColourId);
if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) {
if (ProjectInfo::isStandalone && !editor->isActiveWindow()) {
toolbarColour = toolbarColour.brighter(toolbarColour.getBrightness() / 2.5f);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Tabbar/Tabbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ void TabComponent::paint(Graphics& g)
{
auto backgroundColour = findColour(PlugDataColour::tabBackgroundColourId);

if (ProjectInfo::isStandalone && !getTopLevelComponent()->hasKeyboardFocus(true)) {
if (ProjectInfo::isStandalone && !editor->isActiveWindow()) {
backgroundColour = backgroundColour.brighter(backgroundColour.getBrightness() / 2.5f);
}

Expand Down

0 comments on commit 27c90b4

Please sign in to comment.