Skip to content

Commit

Permalink
Fix welcome panel details, associate .plugdata extension with plugdata
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Nov 27, 2024
1 parent 29c830e commit 228271d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ juce_add_gui_app(plugdata_standalone
CAMERA_PERMISSION_ENABLED TRUE
HARDENED_RUNTIME_ENABLED ${HARDENED_RUNTIME_ENABLED}
HARDENED_RUNTIME_OPTIONS ${HARDENED_RUNTIME_OPTIONS}
DOCUMENT_EXTENSIONS pd
DOCUMENT_EXTENSIONS pd plugdata
BUNDLE_ID com.plugdata.plugdata
)
else()
Expand Down Expand Up @@ -408,7 +408,7 @@ juce_add_plugin(plugdata_standalone
LV2URI https://github.com/timothyschoen/plugdata
PRODUCT_NAME "plugdata"
AU_MAIN_TYPE kAudioUnitType_MusicDevice
DOCUMENT_EXTENSIONS pd
DOCUMENT_EXTENSIONS pd plugdata
DOCUMENT_BROWSER_ENABLED TRUE
BUNDLE_ID com.plugdata.plugdata
APP_GROUPS_ENABLED TRUE
Expand Down
18 changes: 9 additions & 9 deletions Source/Components/WelcomePanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ class WelcomePanel : public Component

auto const bgColour = findColour(PlugDataColour::canvasBackgroundColourId);
auto const bgCol = convertColour(bgColour);
auto const newOpenIconCol = convertColour(bgColour.contrasting().withAlpha(0.15f));
auto const iconSize = 55;
auto const newOpenIconCol = convertColour(bgColour.contrasting().withAlpha(0.32f));
auto const iconSize = 48;
auto const iconHalf = iconSize * 0.5f;
auto const circleBounds = Rectangle<int>(lB.getX() + 40 - iconHalf, lB.getCentreY() - iconHalf, iconSize, iconSize);

Expand All @@ -142,7 +142,7 @@ class WelcomePanel : public Component
// Draw a cross icon manually
auto const lineThickness = 4;
auto const lineRad = lineThickness * 0.5f;
auto const crossSize = 30;
auto const crossSize = 26;
auto const halfSize = crossSize * 0.5f;
// Horizontal line
nvgDrawRoundedRect(nvg, circleBounds.getCentreX() - halfSize, circleBounds.getCentreY() - lineRad, crossSize, lineThickness, bgCol, bgCol, lineRad);
Expand All @@ -153,36 +153,36 @@ class WelcomePanel : public Component
nvgFontSize(nvg, 12);
nvgTextAlign(nvg, NVG_ALIGN_CENTER | NVG_ALIGN_LEFT);
nvgFillColor(nvg, NVGComponent::convertColour(findColour(PlugDataColour::panelTextColourId)));
nvgText(nvg, 92, 44, "New Patch", NULL);
nvgText(nvg, 92, 45, "New Patch", NULL);

nvgFontFace(nvg, "Inter-Regular");
nvgText(nvg, 92, 60, "Create a new empty patch", NULL);
nvgText(nvg, 92, 63, "Create a new empty patch", NULL);
break;
}

case Open: {
nvgFontFace(nvg, "plugdata_icon_font");
nvgFillColor(nvg, bgCol);
nvgFontSize(nvg, 38);
nvgFontSize(nvg, 34);
nvgTextAlign(nvg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
nvgText(nvg, circleBounds.getCentreX(), circleBounds.getCentreY() - 4, Icons::Folder.toRawUTF8(), nullptr);

nvgFontFace(nvg, "Inter-Bold");
nvgFontSize(nvg, 12);
nvgTextAlign(nvg, NVG_ALIGN_CENTER | NVG_ALIGN_LEFT);
nvgFillColor(nvg, NVGComponent::convertColour(findColour(PlugDataColour::panelTextColourId)));
nvgText(nvg, 92, 44, "Open Patch...", NULL);
nvgText(nvg, 92, 45, "Open Patch...", NULL);

nvgFontFace(nvg, "Inter-Regular");
nvgText(nvg, 92, 60, "Browse for a patch to open", NULL);
nvgText(nvg, 92, 63, "Browse for a patch to open", NULL);
break;
}
default:
break;
}
}

bool hitTest(int x, int y)
bool hitTest(int x, int y) override
{
return getLocalBounds().reduced(12).contains(Point<int>(x, y));
}
Expand Down

0 comments on commit 228271d

Please sign in to comment.