Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/KisMainWindow.cpp
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Line(s) | |||||
132 | #include "KisViewManager.h" | 132 | #include "KisViewManager.h" | ||
133 | #include "thememanager.h" | 133 | #include "thememanager.h" | ||
134 | #include "kis_animation_importer.h" | 134 | #include "kis_animation_importer.h" | ||
135 | #include "dialogs/kis_dlg_import_image_sequence.h" | 135 | #include "dialogs/kis_dlg_import_image_sequence.h" | ||
136 | #include "kis_animation_exporter.h" | 136 | #include "kis_animation_exporter.h" | ||
137 | 137 | | |||
138 | #include <mutex> | 138 | #include <mutex> | ||
139 | 139 | | |||
140 | #ifdef Q_OS_WIN | ||||
141 | #include <QtPlatformHeaders\QWindowsWindowFunctions> | ||||
rempt: This will break when cross-compiling, I'm afraid, because of the \ vs / | |||||
142 | #endif | ||||
140 | 143 | | |||
141 | class ToolDockerFactory : public KoDockFactoryBase | 144 | class ToolDockerFactory : public KoDockFactoryBase | ||
142 | { | 145 | { | ||
143 | public: | 146 | public: | ||
144 | ToolDockerFactory() : KoDockFactoryBase() { } | 147 | ToolDockerFactory() : KoDockFactoryBase() { } | ||
145 | 148 | | |||
146 | QString id() const { | 149 | QString id() const { | ||
147 | return "sharedtooldocker"; | 150 | return "sharedtooldocker"; | ||
▲ Show 20 Lines • Show All 342 Lines • ▼ Show 20 Line(s) | 464 | #endif | |||
490 | plugActionList("toolbarlist", toolbarList); | 493 | plugActionList("toolbarlist", toolbarList); | ||
491 | setToolbarList(toolbarList); | 494 | setToolbarList(toolbarList); | ||
492 | 495 | | |||
493 | applyToolBarLayout(); | 496 | applyToolBarLayout(); | ||
494 | 497 | | |||
495 | d->viewManager->updateGUI(); | 498 | d->viewManager->updateGUI(); | ||
496 | d->viewManager->updateIcons(); | 499 | d->viewManager->updateIcons(); | ||
497 | 500 | | |||
501 | #ifdef Q_OS_WIN | ||||
502 | auto w = qApp->activeWindow(); | ||||
503 | if (w) QWindowsWindowFunctions::setHasBorderInFullScreen(w->windowHandle(), true); | ||||
504 | #endif | ||||
505 | | ||||
498 | QTimer::singleShot(1000, this, SLOT(checkSanity())); | 506 | QTimer::singleShot(1000, this, SLOT(checkSanity())); | ||
499 | 507 | | |||
500 | { | 508 | { | ||
501 | using namespace std::placeholders; // For _1 placeholder | 509 | using namespace std::placeholders; // For _1 placeholder | ||
502 | std::function<void (int)> callback( | 510 | std::function<void (int)> callback( | ||
503 | std::bind(&KisMainWindow::switchTab, this, _1)); | 511 | std::bind(&KisMainWindow::switchTab, this, _1)); | ||
504 | 512 | | |||
505 | d->tabSwitchCompressor.reset( | 513 | d->tabSwitchCompressor.reset( | ||
506 | new KisSignalCompressorWithParam<int>(500, callback, KisSignalCompressor::FIRST_INACTIVE)); | 514 | new KisSignalCompressorWithParam<int>(500, callback, KisSignalCompressor::FIRST_INACTIVE)); | ||
507 | } | 515 | } | ||
516 | | ||||
517 | | ||||
518 | | ||||
508 | } | 519 | } | ||
509 | 520 | | |||
510 | void KisMainWindow::setNoCleanup(bool noCleanup) | 521 | void KisMainWindow::setNoCleanup(bool noCleanup) | ||
511 | { | 522 | { | ||
512 | d->noCleanup = noCleanup; | 523 | d->noCleanup = noCleanup; | ||
513 | } | 524 | } | ||
514 | 525 | | |||
515 | KisMainWindow::~KisMainWindow() | 526 | KisMainWindow::~KisMainWindow() | ||
▲ Show 20 Lines • Show All 1258 Lines • ▼ Show 20 Line(s) | 1774 | if (bar) { | |||
1774 | } | 1785 | } | ||
1775 | } else | 1786 | } else | ||
1776 | warnUI << "slotToolbarToggled : Toolbar " << sender()->objectName() << " not found!"; | 1787 | warnUI << "slotToolbarToggled : Toolbar " << sender()->objectName() << " not found!"; | ||
1777 | } | 1788 | } | ||
1778 | 1789 | | |||
1779 | void KisMainWindow::viewFullscreen(bool fullScreen) | 1790 | void KisMainWindow::viewFullscreen(bool fullScreen) | ||
1780 | { | 1791 | { | ||
1781 | KisConfig cfg; | 1792 | KisConfig cfg; | ||
1782 | #ifdef Q_OS_WIN | | |||
1783 | cfg.setFullscreenMode(false); | | |||
1784 | #else | | |||
1785 | cfg.setFullscreenMode(fullScreen); | 1793 | cfg.setFullscreenMode(fullScreen); | ||
1786 | 1794 | | |||
1787 | if (fullScreen) { | 1795 | if (fullScreen) { | ||
1788 | setWindowState(windowState() | Qt::WindowFullScreen); // set | 1796 | setWindowState(windowState() | Qt::WindowFullScreen); // set | ||
1789 | } else { | 1797 | } else { | ||
1790 | setWindowState(windowState() & ~Qt::WindowFullScreen); // reset | 1798 | setWindowState(windowState() & ~Qt::WindowFullScreen); // reset | ||
1791 | } | 1799 | } | ||
1792 | #endif | | |||
1793 | } | 1800 | } | ||
1794 | 1801 | | |||
1795 | void KisMainWindow::slotProgress(int value) | 1802 | void KisMainWindow::slotProgress(int value) | ||
1796 | { | 1803 | { | ||
1797 | qApp->processEvents(); | 1804 | qApp->processEvents(); | ||
1798 | 1805 | | |||
1799 | if (!d->progressMutex.tryLock()) return; | 1806 | if (!d->progressMutex.tryLock()) return; | ||
1800 | 1807 | | |||
▲ Show 20 Lines • Show All 511 Lines • ▼ Show 20 Line(s) | |||||
2312 | void KisMainWindow::createActions() | 2319 | void KisMainWindow::createActions() | ||
2313 | { | 2320 | { | ||
2314 | KisActionManager *actionManager = d->actionManager(); | 2321 | KisActionManager *actionManager = d->actionManager(); | ||
2315 | 2322 | | |||
2316 | actionManager->createStandardAction(KStandardAction::New, this, SLOT(slotFileNew())); | 2323 | actionManager->createStandardAction(KStandardAction::New, this, SLOT(slotFileNew())); | ||
2317 | actionManager->createStandardAction(KStandardAction::Open, this, SLOT(slotFileOpen())); | 2324 | actionManager->createStandardAction(KStandardAction::Open, this, SLOT(slotFileOpen())); | ||
2318 | actionManager->createStandardAction(KStandardAction::Quit, this, SLOT(slotFileQuit())); | 2325 | actionManager->createStandardAction(KStandardAction::Quit, this, SLOT(slotFileQuit())); | ||
2319 | actionManager->createStandardAction(KStandardAction::ConfigureToolbars, this, SLOT(slotConfigureToolbars())); | 2326 | actionManager->createStandardAction(KStandardAction::ConfigureToolbars, this, SLOT(slotConfigureToolbars())); | ||
2320 | #ifndef Q_OS_WIN | | |||
2321 | actionManager->createStandardAction(KStandardAction::FullScreen, this, SLOT(viewFullscreen(bool))); | 2327 | actionManager->createStandardAction(KStandardAction::FullScreen, this, SLOT(viewFullscreen(bool))); | ||
2322 | #endif | 2328 | | ||
2323 | d->recentFiles = KStandardAction::openRecent(this, SLOT(slotFileOpenRecent(QUrl)), actionCollection()); | 2329 | d->recentFiles = KStandardAction::openRecent(this, SLOT(slotFileOpenRecent(QUrl)), actionCollection()); | ||
2324 | connect(d->recentFiles, SIGNAL(recentListCleared()), this, SLOT(saveRecentFiles())); | 2330 | connect(d->recentFiles, SIGNAL(recentListCleared()), this, SLOT(saveRecentFiles())); | ||
2325 | KSharedConfigPtr configPtr = KSharedConfig::openConfig(); | 2331 | KSharedConfigPtr configPtr = KSharedConfig::openConfig(); | ||
2326 | d->recentFiles->loadEntries(configPtr->group("RecentFiles")); | 2332 | d->recentFiles->loadEntries(configPtr->group("RecentFiles")); | ||
2327 | 2333 | | |||
2328 | d->saveAction = actionManager->createStandardAction(KStandardAction::Save, this, SLOT(slotFileSave())); | 2334 | d->saveAction = actionManager->createStandardAction(KStandardAction::Save, this, SLOT(slotFileSave())); | ||
2329 | d->saveAction->setActivationFlags(KisAction::ACTIVE_IMAGE); | 2335 | d->saveAction->setActivationFlags(KisAction::ACTIVE_IMAGE); | ||
2330 | 2336 | | |||
▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines |
This will break when cross-compiling, I'm afraid, because of the \ vs /