Commit 50d1e578 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Another attempt to fix Windows timeline icons

parent 1189583d
......@@ -75,7 +75,7 @@ Rectangle {
id: showVideo
visible: isEffectList
iconName: "kdenlive-show-video"
iconSource: 'qrc:///pics/kdenlive-show-video.svgz'
iconSource: 'image://icon/kdenlive-show-video'
checkable:true
exclusiveGroup: filterGroup
tooltip: i18n("Show all video effects")
......@@ -87,7 +87,7 @@ Rectangle {
id: showAudio
visible: isEffectList
iconName: "kdenlive-show-audio"
iconSource: 'qrc:///pics/kdenlive-show-audio.svgz'
iconSource: 'image://icon/kdenlive-show-audio'
checkable:true
exclusiveGroup: filterGroup
tooltip: i18n("Show all audio effects")
......
......@@ -128,9 +128,7 @@ void Core::initGUI(const QUrl &Url, const QString &clipsToLoad)
m_mainWindow = new MainWindow();
m_guiConstructed = true;
QStringList styles = QQuickStyle::availableStyles();
if (styles.contains(QLatin1String("Plasma"))) {
//QQuickStyle::setStyle("Plasma");
} else if (styles.contains(QLatin1String("org.kde.desktop"))) {
if (styles.contains(QLatin1String("org.kde.desktop"))) {
QQuickStyle::setStyle("org.kde.desktop");
} else if (styles.contains(QLatin1String("Fusion"))) {
QQuickStyle::setStyle("Fusion");
......
......@@ -33,7 +33,6 @@ Rectangle {
property bool showAudioRecord: false
property bool current: false
property int myTrackHeight
property int collapsedHeight : expandButton.height
property int trackId : -42
property string trackTag
property int thumbsFormat: 0
......@@ -186,14 +185,22 @@ Rectangle {
ToolButton {
id: expandButton
anchors.left: parent.left
focusPolicy: Qt.NoFocus
//icon.width: trackHeadRoot.iconSize
//icon.height: trackHeadRoot.iconSize
icon.name: trackHeadRoot.collapsed ? 'arrow-right' : 'arrow-down'
contentItem: Item {
Image {
source: trackHeadRoot.collapsed ? "image://icon/go-next" : "image://icon/go-down"
anchors.centerIn: parent
width: root.collapsedHeight - 4
height: root.collapsedHeight - 4
cache: root.paletteUnchanged
}
}
onClicked: {
trackHeadRoot.myTrackHeight = trackHeadRoot.collapsed ? Math.max(root.collapsedHeight * 1.5, controller.getTrackProperty(trackId, "kdenlive:trackheight")) : root.collapsedHeight
}
anchors.left: parent.left
width: root.collapsedHeight
height: root.collapsedHeight
ToolTip {
visible: expandButton.hovered
font: miniFont
......@@ -220,7 +227,7 @@ Rectangle {
color: trackLed.bgColor
}
width: fontMetrics.boundingRect("M").width * trackHeadRoot.trackTag.length
height: expandButton.height
height: root.collapsedHeight - 2
y: 1
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
......@@ -302,24 +309,41 @@ Rectangle {
id: buttonsRow
ToolButton {
id: effectButton
icon.name: 'tools-wizard'
checkable: true
focusPolicy: Qt.NoFocus
contentItem: Item {
Image {
source: "image://icon/tools-wizard"
anchors.centerIn: parent
width: root.collapsedHeight - 4
height: root.collapsedHeight - 4
cache: root.paletteUnchanged
opacity: effectButton.enabled ? 1 : 0.5
}
}
enabled: trackHeadRoot.effectNames != ''
checkable: true
checked: enabled && trackHeadRoot.isStackEnabled
focusPolicy: Qt.NoFocus
//icon.width: trackHeadRoot.iconSize
//icon.height: trackHeadRoot.iconSize
onClicked: {
timeline.showTrackAsset(trackId)
controller.setTrackStackEnabled(trackId, !isStackEnabled)
}
width: root.collapsedHeight
height: root.collapsedHeight
}
ToolButton {
id: muteButton
focusPolicy: Qt.NoFocus
//icon.width: trackHeadRoot.iconSize
//icon.height: trackHeadRoot.iconSize
icon.name: isAudio ? (isDisabled ? 'kdenlive-hide-audio' : 'kdenlive-show-audio') : (isDisabled ? 'kdenlive-hide-video' : 'kdenlive-show-video')
contentItem: Item {
Image {
source: isAudio ? (isDisabled ? "image://icon/kdenlive-hide-audio" : "image://icon/kdenlive-show-audio") : (isDisabled ? "image://icon/kdenlive-hide-video" : "image://icon/kdenlive-show-video")
anchors.centerIn: parent
width: root.collapsedHeight - 4
height: root.collapsedHeight - 4
cache: root.paletteUnchanged
}
}
width: root.collapsedHeight
height: root.collapsedHeight
onClicked: controller.hideTrack(trackId, isDisabled ? (isAudio ? '1' : '2') : '3')
ToolTip {
visible: muteButton.hovered
......@@ -339,10 +363,18 @@ Rectangle {
ToolButton {
id: lockButton
width: root.collapsedHeight
height: root.collapsedHeight
focusPolicy: Qt.NoFocus
//icon.width: trackHeadRoot.iconSize
//icon.height: trackHeadRoot.iconSize
icon.name: isLocked ? 'kdenlive-lock' : 'kdenlive-unlock'
contentItem: Item {
Image {
source: trackHeadRoot.isLocked ? "image://icon/kdenlive-lock" : "image://icon/kdenlive-unlock"
anchors.centerIn: parent
width: root.collapsedHeight - 4
height: root.collapsedHeight - 4
cache: root.paletteUnchanged
}
}
onClicked: controller.setTrackLockedState(trackId, !isLocked)
ToolTip {
visible: lockButton.hovered
......@@ -359,7 +391,7 @@ Rectangle {
}
}
SequentialAnimation {
SequentialAnimation {
id: flashLock
loops: 1
ScaleAnimator {
......
......@@ -63,6 +63,8 @@ Rectangle {
root.textColor = activePalette.text
playhead.fillColor = activePalette.windowText
ruler.repaintRuler()
// Disable caching fot track header icons
root.paletteUnchanged = false
}
function moveSelectedTrack(offset) {
......@@ -280,6 +282,7 @@ Rectangle {
property int scrollMax: scrollMin + scrollView.contentItem.width / timeline.scaleFactor
property double dar: 16/9
property int collapsedHeight: baseUnit * 1.8
property bool paletteUnchanged: true
onSeekingFinishedChanged : {
playhead.opacity = seekingFinished ? 1 : 0.5
......
......@@ -166,7 +166,7 @@ void TimelineWidget::setModel(const std::shared_ptr<TimelineItemModel> &model, M
rootContext()->setContextProperty("guidesModel", pCore->projectManager()->current()->getGuideModel().get());
rootContext()->setContextProperty("clipboard", new ClipboardProxy(this));
QFont ft = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
ft.setPixelSize(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont).pixelSize());
ft.setPointSize(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont).pointSize());
setFont(ft);
rootContext()->setContextProperty("miniFont", font());
const QStringList effs = sortedItems(KdenliveSettings::favorite_effects(), false).values();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment