diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c9bc32521d..be5a052fa1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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); @@ -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 layoutActions{ui->actionLayoutLogging, + ui->actionLayoutEditing, + ui->actionLayoutEffects, + ui->actionLayoutColor, + ui->actionLayoutAudio, + ui->actionLayoutPlayer}; + for (auto *action : layoutActions) { + if (auto *btn = qobject_cast(ui->mainToolBar->widgetForAction(action))) + btn->setStyleSheet(layoutBtnStyle); + } } } diff --git a/src/models/playlistmodel.cpp b/src/models/playlistmodel.cpp index ebeaabd530..b9653b6e25 100644 --- a/src/models/playlistmodel.cpp +++ b/src/models/playlistmodel.cpp @@ -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" @@ -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); diff --git a/src/qml/views/filter/filterview.qml b/src/qml/views/filter/filterview.qml index 3fcdb72cd0..ae2c02ea44 100644 --- a/src/qml/views/filter/filterview.qml +++ b/src/qml/views/filter/filterview.qml @@ -112,6 +112,7 @@ Rectangle { color: activePalette.highlight visible: attachedfiltersmodel.producerTitle != "" + radius: 12 anchors { top: parent.top @@ -132,6 +133,8 @@ Rectangle { color: activePalette.highlightedText font.bold: true horizontalAlignment: Text.AlignHCenter + topPadding: 4 + bottomPadding: 3 anchors { top: parent.top diff --git a/src/qml/views/keyframes/Keyframe.qml b/src/qml/views/keyframes/Keyframe.qml index a21c4fa044..29c0815a03 100644 --- a/src/qml/views/keyframes/Keyframe.qml +++ b/src/qml/views/keyframes/Keyframe.qml @@ -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 @@ -170,7 +170,7 @@ Rectangle { onPaint: { var ctx = getContext("2d"); if (isSelected) { - ctx.fillStyle = 'red'; + ctx.fillStyle = application.playheadColor; } else { ctx.fillStyle = activePalette.buttonText; } diff --git a/src/qml/views/keyframes/KeyframeClip.qml b/src/qml/views/keyframes/KeyframeClip.qml index 299a0d47cd..7ef088f660 100644 --- a/src/qml/views/keyframes/KeyframeClip.qml +++ b/src/qml/views/keyframes/KeyframeClip.qml @@ -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 diff --git a/src/qml/views/keyframes/ParameterHead.qml b/src/qml/views/keyframes/ParameterHead.qml index 3da7320b0d..53f7eeae6b 100644 --- a/src/qml/views/keyframes/ParameterHead.qml +++ b/src/qml/views/keyframes/ParameterHead.qml @@ -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' diff --git a/src/qml/views/keyframes/keyframes.qml b/src/qml/views/keyframes/keyframes.qml index 7fba5d4c67..d74bfef9c0 100644 --- a/src/qml/views/keyframes/keyframes.qml +++ b/src/qml/views/keyframes/keyframes.qml @@ -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 diff --git a/src/qml/views/timeline/Clip.qml b/src/qml/views/timeline/Clip.qml index 6d80849c78..106a99ef6d 100644 --- a/src/qml/views/timeline/Clip.qml +++ b/src/qml/views/timeline/Clip.qml @@ -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) @@ -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 @@ -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 @@ -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 @@ -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 { @@ -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 @@ -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 } @@ -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' @@ -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 } @@ -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 @@ -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 } @@ -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 { @@ -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 + } } diff --git a/src/qml/views/timeline/SubtitleBar.qml b/src/qml/views/timeline/SubtitleBar.qml index d5a5b66788..aff0db3996 100644 --- a/src/qml/views/timeline/SubtitleBar.qml +++ b/src/qml/views/timeline/SubtitleBar.qml @@ -124,7 +124,7 @@ Item { width: subtitle ? subtitle.width : 0 height: subtitle ? subtitle.height : 0 color: 'transparent' - border.color: 'red' + border.color: application.playheadColor } } } diff --git a/src/qml/views/timeline/TrackHead.qml b/src/qml/views/timeline/TrackHead.qml index 8883ac3452..5145a6161c 100644 --- a/src/qml/views/timeline/TrackHead.qml +++ b/src/qml/views/timeline/TrackHead.qml @@ -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' diff --git a/src/qml/views/timeline/timeline.qml b/src/qml/views/timeline/timeline.qml index c82e1347e9..642302aef2 100644 --- a/src/qml/views/timeline/timeline.qml +++ b/src/qml/views/timeline/timeline.qml @@ -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 @@ -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 } } @@ -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 diff --git a/src/qmltypes/qmlapplication.h b/src/qmltypes/qmlapplication.h index 92f4170de5..580bfc86a3 100644 --- a/src/qmltypes/qmlapplication.h +++ b/src/qmltypes/qmlapplication.h @@ -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) @@ -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(); diff --git a/src/qmltypes/timelineitems.cpp b/src/qmltypes/timelineitems.cpp index fa5745c6cb..e0e8cdb56a 100644 --- a/src/qmltypes/timelineitems.cpp +++ b/src/qmltypes/timelineitems.cpp @@ -20,6 +20,7 @@ #include "Logger.h" #include "mltcontroller.h" #include "models/multitrackmodel.h" +#include "qmltypes/qmlapplication.h" #include "qmltypes/qmlproducer.h" #include "settings.h" @@ -76,22 +77,58 @@ class TimelinePlayhead : public QQuickPaintedItem path.lineTo(width() / 2.0, height()); path.lineTo(0, 0); QPalette p; - painter->fillPath(path, p.color(QPalette::WindowText)); + painter->fillPath(path, QmlApplication::playheadColor()); } }; class TimelineTriangle : public QQuickPaintedItem { + Q_OBJECT + Q_PROPERTY(qreal cornerRadius READ cornerRadius WRITE setCornerRadius NOTIFY cornerRadiusChanged) + public: TimelineTriangle() { setAntialiasing(true); } + + qreal cornerRadius() const { return m_cornerRadius; } + + void setCornerRadius(qreal radius) + { + radius = qMax(0.0, radius); + if (qFuzzyCompare(m_cornerRadius, radius)) + return; + m_cornerRadius = radius; + emit cornerRadiusChanged(); + update(); + } + void paint(QPainter *painter) { + const qreal w = width(); + const qreal h = height(); + if (w <= 0.0 || h <= 0.0) + return; + + const qreal radius = qMin(m_cornerRadius, qMin(w, h)); QPainterPath path; - path.moveTo(0, 0); - path.lineTo(width(), 0); - path.lineTo(0, height()); + if (radius > 0.0) { + path.moveTo(0, h); + path.lineTo(0, radius); + path.quadTo(0, 0, radius, 0); + path.lineTo(w, 0); + } else { + path.moveTo(0, 0); + path.lineTo(w, 0); + path.lineTo(0, h); + } + path.closeSubpath(); painter->fillPath(path, Qt::black); } + +signals: + void cornerRadiusChanged(); + +private: + qreal m_cornerRadius{0.0}; }; class TimelineWaveform : public QQuickPaintedItem @@ -206,6 +243,8 @@ class TimelineWaveform : public QQuickPaintedItem fillPath.lineTo(lastX, height()); painter->fillPath(fillPath, m_color.lighter()); + // Stroke only the peaks outline, not the bottom closing line, so + // the dark horizontal edge does not fight the rounded clip corners. QPen pen(painter->pen()); pen.setColor(m_color.darker()); painter->strokePath(strokePath, pen); diff --git a/src/scrubbar.cpp b/src/scrubbar.cpp index 99eec3ca10..3070133cd4 100644 --- a/src/scrubbar.cpp +++ b/src/scrubbar.cpp @@ -18,6 +18,7 @@ #include "scrubbar.h" #include "mltcontroller.h" +#include "qmltypes/qmlapplication.h" #include "settings.h" #include @@ -203,6 +204,7 @@ bool ScrubBar::onSeek(int value) void ScrubBar::paintEvent(QPaintEvent *e) { QPen pen(QBrush(palette().text().color()), 2); + // QPen pen(QBrush(QmlApplication::playheadColor()), 2); QPainter p(this); QRect r = e->rect(); p.setClipRect(r); @@ -211,15 +213,16 @@ void ScrubBar::paintEvent(QPaintEvent *e) if (!isEnabled()) return; - // draw pointer + // draw playhead QPolygon pa(3); const int x = selectionSize / 2 - 1; int head = m_margin + m_cursorPosition; pa.setPoints(3, head - x - 1, 0, head + x, 0, head, x); - p.setBrush(palette().text().color()); + p.setBrush(QmlApplication::playheadColor()); p.setPen(Qt::NoPen); p.drawPolygon(pa); p.setPen(pen); + p.setPen(QPen(QBrush(QmlApplication::playheadColor()), 2)); if (m_head >= 0) { head = m_margin + m_head * m_scale; p.drawLine(head, 0, head, height() - 1); @@ -239,7 +242,7 @@ void ScrubBar::paintEvent(QPaintEvent *e) p.setPen(Qt::NoPen); p.drawPolygon(pa); p.setPen(pen); - p.drawLine(in, 0, in, selectionSize - 1); + p.drawLine(in, 0, in, selectionSize - 2); } // draw out point @@ -256,7 +259,7 @@ void ScrubBar::paintEvent(QPaintEvent *e) p.setPen(Qt::NoPen); p.drawPolygon(pa); p.setPen(pen); - p.drawLine(out, 0, out, selectionSize - 1); + p.drawLine(out, 0, out, selectionSize - 2); } } @@ -303,7 +306,7 @@ void ScrubBar::updatePixmap() if (m_in > -1 && m_out > m_in) { const int in = m_in * m_scale * ratio; const int out = m_out * m_scale * ratio; - p.fillRect(l_margin + in, 0, out - in, l_selectionSize, Qt::red); + p.fillRect(l_margin + in, 0, out - in, l_selectionSize, QmlApplication::playheadColor()); p.fillRect(l_margin + in + (2 + ratio), ratio, // 2 for the in point line out - in - 2 * (2 + ratio) - qFloor(0.5 * ratio), diff --git a/src/util.cpp b/src/util.cpp index 17d92eea47..78bcc56d48 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -92,22 +92,31 @@ void Util::setColorsToHighlight(QWidget *widget, QPalette::ColorRole role) { if (role == QPalette::Base) { widget->setStyleSheet("QLineEdit {" - "font-weight: bold;" - "background-color: palette(highlight);" - "color: palette(highlighted-text);" - "selection-background-color: palette(alternate-base);" - "selection-color: palette(text);" + " background-color: palette(highlight);" + " color: palette(highlighted-text);" + " selection-background-color: palette(alternate-base);" + " selection-color: palette(text);" + " font-weight: bold;" + " padding-top: 3px;" + " padding-bottom: 2px;" + " border-radius: 11px;" "}" "QLineEdit:hover {" - "border: 2px solid palette(button-text);" + " border: 2px solid palette(button-text);" "}"); } else { - QPalette palette = QApplication::palette(); - palette.setColor(role, palette.color(palette.Highlight)); - palette.setColor(role == QPalette::Button ? QPalette::ButtonText : QPalette::WindowText, - palette.color(palette.HighlightedText)); - widget->setPalette(palette); - widget->setAutoFillBackground(true); + const auto highlight = QPalette().color(QPalette::Highlight).name(); + const auto text = QPalette().color(QPalette::HighlightedText).name(); + const QString style = QString("QWidget {" + " background-color: %1;" + " color: %2;" + " font-weight: bold;" + " padding-top: 4px;" + " padding-bottom: 3px;" + " border-radius: 11px;" + "}") + .arg(highlight, text); + widget->setStyleSheet(style); } } diff --git a/src/widgets/newprojectfolder.cpp b/src/widgets/newprojectfolder.cpp index dc9e2bb807..c2bac6950e 100644 --- a/src/widgets/newprojectfolder.cpp +++ b/src/widgets/newprojectfolder.cpp @@ -290,18 +290,28 @@ void NewProjectFolder::on_recentListView_clicked(const QModelIndex &index) void NewProjectFolder::setColors() { - QPalette palette = ui->frame->palette(); - - palette.setColor(QPalette::WindowText, QPalette().color(QPalette::Highlight)); - ui->frame->setPalette(palette); - ui->frame_2->setPalette(palette); + const auto highlight = QPalette().color(QPalette::Highlight).name(); + const auto highlightedText = QPalette().color(QPalette::HighlightedText).name(); + const QString frameStyle = QString("QFrame#%1 { border: 4px solid %2; border-radius: 8px; }"); + ui->frame->setStyleSheet(frameStyle.arg("frame", highlight)); + ui->frame_2->setStyleSheet(frameStyle.arg("frame_2", highlight)); + + const QString labelStyle = QString("QLabel {" + " background-color: %1;" + " color: %2;" + " font-weight: bold;" + " margin: -4px -4px 0px -4px;" + " border-top-left-radius: 8px;" + " border-top-right-radius: 8px;" + "}") + .arg(highlight, highlightedText); + ui->newProjectLabel->setStyleSheet(labelStyle); + ui->newProjectLabel_2->setStyleSheet(labelStyle); + QPalette palette = ui->frame->palette(); palette.setColor(QPalette::WindowText, QPalette().color(QPalette::WindowText)); ui->widget->setPalette(palette); ui->widget_2->setPalette(palette); - - Util::setColorsToHighlight(ui->newProjectLabel); - Util::setColorsToHighlight(ui->newProjectLabel_2); } void NewProjectFolder::setProjectFolderButtonText(const QString &text) diff --git a/src/widgets/statuslabelwidget.cpp b/src/widgets/statuslabelwidget.cpp index 2f1e8e37b0..a6ba06fb58 100644 --- a/src/widgets/statuslabelwidget.cpp +++ b/src/widgets/statuslabelwidget.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Meltytech, LLC + * Copyright (c) 2022-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 @@ -65,6 +65,16 @@ StatusLabelWidget::StatusLabelWidget(QWidget *parent) connect(&m_timer, &QTimer::timeout, this, &StatusLabelWidget::onFadeOutFinished); } setLayout(m_layout); + + const auto highlight = QPalette().color(QPalette::Highlight).name(); + const auto text = QPalette().color(QPalette::HighlightedText).name(); + const QString style = QString("QWidget {" + " background-color: %1;" + " color: %2;" + " border-radius: 12px;" + "}") + .arg(highlight, text); + setStyleSheet(style); } StatusLabelWidget::~StatusLabelWidget() {}