mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-25 02:04:23 +00:00
Projucer: Fixed some TextButton size issues
This commit is contained in:
parent
2ff6de2a94
commit
abd8fafa69
3 changed files with 27 additions and 13 deletions
|
|
@ -229,16 +229,18 @@ void ResourceEditorPanel::selectedRowsChanged (int /*lastRowSelected*/)
|
|||
|
||||
void ResourceEditorPanel::resized()
|
||||
{
|
||||
listBox->setBounds (6, 4, getWidth() - 12, getHeight() - 38);
|
||||
auto bounds = getLocalBounds();
|
||||
|
||||
addButton.changeWidthToFitText (22);
|
||||
addButton.setTopLeftPosition (8, getHeight() - 30);
|
||||
auto buttonSlice = bounds.removeFromBottom (40).reduced (5, 5);
|
||||
|
||||
reloadAllButton.changeWidthToFitText (22);
|
||||
reloadAllButton.setTopLeftPosition (addButton.getRight() + 10, getHeight() - 30);
|
||||
addButton.setBounds (buttonSlice.removeFromLeft (125));
|
||||
buttonSlice.removeFromLeft (10);
|
||||
|
||||
delButton.changeWidthToFitText (22);
|
||||
delButton.setTopRightPosition (getWidth() - 8, getHeight() - 30);
|
||||
reloadAllButton.setBounds (buttonSlice.removeFromLeft (125));
|
||||
|
||||
delButton.setBounds (buttonSlice.removeFromRight (125));
|
||||
|
||||
listBox->setBounds (bounds);
|
||||
}
|
||||
|
||||
void ResourceEditorPanel::paint (Graphics& g)
|
||||
|
|
|
|||
|
|
@ -75,15 +75,27 @@ public:
|
|||
bounds.reduce (10, 0);
|
||||
list.setBounds (bounds.removeFromTop (list.getRowPosition (getNumRows() - 1, true).getBottom() + 20));
|
||||
|
||||
auto buttonRow = bounds.removeFromTop (35);
|
||||
setCopyModeButton.setBounds (buttonRow.removeFromLeft (jmin (200, bounds.getWidth() / 3)));
|
||||
buttonRow.removeFromLeft (8);
|
||||
copyPathButton.setBounds (buttonRow.removeFromLeft (jmin (200, bounds.getWidth() / 3)));
|
||||
if (bounds.getHeight() < 35)
|
||||
{
|
||||
parentSizeChanged();
|
||||
}
|
||||
else
|
||||
{
|
||||
auto buttonRow = bounds.removeFromTop (35);
|
||||
setCopyModeButton.setBounds (buttonRow.removeFromLeft (jmin (200, bounds.getWidth() / 3)));
|
||||
buttonRow.removeFromLeft (8);
|
||||
copyPathButton.setBounds (buttonRow.removeFromLeft (jmin (200, bounds.getWidth() / 3)));
|
||||
}
|
||||
}
|
||||
|
||||
void parentSizeChanged() override
|
||||
{
|
||||
setSize (jmax (550, getParentWidth()), getParentHeight());
|
||||
const auto width = jmax (550, getParentWidth());
|
||||
auto y = list.getRowPosition (getNumRows() - 1, true).getBottom() + 100;
|
||||
|
||||
y = jmax (getParentHeight(), y);
|
||||
|
||||
setSize (width, y);
|
||||
}
|
||||
|
||||
int getNumRows() override
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ void ProjucerLookAndFeel::drawButtonText (Graphics& g, TextButton& button, bool
|
|||
.withMultipliedAlpha (button.isEnabled() ? 1.0f
|
||||
: 0.5f));
|
||||
|
||||
auto xIndent = jmin (12, button.getWidth() / 10);
|
||||
auto xIndent = jmin (8, button.getWidth() / 10);
|
||||
auto yIndent = jmin (3, button.getHeight() / 6);
|
||||
|
||||
auto textBounds = button.getLocalBounds().reduced (xIndent, yIndent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue