X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fdvdwizardmenu.cpp;h=625754c6b24bef9aced3391d5b6a314d9a9edfe0;hb=734a2ab657a472fba50202160d47261e97155078;hp=e9c68835464bab781fb3263e9b9fd962c049ccb5;hpb=64008a1e158de53a36ec9de041155d07e53cbb16;p=kdenlive diff --git a/src/dvdwizardmenu.cpp b/src/dvdwizardmenu.cpp index e9c68835..625754c6 100644 --- a/src/dvdwizardmenu.cpp +++ b/src/dvdwizardmenu.cpp @@ -18,6 +18,7 @@ ***************************************************************************/ #include "dvdwizardmenu.h" +#include "kdenlivesettings.h" #include #include @@ -111,7 +112,7 @@ DvdWizardMenu::DvdWizardMenu(const QString &profile, QWidget *parent) : connect(m_scene, SIGNAL(changed(const QList &)), this, SIGNAL(completeChanged())); // red background for error message - KColorScheme scheme(palette().currentColorGroup(), KColorScheme::Window); + KColorScheme scheme(palette().currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme())); QPalette p = m_view.error_message->palette(); p.setColor(QPalette::Background, scheme.background(KColorScheme::NegativeBackground).color()); m_view.error_message->setAutoFillBackground(true); @@ -276,14 +277,11 @@ void DvdWizardMenu::changeProfile(bool isPal) if (isPal == false) { m_width = 720; m_height = 480; - m_isPal = false; - updatePreview(); } else { m_width = 720; m_height = 576; - m_isPal = true; - updatePreview(); } + updatePreview(); } void DvdWizardMenu::updatePreview() @@ -425,69 +423,54 @@ void DvdWizardMenu::createButtonImages(const QString &img1, const QString &img2, { if (m_view.create_menu->isChecked()) { m_scene->clearSelection(); - QImage img(m_width, m_height, QImage::Format_ARGB32_Premultiplied); - img.fill(Qt::transparent); if (m_safeRect->scene() != 0) m_scene->removeItem(m_safeRect); if (m_color->scene() != 0) m_scene->removeItem(m_color); if (m_background->scene() != 0) m_scene->removeItem(m_background); + + QImage img(m_width, m_height, QImage::Format_Mono); + img.fill(Qt::white); + updateColor(Qt::black); QPainter p(&img); p.setRenderHints(QPainter::Antialiasing, false); p.setRenderHints(QPainter::TextAntialiasing, false); m_scene->render(&p, QRectF(0, 0, m_width, m_height)); p.end(); #if QT_VERSION >= 0x040600 - img.setColorCount(4); + img.setColor(0, m_view.text_color->color().rgb()); + img.setColor(1, qRgba(0,0,0,0)); #else img.setNumColors(4); #endif img.save(img1); - /*QImage saved; - if (m_view.menu_profile->currentIndex() < 2) - saved = img.scaled(720, 576); - else saved = img.scaled(720, 480); - saved.setNumColors(4); - saved.save(img1);*/ - - updateColor(m_view.selected_color->color()); - img.fill(Qt::transparent); + img.fill(Qt::white); p.begin(&img); p.setRenderHints(QPainter::Antialiasing, false); p.setRenderHints(QPainter::TextAntialiasing, false); m_scene->render(&p, QRectF(0, 0, m_width, m_height)); p.end(); - /* if (m_view.menu_profile->currentIndex() < 2) - saved = img.scaled(720, 576); - else saved = img.scaled(720, 480); - saved.setNumColors(4); - saved.save(img2);*/ #if QT_VERSION >= 0x040600 - img.setColorCount(4); + img.setColor(0, m_view.highlighted_color->color().rgb()); + img.setColor(1, qRgba(0,0,0,0)); #else img.setNumColors(4); #endif - img.save(img2); - + img.save(img3); - updateColor(m_view.highlighted_color->color()); - img.fill(Qt::transparent); + img.fill(Qt::white); p.begin(&img); p.setRenderHints(QPainter::Antialiasing, false); p.setRenderHints(QPainter::TextAntialiasing, false); m_scene->render(&p, QRectF(0, 0, m_width, m_height)); p.end(); - /*if (m_view.menu_profile->currentIndex() < 2) - saved = img.scaled(720, 576); - else saved = img.scaled(720, 480); - saved.setNumColors(4); - saved.save(img3);*/ + #if QT_VERSION >= 0x040600 - img.setColorCount(4); + img.setColor(0, m_view.selected_color->color().rgb()); + img.setColor(1, qRgba(0,0,0,0)); #else img.setNumColors(4); #endif - img.save(img3); - + img.save(img2); updateColor(); m_scene->addItem(m_safeRect); @@ -657,7 +640,6 @@ void DvdWizardMenu::loadXml(QDomElement xml) button->setBackMenu(e.attribute("backtomenu").toInt()); button->setDefaultTextColor(m_view.text_color->color()); button->setZValue(4); - QRectF r = button->sceneBoundingRect(); m_scene->addItem(button); button->setPos(e.attribute("posx").toDouble(), e.attribute("posy").toDouble());