Small fonts adjustments

parent 2f243d35
......@@ -1195,12 +1195,12 @@ void MainWindow::setupActions()
if (KdenliveSettings::gpu_accel()) {
/*QString styleBorderless = QStringLiteral("QToolButton { border-width: 0px;margin: 1px 3px 0px;padding: 0px;}");*/
m_trimLabel = new QLabel(i18n("Experimental GPU processing enabled - not for production"), this);
m_trimLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
QLabel *warnLabel = new QLabel(i18n("Experimental GPU processing enabled - not for production"), this);
warnLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
// m_trimLabel->setAutoFillBackground(true);
m_trimLabel->setAlignment(Qt::AlignHCenter);
m_trimLabel->setStyleSheet(QStringLiteral("QLabel { background-color :red; color:black;padding-left:2px;padding-right:2px}"));
toolbar->addWidget(m_trimLabel);
warnLabel->setAlignment(Qt::AlignHCenter);
warnLabel->setStyleSheet(QStringLiteral("QLabel { background-color :red; color:black;padding-left:2px;padding-right:2px}"));
toolbar->addWidget(warnLabel);
}
toolbar->addAction(m_buttonAutomaticTransition);
toolbar->addAction(m_buttonVideoThumbs);
......
......@@ -54,8 +54,7 @@ void QmlManager::setScene(Kdenlive::MonitorId id, MonitorSceneType type, QSize p
}
m_sceneType = type;
QQuickItem *root = nullptr;
const QFont ft = QFontDatabase::systemFont(QFontDatabase::FixedFont);
m_view->rootContext()->setContextProperty("fixedFont", ft);
m_view->rootContext()->setContextProperty("fixedFont", QFontDatabase::systemFont(QFontDatabase::FixedFont));
double scalex = (double)displayRect.width() / profile.width() * zoom;
double scaley = (double)displayRect.height() / profile.height() * zoom;
switch (type) {
......
......@@ -313,7 +313,7 @@ Item {
Text {
id: label
text: i18n("Click to add points,\nright click to close shape.")
font.pointSize: root.baseUnit
font: miniFont
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
anchors {
......
......@@ -120,7 +120,7 @@ Rectangle {
}
contentItem: Label {
color: activePalette.text
font.pointSize: root.fontUnit
font: miniFont
text: label.text + ' (' + timeline.simplifiedTC(clipRoot.inPoint) + '-' + timeline.simplifiedTC(clipRoot.outPoint) + ')'
}
}
......@@ -355,7 +355,7 @@ Rectangle {
id: mlabel
visible: timeline.showMarkers && parent.width > width * 1.5
text: model.comment
font.pointSize: root.fontUnit
font: miniFont
x: markerBase.x
anchors {
bottom: parent.verticalCenter
......@@ -445,7 +445,7 @@ Rectangle {
}
contentItem: Label {
color: activePalette.text
font.pointSize: root.fontUnit
font: miniFont
text: i18n("In:%1\nPosition:%2", timeline.simplifiedTC(clipRoot.inPoint),timeline.simplifiedTC(clipRoot.modelStart))
}
}
......@@ -517,7 +517,7 @@ Rectangle {
}
contentItem: Label {
color: activePalette.text
font.pointSize: root.fontUnit
font: miniFont
text: i18n("Out: ") + timeline.simplifiedTC(clipRoot.outPoint)
}
}
......@@ -573,7 +573,7 @@ Rectangle {
// Clip name text
id: label
text: clipName + (clipRoot.speed != 1.0 ? ' [' + Math.round(clipRoot.speed*100) + '%]': '')
font.pointSize: root.fontUnit
font: miniFont
anchors {
top: labelRect.top
left: labelRect.left
......@@ -613,14 +613,14 @@ Rectangle {
}
contentItem: Label {
color: activePalette.text
font.pointSize: root.fontUnit
font: miniFont
text: positionOffset < 0 ? i18n("Offset: -%1", timeline.simplifiedTC(-positionOffset)) : i18n("Offset: %1", timeline.simplifiedTC(positionOffset))
}
}
Text {
id: offsetLabel
text: positionOffset
font.pointSize: root.fontUnit
font: miniFont
anchors {
horizontalCenter: parent.horizontalCenter
topMargin: 1
......@@ -646,7 +646,7 @@ Rectangle {
// Effect names text
id: effectLabel
text: clipRoot.effectNames
font.pointSize: root.fontUnit
font: miniFont
visible: effectsRect.visible
anchors {
top: effectsRect.top
......@@ -729,7 +729,7 @@ Rectangle {
}
contentItem: Label {
color: activePalette.text
font.pointSize: root.fontUnit
font: miniFont
text: i18n("Click to add composition")
}
}
......@@ -773,7 +773,7 @@ Rectangle {
}
contentItem: Label {
color: activePalette.text
font.pointSize: root.fontUnit
font: miniFont
text: i18n("Click to add composition")
}
}
......
......@@ -223,7 +223,7 @@ Item {
Text {
id: label
text: clipName + (compositionRoot.aTrack > -1 ? ' > ' + timeline.getTrackNameFromMltIndex(compositionRoot.aTrack) : '')
font.pointSize: root.fontUnit
font: miniFont
anchors {
top: labelRect.top
left: labelRect.left
......
......@@ -118,7 +118,7 @@ Rectangle {
anchors.top: parent.top
anchors.topMargin: 2
text: timeline.timecode(parent.realPos)
font.pointSize: root.fontUnit
font: miniFont
color: activePalette.windowText
}
}
......@@ -189,7 +189,7 @@ Rectangle {
id: inLabel
anchors.fill: parent
text: timeline.timecode(timeline.zoneIn)
font.pointSize: root.fontUnit
font: miniFont
color: activePalette.highlightedText
}
}
......@@ -204,7 +204,7 @@ Rectangle {
id: outLabel
anchors.fill: parent
text: timeline.timecode(timeline.zoneOut)
font.pointSize: root.fontUnit
font: miniFont
color: activePalette.highlightedText
}
}
......@@ -221,7 +221,7 @@ Rectangle {
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
text: timeline.timecode(timeline.zoneOut - timeline.zoneIn)
font.pointSize: root.fontUnit
font: miniFont
color: activePalette.highlightedText
}
}
......
......@@ -416,7 +416,7 @@ Item{
Text {
id: speedLabel
text: i18n("Adjusting speed")
font.pointSize: root.fontUnit
font: miniFont
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
......
......@@ -130,7 +130,7 @@ Rectangle {
}
ToolTip {
visible: targetArea.containsMouse
font.pixelSize: root.baseUnit
font: miniFont
delay: 1500
timeout: 5000
background: Rectangle {
......@@ -199,7 +199,7 @@ Rectangle {
}
ToolTip {
visible: expandButton.hovered
font.pixelSize: root.baseUnit
font: miniFont
delay: 1500
timeout: 5000
background: Rectangle {
......@@ -212,95 +212,94 @@ Rectangle {
}
}
}
Item {
id: tagContainer
Label {
id: trackLed
property color bgColor: Qt.darker(trackHeadRoot.color, 0.55)
anchors.left: expandButton.right
width: trackHeadRoot.buttonSize
height: trackHeadRoot.buttonSize
//Layout.topMargin: 1
Rectangle {
id: trackLed
color: Qt.darker(trackHeadRoot.color, 0.55)
font: miniFont
text: trackHeadRoot.trackTag
color: activePalette.text
background: Rectangle {
color: trackLed.bgColor
}
FontMetrics {
id: textMetricsLed
font: miniFont
}
height: parent.height, textMetricsLed.height + 2
width: (textMetricsLed.averageCharacterWidth * text.length) + 4
y: 1
leftPadding:0
rightPadding:0
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
MouseArea {
id: tagMouseArea
anchors.fill: parent
anchors.margins: trackHeadRoot.buttonSize / 8
border.width: 0
Text {
id: trackTagLabel
text: trackHeadRoot.trackTag
anchors.fill: parent
font.pointSize: root.fontUnit
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
timeline.switchTrackActive(trackHeadRoot.trackId)
}
}
ToolTip {
visible: tagMouseArea.containsMouse
font: miniFont
delay: 1500
timeout: 5000
background: Rectangle {
color: activePalette.alternateBase
border.color: activePalette.light
}
contentItem: Label {
color: activePalette.text
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: i18n("Click to make track active/inactive. Active tracks will react to editing operations")
}
MouseArea {
id: tagMouseArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
timeline.switchTrackActive(trackHeadRoot.trackId)
}
}
ToolTip {
visible: tagMouseArea.containsMouse
font.pixelSize: root.baseUnit
delay: 1500
timeout: 5000
background: Rectangle {
color: activePalette.alternateBase
border.color: activePalette.light
state: 'normalled'
states: [
State {
name: 'locked'
when: trackHeadRoot.isLocked
PropertyChanges {
target: trackLed
bgColor: 'red'
}
contentItem: Label {
color: activePalette.text
text: i18n("Click to make track active/inactive. Active tracks will react to editing operations")
},
State {
name: 'active'
when: trackHeadRoot.isActive
PropertyChanges {
target: trackLed
bgColor: timeline.targetColor
}
PropertyChanges {
target: trackLed
color: timeline.targetTextColor
}
state: 'normalled'
states: [
State {
name: 'locked'
when: trackHeadRoot.isLocked
PropertyChanges {
target: trackLed
color: 'red'
}
},
State {
name: 'active'
when: trackHeadRoot.isActive
PropertyChanges {
target: trackLed
color: timeline.targetColor
}
PropertyChanges {
target: trackTagLabel
color: timeline.targetTextColor
}
},
State {
name: 'inactive'
when: !trackHeadRoot.isLocked && !trackHeadRoot.isActive
PropertyChanges {
target: trackLed
color: Qt.darker(trackHeadRoot.color, 0.55)
}
},
State {
name: 'inactive'
when: !trackHeadRoot.isLocked && !trackHeadRoot.isActive
PropertyChanges {
target: trackLed
bgColor: Qt.darker(trackHeadRoot.color, 0.55)
}
]
transitions: [
Transition {
to: '*'
ColorAnimation { target: trackLed; duration: 300 }
}
]
}
}
]
transitions: [
Transition {
to: '*'
ColorAnimation { target: trackLed; duration: 300 }
}
]
}
Label {
anchors.left: tagContainer.right
anchors.left: trackLed.right
anchors.leftMargin: 2
anchors.verticalCenter: parent.verticalCenter
text: trackHeadRoot.trackName
font.pixelSize: root.baseUnit
font: miniFont
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
visible: trackHeadRoot.collapsed && trackHeadRoot.width > trackTarget.width + expandButton.width + trackTagLabel.width + (4 * muteButton.width) + 4
......@@ -337,7 +336,7 @@ Rectangle {
onClicked: controller.setTrackProperty(trackId, "hide", isDisabled ? (isAudio ? '1' : '2') : '3')
ToolTip {
visible: muteButton.hovered
font.pixelSize: root.baseUnit
font: miniFont
delay: 1500
timeout: 5000
background: Rectangle {
......@@ -362,7 +361,7 @@ Rectangle {
onClicked: controller.setTrackLockedState(trackId, !isLocked)
ToolTip {
visible: lockButton.hovered
font.pixelSize: root.baseUnit
font: miniFont
delay: 1500
timeout: 5000
background: Rectangle {
......@@ -454,7 +453,7 @@ Rectangle {
anchors.left: parent.left
anchors.leftMargin: 4
elide: Qt.ElideRight
font.pointSize: root.fontUnit
font: miniFont
}
Label {
id: placeHolder
......@@ -465,14 +464,14 @@ Rectangle {
anchors.left: parent.left
anchors.leftMargin: 4
elide: Qt.ElideRight
font.pointSize: root.fontUnit
font: miniFont
}
TextField {
id: nameEdit
visible: false
width: parent.width
text: trackName
font.pointSize: root.fontUnit
font: miniFont
background: Rectangle {
radius: 2
color: activePalette.window
......
......@@ -1251,7 +1251,7 @@ Rectangle {
id: bubbleHelpLabel
color: activePalette.text //application.toolTipTextColor
anchors.centerIn: parent
font.pointSize: root.fontUnit
font: miniFont
}
function show(x, y, text) {
bubbleHelp.text = text
......@@ -1370,7 +1370,7 @@ Rectangle {
id: mlabel
visible: timeline.showMarkers
text: model.comment
font.pointSize: root.fontUnit
font: miniFont
x: guideBase.x + 2
y: scrollView.contentY
color: 'white'
......
......@@ -582,18 +582,32 @@ void TimelineController::addTrack(int tid)
int newTid;
bool audioRecTrack = d->addRecTrack();
bool addAVTrack = d->addAVTrack();
m_model->requestTrackInsertion(d->selectedTrackPosition(), newTid, d->trackName(), d->addAudioTrack());
if (addAVTrack) {
int newTid2;
int mirrorPos = 0;
int mirrorId = m_model->getMirrorAudioTrackId(newTid);
if (mirrorId > -1) {
mirrorPos = m_model->getTrackMltIndex(mirrorId);
Fun undo = []() { return true; };
Fun redo = []() { return true; };
bool result = m_model->requestTrackInsertion(d->selectedTrackPosition(), newTid, d->trackName(), d->addAudioTrack(), undo, redo);
if (result) {
m_model->setTrackProperty(newTid, "kdenlive:timeline_active", QStringLiteral("1"));
if (addAVTrack) {
int newTid2;
int mirrorPos = 0;
int mirrorId = m_model->getMirrorAudioTrackId(newTid);
if (mirrorId > -1) {
mirrorPos = m_model->getTrackMltIndex(mirrorId);
}
result = m_model->requestTrackInsertion(mirrorPos, newTid2, d->trackName(), true, undo, redo);
if (result) {
m_model->setTrackProperty(newTid2, "kdenlive:timeline_active", QStringLiteral("1"));
}
}
if (audioRecTrack) {
m_model->setTrackProperty(newTid, "kdenlive:audio_rec", QStringLiteral("1"));
}
m_model->requestTrackInsertion(mirrorPos, newTid2, d->trackName(), true);
}
if (audioRecTrack) {
m_model->setTrackProperty(newTid, "kdenlive:audio_rec", QStringLiteral("1"));
if (result) {
pCore->pushUndo(undo, redo, addAVTrack ? i18n("Insert Tracks") : i18n("Insert Track"));
} else {
pCore->displayMessage(i18n("Could not insert track"), InformationMessage, 500);
undo();
}
}
}
......@@ -3117,5 +3131,6 @@ void TimelineController::expandActiveClip()
pCore->pushUndo(undo, redo, i18n("Expand clip"));
} else {
undo();
pCore->displayMessage(i18n("Could not expand clip"), InformationMessage, 500);
}
}
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