Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
bundle expression presets in-app.
  • Loading branch information
rodlie committed Oct 22, 2023
1 parent 1a17e45 commit b1fb080
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 38 deletions.
36 changes: 1 addition & 35 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ set(
icons.qrc
hicolor.qrc
${CMAKE_CURRENT_SOURCE_DIR}/../../docs/docs.qrc
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing.qrc
)

if(${USE_ROBOTO})
Expand Down Expand Up @@ -588,41 +589,6 @@ if(UNIX AND NOT APPLE)
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/mimetypes/
)
install(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInBack.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInBounce.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInCirc.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInCubic.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInElastic.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInExpo.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInOutBack.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInOutBounce.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInOutCirc.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInOutCubic.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInOutElastic.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInOutExpo.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInOutQuad.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInOutQuart.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInOutQuint.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInOutSine.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInQuad.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInQuart.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInQuint.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeInSine.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeOutBack.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeOutBounce.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeOutCirc.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeOutCubic.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeOutElastic.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeOutExpo.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeOutQuad.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeOutQuart.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeOutQuint.js
${CMAKE_CURRENT_SOURCE_DIR}/../scripts/easing/presets/easeOutSine.js
DESTINATION
${CMAKE_INSTALL_DATAROOTDIR}/friction/presets/expressions/easing/
)
install(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/../../LICENSE.md
Expand Down
37 changes: 34 additions & 3 deletions src/app/GUI/Expressions/expressiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ void ExpressionDialog::setCurrentTabId(const int id) {

const QStringList ExpressionDialog::generateEasingPresets()
{
QDir userDir(QString::fromUtf8("%1/easing").arg(AppSupport::getAppUserExPresetsPath()));
/*QDir userDir(QString::fromUtf8("%1/easing").arg(AppSupport::getAppUserExPresetsPath()));
QDir appDir(QString::fromUtf8("%1/easing").arg(AppSupport::getAppExPresetsPath()));
const auto userPresets = userDir.entryInfoList(QStringList() << "*.js", QDir::Files);
const auto appPresets = appDir.entryInfoList(QStringList() << "*.js", QDir::Files);
Expand All @@ -634,8 +634,39 @@ const QStringList ExpressionDialog::generateEasingPresets()
qDebug() << "Checking expression preset" << presets.at(i).absoluteFilePath();
if (!readEasingPreset(presets.at(i).absoluteFilePath()).valid) { continue; }
usable << presets.at(i).absoluteFilePath();
}
return usable;
}*/
QStringList presets;
presets << ":/easing/presets/easeInBack.js"
<< ":/easing/presets/easeInBounce.js"
<< ":/easing/presets/easeInCirc.js"
<< ":/easing/presets/easeInCubic.js"
<< ":/easing/presets/easeInElastic.js"
<< ":/easing/presets/easeInExpo.js"
<< ":/easing/presets/easeInOutBack.js"
<< ":/easing/presets/easeInOutBounce.js"
<< ":/easing/presets/easeInOutCirc.js"
<< ":/easing/presets/easeInOutCubic.js"
<< ":/easing/presets/easeInOutElastic.js"
<< ":/easing/presets/easeInOutExpo.js"
<< ":/easing/presets/easeInOutQuad.js"
<< ":/easing/presets/easeInOutQuart.js"
<< ":/easing/presets/easeInOutQuint.js"
<< ":/easing/presets/easeInOutSine.js"
<< ":/easing/presets/easeInQuad.js"
<< ":/easing/presets/easeInQuart.js"
<< ":/easing/presets/easeInQuint.js"
<< ":/easing/presets/easeInSine.js"
<< ":/easing/presets/easeOutBack.js"
<< ":/easing/presets/easeOutBounce.js"
<< ":/easing/presets/easeOutCirc.js"
<< ":/easing/presets/easeOutCubic.js"
<< ":/easing/presets/easeOutElastic.js"
<< ":/easing/presets/easeOutExpo.js"
<< ":/easing/presets/easeOutQuad.js"
<< ":/easing/presets/easeOutQuart.js"
<< ":/easing/presets/easeOutQuint.js"
<< ":/easing/presets/easeOutSine.js";
return presets;
}

bool ExpressionDialog::populateEasingPresets()
Expand Down
34 changes: 34 additions & 0 deletions src/scripts/easing.qrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<RCC>
<qresource prefix="/">
<file>easing/presets/easeOutSine.js</file>
<file>easing/presets/easeOutQuint.js</file>
<file>easing/presets/easeOutQuart.js</file>
<file>easing/presets/easeOutQuad.js</file>
<file>easing/presets/easeOutExpo.js</file>
<file>easing/presets/easeOutElastic.js</file>
<file>easing/presets/easeOutCubic.js</file>
<file>easing/presets/easeOutCirc.js</file>
<file>easing/presets/easeOutBounce.js</file>
<file>easing/presets/easeOutBack.js</file>
<file>easing/presets/easeInSine.js</file>
<file>easing/presets/easeInQuint.js</file>
<file>easing/presets/easeInQuart.js</file>
<file>easing/presets/easeInQuad.js</file>
<file>easing/presets/easeInOutSine.js</file>
<file>easing/presets/easeInOutQuint.js</file>
<file>easing/presets/easeInOutQuart.js</file>
<file>easing/presets/easeInOutQuad.js</file>
<file>easing/presets/easeInOutExpo.js</file>
<file>easing/presets/easeInOutElastic.js</file>
<file>easing/presets/easeInOutCubic.js</file>
<file>easing/presets/easeInOutCirc.js</file>
<file>easing/presets/easeInOutBounce.js</file>
<file>easing/presets/easeInOutBack.js</file>
<file>easing/presets/easeInExpo.js</file>
<file>easing/presets/easeInElastic.js</file>
<file>easing/presets/easeInCubic.js</file>
<file>easing/presets/easeInCirc.js</file>
<file>easing/presets/easeInBounce.js</file>
<file>easing/presets/easeInBack.js</file>
</qresource>
</RCC>

0 comments on commit b1fb080

Please sign in to comment.