m_clipMonitorDock->setObjectName("clip_monitor");
m_clipMonitor = new Monitor("clip", m_monitorManager, QString(), m_timelineArea);
m_clipMonitorDock->setWidget(m_clipMonitor);
- addDockWidget(Qt::TopDockWidgetArea, m_clipMonitorDock);
m_projectMonitorDock = new QDockWidget(i18n("Project Monitor"), this);
m_projectMonitorDock->setObjectName("project_monitor");
m_projectMonitor = new Monitor("project", m_monitorManager, QString());
m_projectMonitorDock->setWidget(m_projectMonitor);
- addDockWidget(Qt::TopDockWidgetArea, m_projectMonitorDock);
#ifndef Q_WS_MAC
m_recMonitorDock = new QDockWidget(i18n("Record Monitor"), this);
m_recMonitorDock->setObjectName("record_monitor");
m_recMonitor = new RecMonitor("record");
m_recMonitorDock->setWidget(m_recMonitor);
- addDockWidget(Qt::TopDockWidgetArea, m_recMonitorDock);
connect(m_recMonitor, SIGNAL(addProjectClip(KUrl)), this, SLOT(slotAddProjectClip(KUrl)));
connect(m_recMonitor, SIGNAL(showConfigDialog(int, int)), this, SLOT(slotPreferences(int, int)));
#endif
m_notesWidget = new KTextEdit();
m_notesWidget->setTabChangesFocus(true);
#if KDE_IS_VERSION(4,4,0)
- m_notesWidget->setClickMessage(i18n("Enter your project notes here..."));
+ m_notesWidget->setClickMessage(i18n("Enter your project notes here ..."));
#endif
m_notesDock->setWidget(m_notesWidget);
addDockWidget(Qt::TopDockWidgetArea, m_notesDock);
m_audiosignalDock->setObjectName("audiosignal");
m_audiosignalDock->setWidget(m_audiosignal);
addDockWidget(Qt::TopDockWidgetArea, m_audiosignalDock);
-// connect(m_audiosignal, SIGNAL(updateAudioMonitoring()), m_monitorManager, SLOT(slotUpdateAudioMonitoring()));
connect(m_audiosignalDock, SIGNAL(visibilityChanged(bool)), this, SLOT(slotUpdateAudioScopeFrameRequest()));
connect(m_audiosignal, SIGNAL(updateAudioMonitoring()), this, SLOT(slotUpdateAudioScopeFrameRequest()));
// Ensure connections were set up correctly
Q_ASSERT(b);
+
+
+ // Add monitors here to keep them at the right of the window
+ addDockWidget(Qt::TopDockWidgetArea, m_clipMonitorDock);
+ addDockWidget(Qt::TopDockWidgetArea, m_projectMonitorDock);
+#ifndef Q_WS_MAC
+ addDockWidget(Qt::TopDockWidgetArea, m_recMonitorDock);
+#endif
+
m_undoViewDock = new QDockWidget(i18n("Undo History"), this);
m_undoViewDock->setObjectName("undo_history");
m_undoView = new QUndoView();
m_undoView->setGroup(m_commandStack);
addDockWidget(Qt::TopDockWidgetArea, m_undoViewDock);
- //overviewDock = new QDockWidget(i18n("Project Overview"), this);
- //overviewDock->setObjectName("project_overview");
- //m_overView = new CustomTrackView(NULL, NULL, this);
- //overviewDock->setWidget(m_overView);
- //addDockWidget(Qt::TopDockWidgetArea, overviewDock);
-
setupActions();
+
+ // Close non-general docks for the initial layout
+ // only show important ones
+ m_histogramDock->close();
+ m_RGBParadeDock->close();
+ m_waveformDock->close();
+ m_vectorscopeDock->close();
+
+ m_audioSpectrumDock->close();
+ m_spectrogramDock->close();
+ m_audiosignalDock->close();
+
+ m_undoViewDock->close();
+
+
+
/// Tabify Widgets ///
- tabifyDockWidget(m_projectListDock, m_effectStackDock);
- tabifyDockWidget(m_projectListDock, m_transitionConfigDock);
+ tabifyDockWidget(m_effectListDock, m_effectStackDock);
+ tabifyDockWidget(m_effectListDock, m_transitionConfigDock);
tabifyDockWidget(m_projectListDock, m_notesDock);
-
tabifyDockWidget(m_clipMonitorDock, m_projectMonitorDock);
#ifndef Q_WS_MAC
tabifyDockWidget(m_clipMonitorDock, m_recMonitorDock);
#endif
- tabifyDockWidget(m_vectorscopeDock, m_waveformDock);
- tabifyDockWidget(m_vectorscopeDock, m_RGBParadeDock);
- tabifyDockWidget(m_vectorscopeDock, m_histogramDock);
- tabifyDockWidget(m_vectorscopeDock, m_undoViewDock);
- tabifyDockWidget(m_vectorscopeDock, m_effectListDock);
+
setCentralWidget(m_timelineArea);
action->setCheckable(true);
action->setChecked(false);
m_stopmotion_actions->addAction("stopmotion_overlay", action);
- setupGUI();
+ // Build effects menu
+ m_effectsMenu = new QMenu(i18n("Add Effect"));
+ m_effectActions = new KActionCategory(i18n("Effects"), actionCollection());
+ m_effectList->reloadEffectList(m_effectsMenu, m_effectActions);
+ m_effectsActionCollection->readSettings();
+
+ setupGUI();
// Find QDockWidget tab bars and show / hide widget title bars on right click
QList <QTabBar *> tabs = findChildren<QTabBar *>();
loadPlugins();
loadTranscoders();
- //kDebug() << factory() << " " << factory()->container("video_effects_menu", this);
m_projectMonitor->setupMenu(static_cast<QMenu*>(factory()->container("monitor_go", this)), m_playZone, m_loopZone, NULL, m_loopClip);
m_clipMonitor->setupMenu(static_cast<QMenu*>(factory()->container("monitor_go", this)), m_playZone, m_loopZone, static_cast<QMenu*>(factory()->container("marker_menu", this)));
connect(themesMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotChangePalette(QAction*)));
// Setup and fill effects and transitions menus.
- m_videoEffectsMenu = static_cast<QMenu*>(factory()->container("video_effects_menu", this));
- for (int i = 0; i < videoEffects.count(); ++i)
- m_videoEffectsMenu->addAction(m_videoEffects[i]);
- m_audioEffectsMenu = static_cast<QMenu*>(factory()->container("audio_effects_menu", this));
- for (int i = 0; i < audioEffects.count(); ++i)
- m_audioEffectsMenu->addAction(m_audioEffects[i]);
- m_customEffectsMenu = static_cast<QMenu*>(factory()->container("custom_effects_menu", this));
- if (customEffects.isEmpty())
- m_customEffectsMenu->setEnabled(false);
- else
- m_customEffectsMenu->setEnabled(true);
- for (int i = 0; i < customEffects.count(); ++i)
- m_customEffectsMenu->addAction(m_customEffects[i]);
+
+
+ QMenu *m = static_cast<QMenu*>(factory()->container("video_effects_menu", this));
+ m->addActions(m_effectsMenu->actions());
+
+
m_transitionsMenu = new QMenu(i18n("Add Transition"), this);
for (int i = 0; i < transitions.count(); ++i)
m_transitionsMenu->addAction(m_transitions[i]);
- connect(m_videoEffectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddVideoEffect(QAction *)));
- connect(m_audioEffectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddAudioEffect(QAction *)));
- connect(m_customEffectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddCustomEffect(QAction *)));
+ connect(m, SIGNAL(triggered(QAction *)), this, SLOT(slotAddVideoEffect(QAction *)));
+ connect(m_effectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddVideoEffect(QAction *)));
connect(m_transitionsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddTransition(QAction *)));
- QMenu *newEffect = new QMenu(this);
- newEffect->addMenu(m_videoEffectsMenu);
- newEffect->addMenu(m_audioEffectsMenu);
- newEffect->addMenu(m_customEffectsMenu);
- m_effectStack->setMenu(newEffect);
+ m_effectStack->setMenu(m_effectsMenu);
QMenu *viewMenu = static_cast<QMenu*>(factory()->container("dockwindows", this));
const QList<QAction *> viewActions = createPopupMenu()->actions();
m_timelineContextClipMenu->addMenu(markersMenu);
m_timelineContextClipMenu->addSeparator();
m_timelineContextClipMenu->addMenu(m_transitionsMenu);
- m_timelineContextClipMenu->addMenu(m_videoEffectsMenu);
- m_timelineContextClipMenu->addMenu(m_audioEffectsMenu);
- m_timelineContextClipMenu->addMenu(m_customEffectsMenu);
+ m_timelineContextClipMenu->addMenu(m_effectsMenu);
m_timelineContextTransitionMenu->addAction(actionCollection()->action("edit_item_duration"));
m_timelineContextTransitionMenu->addAction(actionCollection()->action("delete_item"));
delete m_projectMonitor;
delete m_clipMonitor;
delete m_shortcutRemoveFocus;
+ delete[] m_transitions;
Mlt::Factory::close();
}
void MainWindow::slotReloadEffects()
{
- m_customEffectsMenu->clear();
initEffects::parseCustomEffectsFile();
- QAction *action;
- QStringList effectInfo;
- QMap<QString, QStringList> effectsList;
- for (int ix = 0; ix < customEffects.count(); ix++) {
- effectInfo = customEffects.effectIdInfo(ix);
- effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
- }
- if (effectsList.isEmpty())
- m_customEffectsMenu->setEnabled(false);
- else
- m_customEffectsMenu->setEnabled(true);
-
- foreach(const QStringList & value, effectsList) {
- action = new QAction(value.at(0), this);
- action->setData(value);
- m_customEffectsMenu->addAction(action);
- }
- m_effectList->reloadEffectList();
+ m_effectList->reloadEffectList(m_effectsMenu, m_effectActions);
}
#ifndef NO_JOGSHUTTLE
connect(deleteAllClipMarkers, SIGNAL(triggered(bool)), this, SLOT(slotDeleteAllClipMarkers()));
KAction* editClipMarker = new KAction(KIcon("document-properties"), i18n("Edit Marker"), this);
+ editClipMarker->setData(QString("edit_marker"));
collection.addAction("edit_clip_marker", editClipMarker);
connect(editClipMarker, SIGNAL(triggered(bool)), this, SLOT(slotEditClipMarker()));
connect(maxCurrent, SIGNAL(triggered(bool)), this, SLOT(slotMaximizeCurrent(bool)));*/
m_closeAction = KStandardAction::close(this, SLOT(closeCurrentDocument()), collection);
- KStandardAction::quit(this, SLOT(close()), collection);
+ KStandardAction::quit(this, SLOT(close()), collection);
KStandardAction::open(this, SLOT(openFile()), collection);
m_saveAction = KStandardAction::save(this, SLOT(saveFile()), collection);
KStandardAction::saveAs(this, SLOT(saveFileAs()), collection);
// Setup effects and transitions actions.
m_effectsActionCollection = new KActionCollection(this, KGlobal::mainComponent());
- //KActionCategory *videoEffectActions = new KActionCategory(i18n("Video Effects"), m_effectsActionCollection);
- KActionCategory *videoEffectActions = new KActionCategory(i18n("Video Effects"), collection);
- m_videoEffects = new KAction*[videoEffects.count()];
- for (int i = 0; i < videoEffects.count(); ++i) {
- QStringList effectInfo = videoEffects.effectIdInfo(i);
- m_videoEffects[i] = new KAction(KIcon("kdenlive-show-video"), effectInfo.at(0), this);
- m_videoEffects[i]->setData(effectInfo);
- m_videoEffects[i]->setIconVisibleInMenu(false);
- videoEffectActions->addAction("video_effect_" + effectInfo.at(0), m_videoEffects[i]);
- }
- //KActionCategory *audioEffectActions = new KActionCategory(i18n("Audio Effects"), m_effectsActionCollection);
- KActionCategory *audioEffectActions = new KActionCategory(i18n("Audio Effects"), collection);
- m_audioEffects = new KAction*[audioEffects.count()];
- for (int i = 0; i < audioEffects.count(); ++i) {
- QStringList effectInfo = audioEffects.effectIdInfo(i);
- m_audioEffects[i] = new KAction(KIcon("kdenlive-show-audio"), effectInfo.at(0), this);
- m_audioEffects[i]->setData(effectInfo);
- m_audioEffects[i]->setIconVisibleInMenu(false);
- audioEffectActions->addAction("audio_effect_" + effectInfo.at(0), m_audioEffects[i]);
- }
- //KActionCategory *customEffectActions = new KActionCategory(i18n("Custom Effects"), m_effectsActionCollection);
- KActionCategory *customEffectActions = new KActionCategory(i18n("Custom Effects"), collection);
- m_customEffects = new KAction*[customEffects.count()];
- for (int i = 0; i < customEffects.count(); ++i) {
- QStringList effectInfo = customEffects.effectIdInfo(i);
- m_customEffects[i] = new KAction(KIcon("kdenlive-custom-effect"), effectInfo.at(0), this);
- m_customEffects[i]->setData(effectInfo);
- m_customEffects[i]->setIconVisibleInMenu(false);
- customEffectActions->addAction("custom_effect_" + effectInfo.at(0), m_customEffects[i]);
- }
//KActionCategory *transitionActions = new KActionCategory(i18n("Transitions"), m_effectsActionCollection);
KActionCategory *transitionActions = new KActionCategory(i18n("Transitions"), collection);
m_transitions = new KAction*[transitions.count()];
m_transitions[i] = new KAction(effectInfo.at(0), this);
m_transitions[i]->setData(effectInfo);
m_transitions[i]->setIconVisibleInMenu(false);
- transitionActions->addAction("transition_" + effectInfo.at(0), m_transitions[i]);
+ QString id = effectInfo.at(2);
+ if (id.isEmpty()) id = effectInfo.at(1);
+ transitionActions->addAction("transition_" + id, m_transitions[i]);
}
- m_effectsActionCollection->readSettings();
+ //m_effectsActionCollection->readSettings();
//connect(collection, SIGNAL( clearStatusText() ),
//statusBar(), SLOT( clear() ) );
QString currentSceneList;
m_monitorManager->stopActiveMonitor();
- if (m_activeDocument->saveSceneList(outputFileName, m_projectMonitor->sceneList()) == false)
+ if (m_activeDocument->saveSceneList(outputFileName, m_projectMonitor->sceneList(), m_projectList->expandedFolders()) == false)
return false;
// Save timeline thumbnails
m_activeDocument->setDocumentProperty("proxyparams", w->proxyParams());
if (m_activeDocument->clipManager()->clipsCount() > 0 && KMessageBox::questionYesNo(this, i18n("You have changed the proxy parameters. Do you want to recreate all proxy clips for this project?")) == KMessageBox::Yes) {
//TODO: rebuild all proxies
- //m_activeDocument->rebuildAllProxies();
+ //m_projectList->rebuildProxies();
}
}
if (m_activeDocument->getDocumentProperty("proxyextension") != w->proxyExtension()) {
disconnect(m_activeDocument, SIGNAL(updateClipDisplay(const QString &)), m_projectList, SLOT(slotUpdateClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(selectLastAddedClip(const QString &)), m_projectList, SLOT(slotSelectClip(const QString &)));
disconnect(m_activeDocument, SIGNAL(deleteTimelineClip(const QString &)), m_activeTimeline, SLOT(slotDeleteClip(const QString &)));
- disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), m_effectStack, SLOT(slotClipItemSelected(ClipItem*, int)));
- disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), this, SLOT(slotActivateEffectStackView()));
- disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), m_projectMonitor, SLOT(slotSetSelectedClip(ClipItem*)));
+ disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_effectStack, SLOT(slotClipItemSelected(ClipItem*, int)));
+ disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), this, SLOT(slotActivateEffectStackView(ClipItem*, int, bool)));
+ disconnect(m_activeTimeline->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_projectMonitor, SLOT(slotSetSelectedClip(ClipItem*)));
disconnect(m_activeTimeline->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), m_transitionConfig, SLOT(slotTransitionItemSelected(Transition*, int, QPoint, bool)));
disconnect(m_activeTimeline->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), this, SLOT(slotActivateTransitionView(Transition *)));
disconnect(m_activeTimeline->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), m_projectMonitor, SLOT(slotSetSelectedClip(Transition*)));
connect(doc, SIGNAL(guidesUpdated()), this, SLOT(slotGuidesUpdated()));
connect(m_notesWidget, SIGNAL(textChanged()), doc, SLOT(setModified()));
- connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), m_effectStack, SLOT(slotClipItemSelected(ClipItem*, int)));
+ connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_effectStack, SLOT(slotClipItemSelected(ClipItem*, int)));
connect(trackView->projectView(), SIGNAL(updateClipMarkers(DocClipBase *)), this, SLOT(slotUpdateClipMarkers(DocClipBase*)));
connect(trackView, SIGNAL(showTrackEffects(int, TrackInfo)), m_effectStack, SLOT(slotTrackItemSelected(int, TrackInfo)));
connect(trackView, SIGNAL(showTrackEffects(int, TrackInfo)), this, SLOT(slotActivateEffectStackView()));
- connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), this, SLOT(slotActivateEffectStackView()));
+ connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), this, SLOT(slotActivateEffectStackView(ClipItem*, int, bool)));
connect(trackView->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), m_transitionConfig, SLOT(slotTransitionItemSelected(Transition*, int, QPoint, bool)));
connect(trackView->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), this, SLOT(slotActivateTransitionView(Transition *)));
m_zoomSlider->setValue(doc->zoom().x());
connect(trackView->projectView(), SIGNAL(showClipFrame(DocClipBase *, QPoint, const int)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *, QPoint, const int)));
connect(trackView->projectView(), SIGNAL(playMonitor()), m_projectMonitor, SLOT(slotPlay()));
- connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int)), m_projectMonitor, SLOT(slotSetSelectedClip(ClipItem*)));
+ connect(trackView->projectView(), SIGNAL(clipItemSelected(ClipItem*, int, bool)), m_projectMonitor, SLOT(slotSetSelectedClip(ClipItem*)));
connect(trackView->projectView(), SIGNAL(transitionItemSelected(Transition*, int, QPoint, bool)), m_projectMonitor, SLOT(slotSetSelectedClip(Transition*)));
connect(m_effectStack, SIGNAL(updateEffect(ClipItem*, int, QDomElement, QDomElement, int)), trackView->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, int, QDomElement, QDomElement, int)));
void MainWindow::slotAddVideoEffect(QAction *result)
{
if (!result) return;
+ const int EFFECT_VIDEO = 1;
+ const int EFFECT_AUDIO = 2;
QStringList info = result->data().toStringList();
- if (info.isEmpty()) return;
- QDomElement effect = videoEffects.getEffectByTag(info.at(1), info.at(2));
- slotAddEffect(effect);
-}
-void MainWindow::slotAddAudioEffect(QAction *result)
-{
- if (!result) return;
- QStringList info = result->data().toStringList();
- if (info.isEmpty()) return;
- QDomElement effect = audioEffects.getEffectByTag(info.at(1), info.at(2));
- slotAddEffect(effect);
+ if (info.isEmpty() || info.size() < 3) return;
+ QDomElement effect ;
+ if (info.at(2) == QString::number((int) EFFECT_VIDEO))
+ effect = videoEffects.getEffectByTag(info.at(0), info.at(1));
+ else if (info.at(2) == QString::number((int) EFFECT_AUDIO))
+ effect = audioEffects.getEffectByTag(info.at(0), info.at(1));
+ else
+ effect = customEffects.getEffectByTag(info.at(0), info.at(1));
+ if (!effect.isNull()) slotAddEffect(effect);
+ else m_messageLabel->setMessage(i18n("Cannot find effect %1 / %2").arg(info.at(0)).arg(info.at(1)), ErrorMessage);
}
-void MainWindow::slotAddCustomEffect(QAction *result)
-{
- if (!result) return;
- QStringList info = result->data().toStringList();
- if (info.isEmpty()) return;
- QDomElement effect = customEffects.getEffectByTag(info.at(1), info.at(2));
- slotAddEffect(effect);
-}
void MainWindow::slotZoomIn()
{
if (dia_ui->outPoint() != clip->duration().frames(m_activeDocument->fps()) - 1) {
// duration changed, we need to update duration
newprops.insert("out", QString::number(dia_ui->outPoint()));
+ int currentLength = QString(clip->producerProperty("length")).toInt();
+ if (currentLength <= dia_ui->outPoint())
+ newprops.insert("length", QString::number(dia_ui->outPoint() + 1));
+ else newprops.insert("length", clip->producerProperty("length"));
}
if (!path.isEmpty()) {
// we are editing an external file, asked if we want to detach from that file or save the result to that title file.
if (e->type() == QEvent::User)
m_messageLabel->setMessage(static_cast <MltErrorEvent *>(e)->message(), MltError);
}
-void MainWindow::slotActivateEffectStackView()
+void MainWindow::slotActivateEffectStackView(ClipItem*, int, bool raise)
{
- m_effectStack->raiseWindow(m_effectStackDock);
+ if (raise) m_effectStack->raiseWindow(m_effectStackDock);
}
void MainWindow::slotActivateTransitionView(Transition *t)
// Do we want proxy rendering
if (m_projectList->useProxy() && !m_renderWidget->proxyRendering()) {
+ QDomDocument doc;
+ doc.setContent(playlistContent);
+ QString root = doc.documentElement().attribute("root");
+
// replace proxy clips with originals
QMap <QString, QString> proxies = m_projectList->getProxies();
QMapIterator<QString, QString> i(proxies);
while (i.hasNext()) {
i.next();
// Replace all keys with their values (proxy path with original path)
- playlistContent.replace(i.key(), i.value());
+ QString key = i.key();
+ playlistContent.replace(key, i.value());
+ if (!root.isEmpty() && key.startsWith(root)) {
+ // in case ther resource path in MLT playlist is relative
+ key.remove(0, root.count() + 1);
+ playlistContent.replace(key, i.value());
+ }
}
}
else theme = action->data().toString();
KdenliveSettings::setColortheme(theme);
// Make palette for all widgets.
- QPalette plt;
- if (theme.isEmpty())
+ QPalette plt = kapp->palette();
+ if (theme.isEmpty()) {
plt = QApplication::desktop()->palette();
- else {
+ } else {
KSharedConfigPtr config = KSharedConfig::openConfig(theme);
- plt = KGlobalSettings::createApplicationPalette(config);
+
+ // Since there currently is a bug (or feature change) in KGlobalSettings::createApplicationPalette, we need
+ // to do the palette loading stuff ourselves...
+ //plt = KGlobalSettings::createApplicationPalette(config);
+
+ QPalette::ColorGroup states[3] = { QPalette::Active, QPalette::Inactive,
+ QPalette::Disabled };
+ // TT thinks tooltips shouldn't use active, so we use our active colors for all states
+ KColorScheme schemeTooltip(QPalette::Active, KColorScheme::Tooltip, config);
+
+ for ( int i = 0; i < 3 ; i++ ) {
+ QPalette::ColorGroup state = states[i];
+ KColorScheme schemeView(state, KColorScheme::View, config);
+ KColorScheme schemeWindow(state, KColorScheme::Window, config);
+ KColorScheme schemeButton(state, KColorScheme::Button, config);
+ KColorScheme schemeSelection(state, KColorScheme::Selection, config);
+
+ plt.setBrush( state, QPalette::WindowText, schemeWindow.foreground() );
+ plt.setBrush( state, QPalette::Window, schemeWindow.background() );
+ plt.setBrush( state, QPalette::Base, schemeView.background() );
+ plt.setBrush( state, QPalette::Text, schemeView.foreground() );
+ plt.setBrush( state, QPalette::Button, schemeButton.background() );
+ plt.setBrush( state, QPalette::ButtonText, schemeButton.foreground() );
+ plt.setBrush( state, QPalette::Highlight, schemeSelection.background() );
+ plt.setBrush( state, QPalette::HighlightedText, schemeSelection.foreground() );
+ plt.setBrush( state, QPalette::ToolTipBase, schemeTooltip.background() );
+ plt.setBrush( state, QPalette::ToolTipText, schemeTooltip.foreground() );
+
+ plt.setColor( state, QPalette::Light, schemeWindow.shade( KColorScheme::LightShade ) );
+ plt.setColor( state, QPalette::Midlight, schemeWindow.shade( KColorScheme::MidlightShade ) );
+ plt.setColor( state, QPalette::Mid, schemeWindow.shade( KColorScheme::MidShade ) );
+ plt.setColor( state, QPalette::Dark, schemeWindow.shade( KColorScheme::DarkShade ) );
+ plt.setColor( state, QPalette::Shadow, schemeWindow.shade( KColorScheme::ShadowShade ) );
+
+ plt.setBrush( state, QPalette::AlternateBase, schemeView.background( KColorScheme::AlternateBackground) );
+ plt.setBrush( state, QPalette::Link, schemeView.foreground( KColorScheme::LinkText ) );
+ plt.setBrush( state, QPalette::LinkVisited, schemeView.foreground( KColorScheme::VisitedText ) );
+ }
}
-
kapp->setPalette(plt);
const QObjectList children = statusBar()->children();