Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::gui::qquick::QmlUtils Class Reference
Inheritance diagram for zrythm::gui::qquick::QmlUtils:
Collaboration diagram for zrythm::gui::qquick::QmlUtils:

Static Public Member Functions

static Q_INVOKABLE QString toPathString (const QUrl &url)
static Q_INVOKABLE QUrl localFileToQUrl (const QString &path)
static Q_INVOKABLE QString pathBasename (const QString &path)
static Q_INVOKABLE float amplitudeToDbfs (float amplitude)
static Q_INVOKABLE QStringList splitTextLines (const QString &text)
static Q_INVOKABLE QStringList removeDuplicates (const QStringList &list)
static Q_INVOKABLE QString readTextFileContent (const QString &filePath)
static Q_INVOKABLE QColor saturate (const QColor &color, float perc)
static Q_INVOKABLE QColor makeBrighter (const QColor &color, float perc)
static Q_INVOKABLE QColor adjustOpacity (const QColor &color, float newOpacity)
static Q_INVOKABLE QColor getTrackBackground (const QColor &baseColor, const QColor &trackColor, const QColor &windowTextColor, bool isSelected, bool isHovered, bool tint=true)
 Computes a track background color with optional track-color tinting.
static Q_INVOKABLE QVector< float > getAutomationRegionValues (QObject *automationRegion, int pixelWidth)
static Q_INVOKABLE bool rectanglesIntersect (QRectF a, QRectF b)
static Q_INVOKABLE bool rectanglesIntersect (QRect a, QRect b)
static Q_INVOKABLE QItemSelection createRowSelection (QAbstractItemModel *model, const QList< int > &rows, int column=0)
 Helper to create a selection from a list of rows in a single column.
static Q_INVOKABLE QItemSelection createRangeSelection (QAbstractItemModel *model, int startRow, int endRow, int startCol=0, int endCol=0)
 Helper to create a contiguous block/range selection.

Detailed Description

Definition at line 13 of file qml_utils.h.

Member Function Documentation

◆ getTrackBackground()

Q_INVOKABLE QColor zrythm::gui::qquick::QmlUtils::getTrackBackground ( const QColor & baseColor,
const QColor & trackColor,
const QColor & windowTextColor,
bool isSelected,
bool isHovered,
bool tint = true )
static

Computes a track background color with optional track-color tinting.

When tint is true, blends 12% of trackColor into baseColor as a base tint, then layers windowText overlays for selection (20%) and hover (5%).

When tint is false, skips the track color tint and applies only the selection and hover overlays directly to baseColor.

Parameters
baseColorThe base background color (typically palette.window).
trackColorThe track's assigned color (used only when tint is true).
windowTextColorThe window text color (used for selection/hover overlays).
isSelectedWhether the track is currently selected.
isHoveredWhether the track is currently hovered.
tintWhether to apply the 12% track-color base tint.

The documentation for this class was generated from the following file: