@@ -273,7 +273,8 @@ class SearchPathPanel final : public Component
273273 paths.clear ();
274274
275275 for (auto & child : SettingsFile::getInstance ()->getProperty <VarArray>(" paths" )) {
276- paths.add (child);
276+ auto path = child.toString ();
277+ if (path.isNotEmpty ()) paths.add (path);
277278 }
278279
279280 listBox.updateContent ();
@@ -508,7 +509,6 @@ class LibraryLoadPanel final : public Component
508509 auto [x, newWidth] = getContentXAndWidth ();
509510
510511 if (rowIsSelected) {
511-
512512 bool const roundTop = rowNumber == 0 ;
513513 Path p;
514514 p.addRoundedRectangle (x, 0 .0f , newWidth, height, Corners::largeCornerRadius, Corners::largeCornerRadius, roundTop, roundTop, false , false );
@@ -574,7 +574,8 @@ class LibraryLoadPanel final : public Component
574574 librariesToLoad.clear ();
575575
576576 for (auto & child : SettingsFile::getInstance ()->getProperty <VarArray>(" libraries" )) {
577- librariesToLoad.addIfNotAlreadyThere (child.toString ());
577+ auto library = child.toString ();
578+ if (library.isNotEmpty ()) librariesToLoad.add (library);
578579 }
579580
580581 listBox.updateContent ();
@@ -681,20 +682,47 @@ class LibraryLoadPanel final : public Component
681682 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LibraryLoadPanel)
682683};
683684
685+ class EnableGemToggle : public PropertiesPanel ::BoolComponent
686+ {
687+ public:
688+ EnableGemToggle () : PropertiesPanel::BoolComponent(" Enable GEM" , Value(), {" No" , " Yes" })
689+ {
690+ toggleStateValue.referTo (SettingsFile::getInstance ()->getPropertyAsValue (" enable_gem" ));
691+ }
692+
693+ private:
694+ void paint (Graphics& g) override
695+ {
696+ auto b = getLocalBounds ().reduced (2 );
697+ StackShadow::drawShadowForRect (g, b.reduced (3 ), 8 , Corners::largeCornerRadius, 0 .4f );
698+
699+ g.setColour (PlugDataColours::panelForegroundColour);
700+ g.fillRoundedRectangle (b.toFloat (), Corners::largeCornerRadius);
701+
702+ g.setColour (PlugDataColours::toolbarOutlineColour);
703+ g.drawRoundedRectangle (b.toFloat (), Corners::largeCornerRadius, 1 .0f );
704+
705+ PropertiesPanel::BoolComponent::paint (g);
706+ }
707+ };
708+
684709class PathsSettingsPanel final : public SettingsDialogPanel
685710 , public ComponentListener {
686711public:
687712 PathsSettingsPanel ()
688713 {
689714 container.addAndMakeVisible (searchPathsPanel);
690715 container.addAndMakeVisible (libraryLoadPanel);
716+ container.addAndMakeVisible (enableGemToggle);
691717
692718 searchPathsPanel.onChange = [this ] {
693719 updateBounds ();
720+ SettingsFile::getInstance ()->triggerSettingsChange (" paths" );
694721 };
695722
696723 libraryLoadPanel.onChange = [this ] {
697724 updateBounds ();
725+ SettingsFile::getInstance ()->triggerSettingsChange (" libraries" );
698726 };
699727
700728 container.setVisible (true );
@@ -709,7 +737,8 @@ class PathsSettingsPanel final : public SettingsDialogPanel
709737private:
710738 void updateBounds ()
711739 {
712- searchPathsPanel.setSize (getWidth (), 96 .0f + (searchPathsPanel.getNumRows () + 1 ) * 32 .0f );
740+ enableGemToggle.setBounds (getLocalBounds ().withTrimmedTop (4 ).removeFromTop (50 ).reduced (40 , 8 ));
741+ searchPathsPanel.setBounds (0 , 46 , getWidth (), 96 .0f + (searchPathsPanel.getNumRows () + 1 ) * 32 .0f );
713742 libraryLoadPanel.setBounds (libraryLoadPanel.getX (), searchPathsPanel.getBottom () + 4 .0f , getWidth (), 52 .0f + (libraryLoadPanel.getNumRows () + 1 ) * 32 .0f );
714743
715744 container.setBounds (getLocalBounds ().getUnion (searchPathsPanel.getBounds ()).getUnion (libraryLoadPanel.getBounds ()));
@@ -721,6 +750,7 @@ class PathsSettingsPanel final : public SettingsDialogPanel
721750 updateBounds ();
722751 }
723752
753+ EnableGemToggle enableGemToggle;
724754 SearchPathPanel searchPathsPanel;
725755 LibraryLoadPanel libraryLoadPanel;
726756
0 commit comments