Changeset View
Changeset View
Standalone View
Standalone View
src/mainwindow.cpp
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Line(s) | 153 | { | |||
---|---|---|---|---|---|
165 | // Widget themes for non KDE users | 165 | // Widget themes for non KDE users | ||
166 | KActionMenu *stylesAction = new KActionMenu(i18n("Style"), this); | 166 | KActionMenu *stylesAction = new KActionMenu(i18n("Style"), this); | ||
167 | auto *stylesGroup = new QActionGroup(stylesAction); | 167 | auto *stylesGroup = new QActionGroup(stylesAction); | ||
168 | 168 | | |||
169 | // GTK theme does not work well with Kdenlive, and does not support color theming, so avoid it | 169 | // GTK theme does not work well with Kdenlive, and does not support color theming, so avoid it | ||
170 | QStringList availableStyles = QStyleFactory::keys(); | 170 | QStringList availableStyles = QStyleFactory::keys(); | ||
171 | if (KdenliveSettings::widgetstyle().isEmpty()) { | 171 | if (KdenliveSettings::widgetstyle().isEmpty()) { | ||
172 | // First run | 172 | // First run | ||
173 | QStringList incompatibleStyles; | 173 | QStringList incompatibleStyles = {QStringLiteral("GTK+"), QStringLiteral("windowsvista"), QStringLiteral("windowsxp")}; | ||
174 | incompatibleStyles << QStringLiteral("GTK+") << QStringLiteral("windowsvista") << QStringLiteral("windowsxp"); | 174 | | ||
175 | if (incompatibleStyles.contains(desktopStyle, Qt::CaseInsensitive)) { | 175 | if (incompatibleStyles.contains(desktopStyle, Qt::CaseInsensitive)) { | ||
176 | if (availableStyles.contains(QStringLiteral("breeze"), Qt::CaseInsensitive)) { | 176 | if (availableStyles.contains(QStringLiteral("breeze"), Qt::CaseInsensitive)) { | ||
177 | // Auto switch to Breeze theme | 177 | // Auto switch to Breeze theme | ||
178 | KdenliveSettings::setWidgetstyle(QStringLiteral("Breeze")); | 178 | KdenliveSettings::setWidgetstyle(QStringLiteral("Breeze")); | ||
179 | } else if (availableStyles.contains(QStringLiteral("fusion"), Qt::CaseInsensitive)) { | 179 | } else if (availableStyles.contains(QStringLiteral("fusion"), Qt::CaseInsensitive)) { | ||
180 | KdenliveSettings::setWidgetstyle(QStringLiteral("Fusion")); | 180 | KdenliveSettings::setWidgetstyle(QStringLiteral("Fusion")); | ||
181 | } | 181 | } | ||
182 | } else { | 182 | } else { | ||
▲ Show 20 Lines • Show All 244 Lines • ▼ Show 20 Line(s) | |||||
427 | auto *previewButtonAction = new QWidgetAction(this); | 427 | auto *previewButtonAction = new QWidgetAction(this); | ||
428 | previewButtonAction->setText(i18n("Timeline Preview")); | 428 | previewButtonAction->setText(i18n("Timeline Preview")); | ||
429 | previewButtonAction->setIcon(QIcon::fromTheme(QStringLiteral("preview-render-on"))); | 429 | previewButtonAction->setIcon(QIcon::fromTheme(QStringLiteral("preview-render-on"))); | ||
430 | previewButtonAction->setDefaultWidget(timelinePreview); | 430 | previewButtonAction->setDefaultWidget(timelinePreview); | ||
431 | addAction(QStringLiteral("timeline_preview_button"), previewButtonAction); | 431 | addAction(QStringLiteral("timeline_preview_button"), previewButtonAction); | ||
432 | 432 | | |||
433 | setupGUI(KXmlGuiWindow::ToolBar | KXmlGuiWindow::StatusBar | KXmlGuiWindow::Save | KXmlGuiWindow::Create); | 433 | setupGUI(KXmlGuiWindow::ToolBar | KXmlGuiWindow::StatusBar | KXmlGuiWindow::Save | KXmlGuiWindow::Create); | ||
434 | if (firstRun) { | 434 | if (firstRun) { | ||
435 | QScreen *current = QApplication::primaryScreen(); | 435 | if (QScreen *current = QApplication::primaryScreen()) { | ||
436 | if (current) { | | |||
437 | if (current->availableSize().height() < 1000) { | 436 | if (current->availableSize().height() < 1000) { | ||
438 | resize(current->availableSize()); | 437 | resize(current->availableSize()); | ||
439 | } else { | 438 | } else { | ||
440 | resize(current->availableSize() / 1.5); | 439 | resize(current->availableSize() / 1.5); | ||
441 | } | 440 | } | ||
442 | } | 441 | } | ||
443 | } | 442 | } | ||
444 | updateActionsToolTip(); | 443 | updateActionsToolTip(); | ||
▲ Show 20 Lines • Show All 1038 Lines • ▼ Show 20 Line(s) | 1481 | addAction(QStringLiteral("switch_track_lock"), i18n("Toggle Track Lock"), pCore->projectManager(), SLOT(slotSwitchTrackLock()), QIcon(), | |||
1483 | Qt::SHIFT + Qt::Key_L); | 1482 | Qt::SHIFT + Qt::Key_L); | ||
1484 | addAction(QStringLiteral("switch_all_track_lock"), i18n("Toggle All Track Lock"), pCore->projectManager(), SLOT(slotSwitchAllTrackLock()), QIcon(), | 1483 | addAction(QStringLiteral("switch_all_track_lock"), i18n("Toggle All Track Lock"), pCore->projectManager(), SLOT(slotSwitchAllTrackLock()), QIcon(), | ||
1485 | Qt::CTRL + Qt::SHIFT + Qt::Key_L); | 1484 | Qt::CTRL + Qt::SHIFT + Qt::Key_L); | ||
1486 | addAction(QStringLiteral("switch_track_target"), i18n("Toggle Track Target"), pCore->projectManager(), SLOT(slotSwitchTrackTarget()), QIcon(), | 1485 | addAction(QStringLiteral("switch_track_target"), i18n("Toggle Track Target"), pCore->projectManager(), SLOT(slotSwitchTrackTarget()), QIcon(), | ||
1487 | Qt::SHIFT + Qt::Key_T); | 1486 | Qt::SHIFT + Qt::Key_T); | ||
1488 | 1487 | | |||
1489 | addAction(QStringLiteral("add_project_note"), i18n("Add Project Note"), pCore->projectManager(), SLOT(slotAddProjectNote()), QIcon::fromTheme(QStringLiteral("bookmark"))); | 1488 | addAction(QStringLiteral("add_project_note"), i18n("Add Project Note"), pCore->projectManager(), SLOT(slotAddProjectNote()), QIcon::fromTheme(QStringLiteral("bookmark"))); | ||
1490 | 1489 | | |||
1491 | QHash<QString, QAction *> actions; | 1490 | QHash<QString, QAction *> actions({ | ||
1492 | actions.insert(QStringLiteral("locate"), locateClip); | 1491 | { QStringLiteral("locate"), locateClip }, | ||
1493 | actions.insert(QStringLiteral("reload"), reloadClip); | 1492 | { QStringLiteral("reload"), reloadClip }, | ||
1494 | actions.insert(QStringLiteral("duplicate"), duplicateClip); | 1493 | { QStringLiteral("duplicate"), duplicateClip }, | ||
1495 | actions.insert(QStringLiteral("proxy"), proxyClip); | 1494 | { QStringLiteral("proxy"), proxyClip }, | ||
1496 | actions.insert(QStringLiteral("properties"), clipProperties); | 1495 | { QStringLiteral("properties"), clipProperties }, | ||
1497 | actions.insert(QStringLiteral("open"), openClip); | 1496 | { QStringLiteral("open"), openClip }, | ||
1498 | actions.insert(QStringLiteral("delete"), deleteClip); | 1497 | { QStringLiteral("delete"), deleteClip }, | ||
1499 | actions.insert(QStringLiteral("folder"), addFolder); | 1498 | { QStringLiteral("folder"), addFolder } | ||
1499 | }); | ||||
1500 | | ||||
1500 | pCore->bin()->setupMenu(addClips, addClip, actions); | 1501 | pCore->bin()->setupMenu(addClips, addClip, actions); | ||
1501 | 1502 | | |||
1502 | // Setup effects and transitions actions. | 1503 | // Setup effects and transitions actions. | ||
1503 | KActionCategory *transitionActions = new KActionCategory(i18n("Transitions"), actionCollection()); | 1504 | KActionCategory *transitionActions = new KActionCategory(i18n("Transitions"), actionCollection()); | ||
1504 | // m_transitions = new QAction*[transitions.count()]; | 1505 | // m_transitions = new QAction*[transitions.count()]; | ||
1505 | auto allTransitions = TransitionsRepository::get()->getNames(); | 1506 | auto allTransitions = TransitionsRepository::get()->getNames(); | ||
1506 | for (const auto &transition : allTransitions) { | 1507 | for (const auto &transition : allTransitions) { | ||
1507 | auto *transAction = new QAction(transition.first, this); | 1508 | auto *transAction = new QAction(transition.first, this); | ||
▲ Show 20 Lines • Show All 2283 Lines • Show Last 20 Lines |