Skip to content

Commit

Permalink
More small design fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Oct 29, 2023
1 parent 33195df commit 7ce8ceb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
27 changes: 19 additions & 8 deletions Source/Dialogs/ThemePanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,22 @@ class NewThemeDialog : public Component {
NewThemeDialog(Dialog* parent, std::function<void(int, String, String)> callback)
: cb(std::move(callback))
{
setSize(400, 200);

setSize(400, 170);

label.setFont(Fonts::getBoldFont().withHeight(14.0f));
label.setJustificationType(Justification::centred);

nameEditor.setJustification(Justification::centredLeft);

auto backgroundColour = findColour(PlugDataColour::dialogBackgroundColourId);
ok.setColour(TextButton::buttonColourId, backgroundColour.contrasting(0.05f));
ok.setColour(TextButton::buttonOnColourId, backgroundColour.contrasting(0.1f));
ok.setColour(ComboBox::outlineColourId, Colours::transparentBlack);

cancel.setColour(TextButton::buttonColourId, backgroundColour.contrasting(0.05f));
cancel.setColour(TextButton::buttonOnColourId, backgroundColour.contrasting(0.1f));
cancel.setColour(ComboBox::outlineColourId, Colours::transparentBlack);

addAndMakeVisible(label);
addAndMakeVisible(cancel);
addAndMakeVisible(ok);
Expand Down Expand Up @@ -56,9 +70,6 @@ class NewThemeDialog : public Component {

baseThemeSelector.setSelectedItemIndex(0);

cancel.changeWidthToFitText();
ok.changeWidthToFitText();

addAndMakeVisible(nameLabel);
addAndMakeVisible(baseThemeLabel);

Expand All @@ -70,11 +81,11 @@ class NewThemeDialog : public Component {

void resized() override
{
label.setBounds(10, 7, 200, 30);
label.setBounds(0, 7, getWidth(), 30);
cancel.setBounds(30, getHeight() - 40, 80, 25);
ok.setBounds(getWidth() - 110, getHeight() - 40, 80, 25);

nameEditor.setBounds(90, 45, getWidth() - 100, 25);
nameEditor.setBounds(90, 43, getWidth() - 100, 28);
baseThemeSelector.setBounds(90, 85, getWidth() - 100, 25);

nameLabel.setBounds(8, 45, 80, 25);
Expand Down Expand Up @@ -296,7 +307,7 @@ class ThemePanel : public SettingsDialogPanel
updateSwatches();
};

auto* d = new Dialog(&dialog, getParentComponent(), 400, 190, 220, false);
auto* d = new Dialog(&dialog, getParentComponent(), 400, 170, false);
auto* dialogContent = new NewThemeDialog(d, callback);

d->setViewedComponent(dialogContent);
Expand Down
12 changes: 2 additions & 10 deletions Source/LookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -992,12 +992,8 @@ void PlugDataLook::drawGUIObjectSlider(Graphics& g, int x, int y, int width, int
void PlugDataLook::fillTextEditorBackground(Graphics& g, int width, int height, TextEditor& textEditor)
{
if (textEditor.getProperties()["NoBackground"].isVoid()) {
if (dynamic_cast<AlertWindow*>(textEditor.getParentComponent()) != nullptr) {
g.setColour(textEditor.findColour(TextEditor::backgroundColourId));
g.fillRect(0, 0, width, height);
} else {
g.fillAll(textEditor.findColour(TextEditor::backgroundColourId));
}
g.setColour(textEditor.findColour(TextEditor::backgroundColourId));
g.fillRoundedRectangle(2, 3, width - 4, height - 6, Corners::defaultCornerRadius);
}
}

Expand Down Expand Up @@ -1250,8 +1246,6 @@ void PlugDataLook::setColours(std::map<PlugDataColour, Colour> colours)
setColour(ListBox::backgroundColourId,
colours.at(PlugDataColour::toolbarBackgroundColourId));

setColour(AlertWindow::backgroundColourId,
colours.at(PlugDataColour::panelBackgroundColourId));
getCurrentColourScheme().setUIColour(ColourScheme::UIColour::widgetBackground, colours.at(PlugDataColour::panelBackgroundColourId));

setColour(TooltipWindow::backgroundColourId,
Expand Down Expand Up @@ -1314,8 +1308,6 @@ void PlugDataLook::setColours(std::map<PlugDataColour, Colour> colours)
colours.at(PlugDataColour::panelTextColourId));
setColour(Slider::textBoxTextColourId,
colours.at(PlugDataColour::panelTextColourId));
setColour(AlertWindow::textColourId,
colours.at(PlugDataColour::panelTextColourId));
setColour(FileBrowserComponent::currentPathBoxTextColourId,
colours.at(PlugDataColour::panelActiveTextColourId));
setColour(FileBrowserComponent::currentPathBoxArrowColourId,
Expand Down

0 comments on commit 7ce8ceb

Please sign in to comment.