@@ -735,9 +735,14 @@ void PlugDataLook::drawCornerResizer(Graphics& g, int w, int h, bool isMouseOver
735735
736736void PlugDataLook::drawTooltip (Graphics& g, String const & text, int width, int height)
737737{
738- auto bounds = Rectangle<float >(0 , 0 , width, height);
739- auto cornerSize = Corners::defaultCornerRadius;
740-
738+ auto bounds = Rectangle<float >(0 , 0 , width, height).reduced (ProjectInfo::canUseSemiTransparentWindows () ? 6 : 0 );
739+ auto shadowBounds = bounds.reduced (2 );
740+ auto const cornerSize = ProjectInfo::canUseSemiTransparentWindows () ? Corners::defaultCornerRadius : 0 ;
741+
742+ Path shadowPath;
743+ shadowPath.addRoundedRectangle (shadowBounds.getX (), shadowBounds.getY (), shadowBounds.getWidth (), shadowBounds.getHeight (), cornerSize);
744+ StackShadow::renderDropShadow (g, shadowPath, Colours::black.withAlpha (0 .44f ), 8 , {0 , 0 }, 0 );
745+
741746 g.setColour (findColour (PlugDataColour::popupMenuBackgroundColourId));
742747 g.fillRoundedRectangle (bounds.toFloat (), cornerSize);
743748
@@ -766,7 +771,7 @@ void PlugDataLook::drawTooltip(Graphics& g, String const& text, int width, int h
766771
767772 TextLayout tl;
768773 tl.createLayoutWithBalancedLineLengths (s, (float )maxToolTipWidth);
769- tl.draw (g, bounds.withSizeKeepingCentre (width - 20 , height - 2 ));
774+ tl.draw (g, bounds.withSizeKeepingCentre (width - 28 , height - 14 ));
770775}
771776
772777Font PlugDataLook::getComboBoxFont (ComboBox& box)
@@ -868,15 +873,15 @@ Rectangle<int> PlugDataLook::getTooltipBounds(String const& tipText, Point<int>
868873 TextLayout tl;
869874 tl.createLayoutWithBalancedLineLengths (s, (float )maxToolTipWidth);
870875
871- int marginX = 22 .0f ;
876+ int marginX = 17 .0f ;
872877 int marginY = 10 .0f ;
873878
874879 auto w = (int )(tl.getWidth () + marginX);
875880 auto h = (int )(tl.getHeight () + marginY);
876881
877882 return Rectangle<int >(screenPos.x > parentArea.getCentreX () ? screenPos.x - (w + 12 ) : screenPos.x + 24 ,
878883 screenPos.y > parentArea.getCentreY () ? screenPos.y - (h + 6 ) : screenPos.y + 6 ,
879- w, h)
884+ w, h). expanded ( ProjectInfo::canUseSemiTransparentWindows () ? 6 : 0 )
880885 .constrainedWithin (parentArea);
881886}
882887
0 commit comments