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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user