Rework Crossover EQ plugin GUI (#7781)

* Switches to SVG assets
* Fixes layout issues
* Refactors redundant code

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
This commit is contained in:
Fawn
2025-03-19 23:30:29 -06:00
committed by GitHub
parent b9cb343d8b
commit 953f6b7351
14 changed files with 145 additions and 92 deletions

View File

@@ -171,6 +171,7 @@ private:
QElapsedTimer m_lastPeakTimer_R;
QPixmap m_knob {embed::getIconPixmap("fader_knob")};
QSize m_knobSize;
/**
* @brief Stores the offset to the knob center when the user drags the fader knob

View File

@@ -51,6 +51,24 @@ auto LMMS_EXPORT getIconPixmap(std::string_view name,
int width = -1, int height = -1, const char* const* xpm = nullptr) -> QPixmap;
auto LMMS_EXPORT getText(std::string_view name) -> QString;
/**
* @brief Temporary shim for QPixmap::deviceIndependentSize.
* @param pixmap The pixmap to get the size of.
* @return The device-independent size of the pixmap.
*/
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
[[deprecated("Use QPixmap::deviceIndependentSize() instead; See "
"https://doc.qt.io/qt-6/qpixmap.html#deviceIndependentSize")]]
#endif
inline auto logicalSize(const QPixmap &pixmap) noexcept
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
return pixmap.deviceIndependentSize().toSize();
#else
return pixmap.isNull() ? QSize() : pixmap.size() / pixmap.devicePixelRatio();
#endif
}
} // namespace embed
class PixmapLoader