3131#include " Sidebar/CommandInput.h"
3232
3333class CommandButton : public Component , public MultiTimer {
34-
35- SmallIconButton rightIcon = SmallIconButton(Icons::Console);
3634 Label leftText;
3735 Component hitArea;
3836
3937 Colour bgCol;
4038 Colour textCol;
4139
42- int textWidth = 0 ;
43-
4440 float tW, tH;
4541 float cW, cH;
46-
4742 float alpha = 0 .0f ;
48-
49- const int textHeight = 14 ;
50-
43+ static constexpr int textHeight = 14 ;
44+ int textWidth = 0 ;
45+
5146public:
5247 CommandButton ()
5348 {
54- addAndMakeVisible (rightIcon);
5549 addAndMakeVisible (leftText);
5650 addAndMakeVisible (hitArea);
5751
@@ -61,21 +55,14 @@ class CommandButton : public Component, public MultiTimer {
6155
6256 setCommandButtonText ();
6357
64- setSize (20 , 20 );
58+ setSize (25 , 20 );
6559 };
6660
6761 ~CommandButton ()
6862 {
6963 hitArea.removeMouseListener (this );
7064 }
7165
72- // This button expands left, so use the right icon inside the badge to centre the callout
73- // As that wont change position
74- Rectangle<int > getStaticButtonScreenBounds ()
75- {
76- return rightIcon.getScreenBounds ();
77- }
78-
7966 void lookAndFeelChanged () override
8067 {
8168 leftText.setFont (Fonts::getDefaultFont ().withHeight (textHeight));
@@ -92,6 +79,9 @@ class CommandButton : public Component, public MultiTimer {
9279 auto bgColour = isMouseOver (true ) ? bgCol.withAlpha (0 .15f ) : bgCol.withAlpha (0 .05f );
9380 g.setColour (bgColour);
9481 g.fillRoundedRectangle (getLocalBounds ().toFloat (), Corners::defaultCornerRadius);
82+
83+ g.setColour (findColour (PlugDataColour::toolbarTextColourId));
84+ g.drawText (" >" , getWidth () - 22 , 0 , 20 , 20 , Justification::centred);
9585 }
9686
9787 void mouseDown (const MouseEvent& e) override
@@ -128,7 +118,7 @@ class CommandButton : public Component, public MultiTimer {
128118 Font font = Fonts::getDefaultFont ().withHeight (textHeight);
129119 textWidth = ceil (font.getStringWidthFloat (text));
130120
131- animateTo (textWidth + 30 , 20 );
121+ animateTo (textWidth + 25 , 20 );
132122
133123 // We dont want to flash the alpha animation when the text is going to be very similar
134124 if (!(text.containsWholeWord (" selected)" ) && prevText.containsWholeWord (" selected)" ))) {
@@ -196,7 +186,6 @@ class CommandButton : public Component, public MultiTimer {
196186 {
197187 auto b = getLocalBounds ().removeFromLeft (textWidth + 12 );
198188 leftText.setBounds (b);
199- rightIcon.setBounds (getWidth () - 25 , 0 , 20 , 20 );
200189
201190 hitArea.setBounds (getLocalBounds ());
202191
@@ -1276,7 +1265,7 @@ void Statusbar::showCommandInput()
12761265
12771266 auto commandInput = std::make_unique<CommandInput>(editor);
12781267 auto rawCommandInput = commandInput.get ();
1279- auto & callout = editor->showCalloutBox (std::move (commandInput), commandInputButton->getStaticButtonScreenBounds ( ));
1268+ auto & callout = editor->showCalloutBox (std::move (commandInput), commandInputButton->getScreenBounds (). removeFromRight ( 22 ));
12801269
12811270 commandInputCallout = (&callout);
12821271
0 commit comments