Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix Qml not following color theme change, and crash on unselect bin clip

parent 8def93d9
......@@ -219,7 +219,6 @@ Rectangle {
Layout.fillWidth: true
alternatingRowColors: false
headerVisible: false
backgroundVisible:false
selection: sel
selectionMode: SelectionMode.SingleSelection
itemDelegate: Rectangle {
......
......@@ -629,9 +629,9 @@ void MainWindow::slotThemeChanged(const QString &theme)
{
disconnect(this, &MainWindow::reloadTheme, this, &MainWindow::slotReloadTheme);
KSharedConfigPtr config = KSharedConfig::openConfig(theme);
setPalette(KColorScheme::createApplicationPalette(config));
qApp->setPalette(palette());
QPalette plt = palette();
QPalette plt = KColorScheme::createApplicationPalette(config);
setPalette(plt);
QGuiApplication::setPalette(plt);
KdenliveSettings::setColortheme(theme);
if (m_assetPanel) {
......
......@@ -116,6 +116,8 @@ GLWidget::GLWidget(int id, QObject *parent)
m_monitorProfile = new Mlt::Profile();
m_refreshTimer.setSingleShot(true);
m_refreshTimer.setInterval(50);
m_blackClip.reset(new Mlt::Producer(*m_monitorProfile, "color:black"));
m_blackClip->set("kdenlive:id", "black");
connect(&m_refreshTimer, &QTimer::timeout, this, &GLWidget::refresh);
if (KdenliveSettings::gpu_accel()) {
......@@ -1057,6 +1059,7 @@ int GLWidget::reconfigure(Mlt::Profile *profile)
if (profile) {
reloadProfile(*profile);
m_blackClip.reset(new Mlt::Producer(*profile, "color:black"));
m_blackClip->set("kdenlive:id", "black");
}
if ((m_consumer == nullptr) || !m_consumer->is_valid() || strcmp(m_consumer->get("mlt_service"), "multi") == 0) {
if (m_consumer) {
......@@ -1748,7 +1751,7 @@ bool GLWidget::setProducer(Mlt::Producer *producer, int position, bool isActive)
QMutexLocker locker(&m_mutex);
QString currentId;
int consumerPosition = 0;
if ((producer == nullptr) && (m_producer != nullptr) && m_producer->parent().get("id") == QLatin1String("black")) {
if ((producer == nullptr) && (m_producer != nullptr) && m_producer->parent().get("kdenlive:id") == QLatin1String("black")) {
// Black clip already displayed no need to refresh
return true;
}
......@@ -1773,7 +1776,7 @@ bool GLWidget::setProducer(Mlt::Producer *producer, int position, bool isActive)
consumerPosition = m_consumer->position();
}
if ((producer == nullptr) || !producer->is_valid()) {
producer = m_blackClip->cut(0, 1);
producer = m_blackClip.data()->cut(0, 1);
}
if (position == -1 && producer->get("kdenlive:id") == currentId) {
......
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