Skip to content
18 changes: 18 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6775,6 +6775,10 @@ void MainWindow::updateLayoutSwitcher()
button->setAutoRaise(true);
button->setDefaultAction(ui->actionLayoutPlayer);
layoutGrid->addWidget(button, 1, 2, Qt::AlignCenter);
layoutSwitcher->setStyleSheet(
"QToolButton { border-radius: 8px; }"
"QToolButton:checked { background-color: palette(highlight);"
" color: palette(highlighted-text); }");
}
ui->mainToolBar->removeAction(ui->actionLayoutLogging);
ui->mainToolBar->removeAction(ui->actionLayoutEditing);
Expand All @@ -6796,6 +6800,20 @@ void MainWindow::updateLayoutSwitcher()
ui->mainToolBar->insertAction(ui->dummyAction, ui->actionLayoutAudio);
ui->mainToolBar->insertAction(ui->dummyAction, ui->actionLayoutPlayer);
}
const QString layoutBtnStyle = QStringLiteral(
"QToolButton { border-radius: 8px; }"
"QToolButton:checked { background-color: palette(highlight);"
" color: palette(highlighted-text); }");
const QList<QAction *> layoutActions{ui->actionLayoutLogging,
ui->actionLayoutEditing,
ui->actionLayoutEffects,
ui->actionLayoutColor,
ui->actionLayoutAudio,
ui->actionLayoutPlayer};
for (auto *action : layoutActions) {
if (auto *btn = qobject_cast<QToolButton *>(ui->mainToolBar->widgetForAction(action)))
btn->setStyleSheet(layoutBtnStyle);
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/models/playlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "database.h"
#include "mainwindow.h"
#include "proxymanager.h"
#include "qmltypes/qmlapplication.h"
#include "settings.h"
#include "shotcut_mlt_properties.h"
#include "util.h"
Expand Down Expand Up @@ -372,7 +373,7 @@ QVariant PlaylistModel::data(const QModelIndex &index, int role) const
painter.drawImage(rect, *thumb);
}
if (parent.is_valid() && parent.get_int(kPlaylistIndexProperty) == index.row() + 1) {
QPen pen(Qt::red);
QPen pen(QmlApplication::playheadColor());
pen.setWidthF(1.5 * MAIN.devicePixelRatioF());
painter.setPen(pen);
rect.setX(0);
Expand Down
3 changes: 3 additions & 0 deletions src/qml/views/filter/filterview.qml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Rectangle {

color: activePalette.highlight
visible: attachedfiltersmodel.producerTitle != ""
radius: 12

anchors {
top: parent.top
Expand All @@ -132,6 +133,8 @@ Rectangle {
color: activePalette.highlightedText
font.bold: true
horizontalAlignment: Text.AlignHCenter
topPadding: 4
bottomPadding: 3

anchors {
top: parent.top
Expand Down
4 changes: 2 additions & 2 deletions src/qml/views/keyframes/Keyframe.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2025 Meltytech, LLC
* Copyright (c) 2018-2026 Meltytech, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -170,7 +170,7 @@ Rectangle {
onPaint: {
var ctx = getContext("2d");
if (isSelected) {
ctx.fillStyle = 'red';
ctx.fillStyle = application.playheadColor;
} else {
ctx.fillStyle = activePalette.buttonText;
}
Expand Down
2 changes: 1 addition & 1 deletion src/qml/views/keyframes/KeyframeClip.qml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Rectangle {
}

width: clipDuration * timeScale
border.color: selected ? 'red' : 'black'
border.color: selected ? application.playheadColor : 'black'
border.width: 1
clip: true
opacity: isBlank ? 0.5 : 1
Expand Down
2 changes: 1 addition & 1 deletion src/qml/views/keyframes/ParameterHead.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Rectangle {
signal rightClicked

color: selected ? selectedTrackColor : (delegateIndex % 2) ? activePalette.alternateBase : activePalette.base
border.color: selected ? 'red' : 'transparent'
border.color: selected ? application.playheadColor : 'transparent'
border.width: selected ? 1 : 0
clip: true
state: 'normal'
Expand Down
2 changes: 1 addition & 1 deletion src/qml/views/keyframes/keyframes.qml
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ Rectangle {
id: cursor

visible: producer.position > -1 && metadata !== null
color: activePalette.text
color: application.playheadColor
width: 1
height: root.height - horizontalScrollBar.height
x: producer.position * timeScale - tracksFlickable.contentX
Expand Down
67 changes: 55 additions & 12 deletions src/qml/views/timeline/Clip.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,25 @@ Rectangle {
property bool isTrackMute: false
property bool elided: (width < 15) || (x + width < tracksFlickable.contentX) || (x > tracksFlickable.contentX + tracksFlickable.width) || (y + height < 0) || (y > tracksFlickable.contentY + tracksFlickable.contentHeight)
property color clipColor: isBlank ? 'transparent' : isTransition ? 'mediumpurple' : isAudio ? 'darkseagreen' : root.shotcutBlue
readonly property real _cornerRadius: 7.5
property real _roundLeft: {
if (isBlank || !trackRoot || trackRoot.clipCount === 0)
return 0;
if (index === 0)
return _cornerRadius;
const prev = trackRoot.clipAt(index - 1);
return (prev && prev.isBlank) ? _cornerRadius : 0;
}
property real _roundRight: {
if (isBlank || !trackRoot)
return 0;
if (index === trackRoot.clipCount - 1)
return _cornerRadius;
const next = trackRoot ? trackRoot.clipAt(index + 1) : null;
return (next && next.isBlank) ? _cornerRadius : 0;
}
readonly property real _leftRoundedInset: _roundLeft / 2
readonly property real _rightRoundedInset: _roundRight / 2

signal clicked(var clip, var mouse)
signal clipRightClicked(var clip, var mouse)
Expand Down Expand Up @@ -114,8 +133,10 @@ Rectangle {
return 'image://thumbnail/' + hash + '/' + mltService + '/' + clipResource + '#' + time;
}

border.color: (selected || Drag.active || trackIndex != originalTrackIndex) ? group < 0 ? 'red' : 'white' : 'black'
border.width: (isBlank && !selected) ? 0 : 1
topLeftRadius: _roundLeft
bottomLeftRadius: _roundLeft
topRightRadius: _roundRight
bottomRightRadius: _roundRight
clip: true
Drag.active: mouseArea.drag.active
Drag.proposedAction: Qt.MoveAction
Expand Down Expand Up @@ -319,7 +340,7 @@ Rectangle {
anchors.right: parent.right
anchors.top: parent.top
anchors.topMargin: parent.border.width
anchors.rightMargin: parent.border.width
anchors.rightMargin: parent.border.width + _rightRoundedInset
anchors.bottom: parent.bottom
anchors.bottomMargin: parent.height / 2
width: height * 16 / 9
Expand All @@ -334,7 +355,7 @@ Rectangle {
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: parent.border.width
anchors.leftMargin: parent.border.width
anchors.leftMargin: parent.border.width + _leftRoundedInset
anchors.rightMargin: parent.border.width
anchors.bottom: parent.bottom
anchors.bottomMargin: parent.height / 2
Expand All @@ -357,12 +378,17 @@ Rectangle {
id: waveform

readonly property int maxWidth: Math.max(application.maxTextureSize / 2, 2048)
readonly property real leftOffset: Math.max(_leftRoundedInset, parent.border.width)
readonly property real rightOffset: Math.max(_rightRoundedInset, parent.border.width)
readonly property real availableWidth: Math.max(0, clipRoot.width - leftOffset - rightOffset)

visible: !elided && !isBlank && settings.timelineShowWaveforms && (parseInt(audioIndex) > -1 || audioIndex === 'all')
height: (isAudio || parent.height <= 20) ? parent.height : parent.height / 2
height: (isAudio || parent.height <= 20) ? parent.height - (_cornerRadius / 2) : parent.height / 2
anchors.left: parent.left
anchors.bottom: parent.bottom
anchors.margins: parent.border.width
anchors.leftMargin: leftOffset
anchors.rightMargin: rightOffset
anchors.bottomMargin: parent.border.width
opacity: isTrackMute ? 0.2 : 0.7

Repeater {
Expand All @@ -375,7 +401,7 @@ Rectangle {

trackIndex: clipRoot.trackIndex
clipIndex: clipRoot.readonlyClipIndex
width: Math.min(clipRoot.width - 2 * clipRoot.border.width, waveform.maxWidth)
width: Math.min(waveform.maxWidth, Math.max(0, waveform.availableWidth - index * waveform.maxWidth))
height: waveform.height
fillColor: clipColor
inPoint: Math.round((clipRoot.inPoint + index * waveform.maxWidth / timeScale) * speed) * channels
Expand Down Expand Up @@ -463,7 +489,7 @@ Rectangle {
anchors.top: parent.top
anchors.left: parent.left
anchors.topMargin: parent.border.width
anchors.leftMargin: parent.border.width + ((isAudio || !settings.timelineShowThumbnails) ? filtersIcon.enabledWidth : inThumbnail.width + filtersIcon.width)
anchors.leftMargin: parent.border.width + _leftRoundedInset + ((isAudio || !settings.timelineShowThumbnails) ? filtersIcon.enabledWidth : (inThumbnail.width + filtersIcon.width))
width: label.width + 2
height: label.height
}
Expand All @@ -473,6 +499,7 @@ Rectangle {

text: clipName
visible: !elided && !isBlank && !isTransition
width: Math.min(implicitWidth, parent.width - leftLabelBackground.anchors.leftMargin - _rightRoundedInset - 2 * parent.border.width)
font.pointSize: 8
color: 'black'

Expand All @@ -492,7 +519,7 @@ Rectangle {
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: parent.border.width
anchors.rightMargin: parent.border.width + ((isAudio || !settings.timelineShowThumbnails) ? 0 : outThumbnail.width) + 2
anchors.rightMargin: parent.border.width + _rightRoundedInset + ((isAudio || !settings.timelineShowThumbnails) ? 0 : outThumbnail.width)
width: labelRight.width + 2
height: labelRight.height
}
Expand Down Expand Up @@ -526,7 +553,7 @@ Rectangle {
anchors.left: parent.left
anchors.top: parent.top
anchors.topMargin: parent.border.width
anchors.leftMargin: parent.border.width + ((isAudio || !settings.timelineShowThumbnails) ? (enabled ? width : 0) : inThumbnail.width)
anchors.leftMargin: parent.border.width + _leftRoundedInset + ((isAudio || !settings.timelineShowThumbnails) ? (enabled ? width : 0) : inThumbnail.width)
width: visible ? label.height : 0
height: label.height
padding: 0
Expand All @@ -550,9 +577,11 @@ Rectangle {
visible: !elided && !isBlank && !isTransition
width: parent.fadeIn * timeScale
height: parent.height - parent.border.width * 2
cornerRadius: _roundLeft
anchors.left: parent.left
anchors.top: parent.top
anchors.margins: parent.border.width
anchors.leftMargin: parent.border.width
anchors.topMargin: parent.border.width
opacity: 0.5
}

Expand Down Expand Up @@ -647,9 +676,11 @@ Rectangle {
visible: !elided && !isBlank && !isTransition
width: parent.fadeOut * timeScale
height: parent.height - parent.border.width * 2
cornerRadius: _roundRight
anchors.right: parent.right
anchors.top: parent.top
anchors.margins: parent.border.width
anchors.rightMargin: parent.border.width
anchors.topMargin: parent.border.width
opacity: 0.5

transform: Scale {
Expand Down Expand Up @@ -884,4 +915,16 @@ Rectangle {
color: clipColor
}
}

Rectangle {
anchors.fill: parent
color: 'transparent'
border.color: (selected || Drag.active || trackIndex != originalTrackIndex) ? group < 0 ? application.playheadColor : 'white' : 'black'
border.width: (isBlank && !selected) ? 0 : 1
topLeftRadius: clipRoot.topLeftRadius
bottomLeftRadius: clipRoot.bottomLeftRadius
topRightRadius: clipRoot.topRightRadius
bottomRightRadius: clipRoot.bottomRightRadius
z: 10
}
}
2 changes: 1 addition & 1 deletion src/qml/views/timeline/SubtitleBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Item {
width: subtitle ? subtitle.width : 0
height: subtitle ? subtitle.height : 0
color: 'transparent'
border.color: 'red'
border.color: application.playheadColor
}
}
}
2 changes: 1 addition & 1 deletion src/qml/views/timeline/TrackHead.qml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ Rectangle {
Component.onCompleted: _syncTrackGain()

color: selected ? selectedTrackColor : (index % 2) ? activePalette.alternateBase : activePalette.base
border.color: selected ? 'red' : 'transparent'
border.color: selected ? application.playheadColor : 'transparent'
border.width: selected ? 1 : 0
clip: true
state: 'normal'
Expand Down
6 changes: 3 additions & 3 deletions src/qml/views/timeline/timeline.qml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Rectangle {
width: headerWidth
height: rulerFlickable.height
color: selected ? shotcutBlue : activePalette.window
border.color: selected ? 'red' : 'transparent'
border.color: selected ? application.playheadColor : 'transparent'
border.width: selected ? 1 : 0
visible: trackHeaderRepeater.count
z: 1
Expand Down Expand Up @@ -621,7 +621,7 @@ Rectangle {
width: clipN ? clipN.width : 0
height: track ? track.height : 0
color: 'transparent'
border.color: (clipN && clipN.group < 0) ? 'red' : 'white'
border.color: (clipN && clipN.group < 0) ? application.playheadColor : 'white'
visible: clipN && !clipN.Drag.active && clipN.trackIndex === clipN.originalTrackIndex
}
}
Expand Down Expand Up @@ -699,7 +699,7 @@ Rectangle {
id: cursor

visible: timeline.position > -1
color: activePalette.text
color: application.playheadColor
width: 1
height: root.height - horizontalScrollBar.height
x: timeline.position * multitrack.scaleFactor - tracksFlickable.contentX
Expand Down
2 changes: 2 additions & 0 deletions src/qmltypes/qmlapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class QmlApplication : public QObject
Q_OBJECT
Q_PROPERTY(Qt::WindowModality dialogModality READ dialogModality CONSTANT);
Q_PROPERTY(QPoint mousePos READ mousePos);
Q_PROPERTY(QColor playheadColor READ playheadColor CONSTANT)
Q_PROPERTY(QColor toolTipBaseColor READ toolTipBaseColor NOTIFY paletteChanged)
Q_PROPERTY(QColor toolTipTextColor READ toolTipTextColor NOTIFY paletteChanged)
Q_PROPERTY(QString OS READ OS CONSTANT)
Expand All @@ -48,6 +49,7 @@ class QmlApplication : public QObject
static QmlApplication &singleton();
static Qt::WindowModality dialogModality();
static QPoint mousePos();
static QColor playheadColor() { return QColor(0xe0, 0x46, 0x4e); }
static QColor toolTipBaseColor();
static QColor toolTipTextColor();
static QString OS();
Expand Down
Loading