12#include <config-hdr.h>
31#include <QRadioButton>
34#include <QStandardPaths>
36#include <QStyleFactory>
38#include <QFontComboBox>
40#include <QSurfaceFormat>
42#include <QTextBrowser>
61#include <KTitleWidget>
64#include <klocalizedstring.h>
65#include <kstandardguiitem.h>
93#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
110#include <config-qt-patches-present.h>
113#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
115# include "config_qt5_has_wintab_switch.h"
117# include <QtGui/private/qguiapplication_p.h>
118# include <QtGui/qpa/qplatformintegration.h>
120#include "config-high-dpi-scale-factor-rounding-policy.h"
133 if (QGuiApplication::screens().
length() <= index) {
136 QScreen* screen = QGuiApplication::screens()[index];
137 QString resolution = QString::number(screen->geometry().width()).append(
"x").append(QString::number(screen->geometry().height()));
138 QString name = screen->name();
153 State
validate(QString &line,
int &)
const override
156 if (!fi.isWritable()) {
167 <<
"0" <<
"1" <<
"2" <<
"3" <<
"4" <<
"5" <<
"6" <<
"7" <<
"8" <<
"9"
168 <<
"/" <<
"\\" <<
":" <<
";" <<
" ")
175 State
validate(QString &line,
int &)
const override
178 if (line.contains(invalidChar)) {
201 if (event->type() == QEvent::Wheel) {
212 QImage imageOrig = _icon.pixmap(size).toImage();
214 auto makeFainter = [imageOrig] (
int alphaVal) {
215 QImage image = imageOrig;
216 QImage alpha = QImage(image.size(), QImage::Format_Alpha8);
217 alpha.fill(alphaVal);
218 image.setAlphaChannel(alpha);
219 QPixmap pixmap = QPixmap();
220 pixmap.convertFromImage(image);
224 QPixmap thirdOpaque = makeFainter(
int(256*0.3));
225 QPixmap halfOpaque = makeFainter(
int(256*0.65));
227 icon.addPixmap(thirdOpaque, QIcon::Mode::Disabled, QIcon::State::Off);
228 icon.addPixmap(thirdOpaque, QIcon::Mode::Disabled, QIcon::State::On);
229 icon.addPixmap(halfOpaque, QIcon::Mode::Normal, QIcon::State::Off);
243 scrollAreaWidgetContents->setAutoFillBackground(
false);
244 scrollAreaWidgetContents->parentWidget()->setAutoFillBackground(
false);
255 << i18n(
"Small Circle")
257 << i18n(
"Triangle Righthanded")
258 << i18n(
"Triangle Lefthanded")
259 << i18n(
"Black Pixel")
260 << i18n(
"White Pixel");
263 << i18nc(
"Display options label to not DISPLAY brush outline",
"No Outline")
264 << i18n(
"Circle Outline")
265 << i18n(
"Preview Outline")
266 << i18n(
"Tilt Outline");
270 m_cmbCursorShape->addItems(cursorItems);
274 m_cmbOutlineShape->addItems(outlineItems);
283 cursorColorButton->setColor(cursorColor);
289 m_cmbEraserCursorShape->addItems(cursorItems);
290 m_cmbEraserCursorShape->addItem(i18n(
"Eraser"));
294 m_cmbEraserOutlineShape->addItems(outlineItems);
303 eraserCursorColorButton->setColor(eraserCursorColor);
309 connect(m_cmbColorSamplerPreviewStyle,
310 QOverload<int>::of(&QComboBox::currentIndexChanged),
315 m_nmbColorSamplerPreviewSize->setRange(1, 400);
320 m_ssbColorSamplerPreviewThickness->setRange(1, 50);
333 m_ssbColorSamplerZoomPreviewScale->setRange(1, 50);
334 m_ssbColorSamplerZoomPreviewScale->setSingleStep(1);
337 m_cmbColorSamplerPreviewCirclePosition->addItem(i18n(
"Center"));
338 m_cmbColorSamplerPreviewCirclePosition->addItem(i18n(
"Top"));
339 m_cmbColorSamplerPreviewCirclePosition->addItem(i18n(
"Top Left"));
340 m_cmbColorSamplerPreviewCirclePosition->addItem(i18n(
"Top Right"));
356 chkUseCustomFont->setChecked(cfg.
readEntry<
bool>(
"use_custom_system_font",
false));
357 cmbCustomFont->findChild <QComboBox*>(
"stylesComboBox")->setVisible(
false);
359 QString fontName = cfg.
readEntry<QString>(
"custom_system_font",
"");
360 if (fontName.isEmpty()) {
361 cmbCustomFont->setCurrentFont(qApp->font());
365 int pointSize = qApp->font().pointSize();
366 cmbCustomFont->setCurrentFont(QFont(fontName, pointSize));
368 int fontSize = cfg.
readEntry<
int>(
"custom_font_size", -1);
370 intFontSize->setValue(qApp->font().pointSize());
373 intFontSize->setValue(fontSize);
376 m_cmbMDIType->setCurrentIndex(cfg.
readEntry<
int>(
"mdi_viewmode", (
int)QMdiArea::TabbedView));
386 m_mdiColor->setColor(mdiColor);
392 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
393 QSettings kritarc(configPath + QStringLiteral(
"/kritadisplayrc"), QSettings::IniFormat);
394 m_chkHiDPI->setChecked(kritarc.value(
"EnableHiDPI",
true).toBool());
395#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
396 m_chkHiDPIFractionalScaling->setChecked(kritarc.value(
"EnableHiDPIFractionalScaling",
false).toBool());
398 m_wdgHiDPIFractionalScaling->setEnabled(
false);
400 chkUsageLogging->setChecked(kritarc.value(
"LogUsage",
true).toBool());
407 cmbFlowMode->setCurrentIndex((
int)!cfg.
readEntry<
bool>(
"useCreamyAlphaDarken",
true));
408 cmbCmykBlendingMode->setCurrentIndex((
int)!cfg.
readEntry<
bool>(
"useSubtractiveBlendingForCmykColorSpaces",
true));
410 cmbTouchPainting->addItem(
412 : i18nc(
"touch painting",
"Auto (Enabled)"));
413 cmbTouchPainting->addItem(i18nc(
"touch painting",
"Enabled"));
414 cmbTouchPainting->addItem(i18nc(
"touch painting",
"Disabled"));
416 chkTouchPressureSensitivity->setChecked(cfg.
readEntry(
"useTouchPressureSensitivity",
true));
417 connect(cmbTouchPainting, SIGNAL(currentIndexChanged(
int)),
428 m_cmbKineticScrollingGesture->addItem(i18n(
"On Touch Drag"));
429 m_cmbKineticScrollingGesture->addItem(i18n(
"On Click Drag"));
430 m_cmbKineticScrollingGesture->addItem(i18n(
"On Middle-Click Drag"));
437 m_kineticScrollingSensitivitySlider->setRange(0, 100);
445 chkEnableSelectionActionBar->setChecked(sapEnabled);
452 m_autosaveSpinBox->setValue(autosaveInterval / 60);
453 m_autosaveCheckBox->setChecked(autosaveInterval > 0);
454 chkHideAutosaveFiles->setChecked(cfg.
readEntry<
bool>(
"autosavefileshidden",
true));
457 chkZip64->setChecked(cfg.
useZip64());
458 m_chkTrimKra->setChecked(cfg.
trimKra());
461 m_backupFileCheckBox->setChecked(cfg.
backupFile());
462 cmbBackupFileLocation->setCurrentIndex(cfg.
readEntry<
int>(
"backupfilelocation", 0));
463 txtBackupFileSuffix->setText(cfg.
readEntry<QString>(
"backupfilesuffix",
"~"));
465 txtBackupFileSuffix->setValidator(validator);
466 intNumBackupFiles->setValue(cfg.
readEntry<
int>(
"numberofbackupfiles", 1));
468 cmbDefaultExportFileType->clear();
471 QMap<QString, QString> mimeTypeMap;
473 foreach (
const QString &mimeType, mimeFilter) {
475 mimeTypeMap.insert(description, mimeType);
479 QStringList sortedDescriptions = mimeTypeMap.keys();
480 sortedDescriptions.sort(Qt::CaseInsensitive);
482 cmbDefaultExportFileType->addItem(i18n(
"All Supported Files"),
"all/mime");
483 foreach (
const QString &description, sortedDescriptions) {
484 const QString &mimeType = mimeTypeMap.value(description);
485 cmbDefaultExportFileType->addItem(description, mimeType);
488 const QString mimeTypeToFind = cfg.
exportMimeType(
false).toUtf8();
489 const int index = cmbDefaultExportFileType->findData(mimeTypeToFind);
492 cmbDefaultExportFileType->setCurrentIndex(index);
495 const QString defaultMimeType =
"image/png";
496 const int defaultIndex = cmbDefaultExportFileType->findData(defaultMimeType);
497 if (defaultIndex >= 0) {
498 cmbDefaultExportFileType->setCurrentIndex(defaultIndex);
501 qDebug() <<
"Default mime type not found in the combo box.";
505 QString selectedMimeType = cmbDefaultExportFileType->currentData().toString();
517 cmbStartupSession->addItem(i18n(
"Open default window"));
518 cmbStartupSession->addItem(i18n(
"Load previous session"));
519 cmbStartupSession->addItem(i18n(
"Show session manager"));
528 connect(chkCumulativeUndo, SIGNAL(toggled(
bool)), btnAdvancedCumulativeUndo, SLOT(setEnabled(
bool)));
529 btnAdvancedCumulativeUndo->setEnabled(chkCumulativeUndo->isChecked());
539 KConfigGroup group = KSharedConfig::openConfig()->group(
"File Dialogs");
540 bool dontUseNative =
true;
542 dontUseNative =
false;
545 if (qgetenv(
"XDG_CURRENT_DESKTOP") ==
"KDE") {
546 dontUseNative =
false;
550 dontUseNative =
false;
553 dontUseNative =
false;
555 m_chkNativeFileDialog->setChecked(!group.readEntry(
"DontUseNativeFileDialog", dontUseNative));
557 if (!qEnvironmentVariable(
"APPIMAGE").isEmpty()) {
560 m_chkNativeFileDialog->setChecked(
false);
561 m_chkNativeFileDialog->setEnabled(
false);
569 chkIgnoreHighFunctionKeys->setVisible(
false);
572 cmbIconsInMenu->addItem(i18n(
"Default"));
573 cmbIconsInMenu->addItem(i18n(
"Yes"));
574 cmbIconsInMenu->addItem(i18n(
"No"));
575 cmbIconsInMenu->setCurrentIndex(cfg.
iconsInMenu());
581 m_urlResourceFolder->setConfigurationName(
"resource_directory");
583 if (QFileInfo(resourceLocation).isWritable()) {
584 m_urlResourceFolder->setFileName(resourceLocation);
587 m_urlResourceFolder->setFileName(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
590 m_urlResourceFolder->setValidator(writableValidator);
591 connect(m_urlResourceFolder, SIGNAL(textChanged(QString)), SLOT(
checkResourcePath()));
594 grpRestartMessage->setPixmap(
595 grpRestartMessage->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
596 grpRestartMessage->setText(i18n(
"You will need to Restart Krita for the changes to take an effect."));
598 grpAndroidWarningMessage->setVisible(
false);
599 grpAndroidWarningMessage->setPixmap(
600 grpAndroidWarningMessage->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
601 grpAndroidWarningMessage->setText(
602 i18n(
"Saving at a Location picked from the File Picker may slow down the startup!"));
605 m_urlResourceFolder->setVisible(
false);
607 m_resourceFolderSelector->setVisible(
true);
615 const QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
616 Q_FOREACH(
const QString &location, locations) {
617 if (!filteredLocations.contains(location)) {
618 filteredLocations.append(location);
621 return filteredLocations;
626 Q_FOREACH (QString location, locations) {
628 QFileInfo fileLocation(location);
631 text = i18n(
"Default");
633 }
else if (location.startsWith(
"/data")) {
634 text = i18n(
"Internal Storage");
636 text = i18n(
"SD-Card");
638 if (fileLocation.isWritable()) {
639 writableLocationsAndText.append({text, location});
642 return writableLocationsAndText;
645 for (
auto it = writableLocations.constBegin(); it != writableLocations.constEnd(); ++it) {
646 m_resourceFolderSelector->addItem(it->first +
" - " + it->second);
648 m_resourceFolderSelector->setItemData(m_resourceFolderSelector->count() - 1, it->second, Qt::UserRole);
652 if (resourceLocation.startsWith(
"content://")) {
653 m_resourceFolderSelector->addItem(resourceLocation);
654 int index = m_resourceFolderSelector->count() - 1;
655 m_resourceFolderSelector->setItemData(index, resourceLocation, Qt::UserRole);
656 m_resourceFolderSelector->setCurrentIndex(index);
657 grpAndroidWarningMessage->setVisible(
true);
660 auto iterator = std::find_if(writableLocations.constBegin(),
661 writableLocations.constEnd(),
662 [&resourceLocation](QPair<QString, QString> location) {
663 return location.second == resourceLocation;
666 if (iterator != writableLocations.constEnd()) {
667 int index = writableLocations.indexOf(*iterator);
669 m_resourceFolderSelector->setCurrentIndex(index);
674 m_resourceFolderSelector->addItem(i18n(
"Choose Manually"));
676 connect(m_resourceFolderSelector, qOverload<int>(&QComboBox::activated), [
this](
int index) {
677 const int previousIndex = m_resourceFolderSelector->currentIndex();
680 if (m_resourceFolderSelector->count() - 1 == index) {
681 KoFileDialog dialog(this, KoFileDialog::OpenDirectory,
"Select Directory");
682 const QString selectedDirectory = dialog.filename();
684 if (!selectedDirectory.isEmpty()) {
687 if (m_resourceFolderSelector->itemData(index - 1, Qt::DisplayRole)
689 .startsWith(
"content://")) {
690 m_resourceFolderSelector->setItemText(index - 1, selectedDirectory);
691 m_resourceFolderSelector->setItemData(index - 1, selectedDirectory, Qt::UserRole);
692 m_resourceFolderSelector->setCurrentIndex(index - 1);
695 m_resourceFolderSelector->insertItem(index, selectedDirectory);
696 m_resourceFolderSelector->setItemData(index, selectedDirectory, Qt::UserRole);
697 m_resourceFolderSelector->setCurrentIndex(index);
700 grpAndroidWarningMessage->setVisible(true);
702 m_resourceFolderSelector->setCurrentIndex(previousIndex);
707 grpAndroidWarningMessage->setVisible(
708 m_resourceFolderSelector->currentData(Qt::UserRole).value<QString>().startsWith(
"content://"));
712 m_resourceFolderSelector->setVisible(
false);
715 grpWindowsAppData->setVisible(
false);
717 QString folderInStandardAppData;
718 QString folderInPrivateAppData;
721 if (!folderInPrivateAppData.isEmpty()) {
722 const auto pathToDisplay = [](
const QString &path) {
730 return QDir::toNativeSeparators(path).replace(QChar(
'\\'), QStringLiteral(
u"\\\u200B"));
733 const QDir privateResourceDir(folderInPrivateAppData);
734 const QDir appDataDir(folderInStandardAppData);
735 grpWindowsAppData->setPixmap(
736 grpWindowsAppData->style()->standardIcon(QStyle::SP_MessageBoxInformation).pixmap(QSize(32, 32)));
738 grpWindowsAppData->setText(i18nc(
"@info resource folder",
739 "<p>You are using the Microsoft Store package version of Krita. "
740 "Even though Krita can be configured to place resources under the "
741 "user AppData location, Windows may actually store the files "
742 "inside a private app location.</p>\n"
743 "<p>You should check both locations to determine where "
744 "the files are located.</p>\n"
745 "<p><b>User AppData</b> (<a href=\"copyuser\">Copy</a>):<br/>\n"
747 "<p><b>Private app location</b> (<a href=\"copyprivate\">Copy</a>):<br/>\n"
749 pathToDisplay(appDataDir.absolutePath()),
750 pathToDisplay(privateResourceDir.absolutePath())));
751 grpWindowsAppData->setVisible(
true);
753 connect(grpWindowsAppData,
755 [userPath = appDataDir.absolutePath(),
756 privatePath = privateResourceDir.absolutePath()](
const QString &link) {
757 if (link == QStringLiteral(
"copyuser")) {
758 qApp->clipboard()->setText(QDir::toNativeSeparators(userPath));
759 }
else if (link == QStringLiteral(
"copyprivate")) {
760 qApp->clipboard()->
setText(QDir::toNativeSeparators(privatePath));
762 qWarning() <<
"Unexpected link activated in lblWindowsAppDataNote:" << link;
769 const int forcedFontDPI = cfg.readEntry(
"forcedDpiForQtFontBugWorkaround", -1);
770 chkForcedFontDPI->setChecked(forcedFontDPI > 0);
771 intForcedFontDPI->setValue(forcedFontDPI > 0 ? forcedFontDPI :
qt_defaultDpi());
772 intForcedFontDPI->setEnabled(forcedFontDPI > 0);
773 connect(chkForcedFontDPI, SIGNAL(toggled(
bool)), intForcedFontDPI, SLOT(setEnabled(
bool)));
780 QAbstractButton *
button = m_pasteFormatGroup.button(cfg.pasteFormat(
false));
795 m_chkSeparateEraserCursor->setChecked(cfg.
readEntry<
bool>(
"separateEraserCursor",
false));
811 chkHideAutosaveFiles->setChecked(
true);
817 m_backupFileCheckBox->setChecked(cfg.
backupFile(
true));
818 cmbBackupFileLocation->setCurrentIndex(0);
819 txtBackupFileSuffix->setText(
"~");
820 intNumBackupFiles->setValue(1);
827#if defined Q_OS_ANDROID || defined Q_OS_MACOS || defined Q_OS_WIN
828 m_chkNativeFileDialog->setChecked(
true);
830 m_chkNativeFileDialog->setChecked(
false);
833 intMaxBrushSize->setValue(1000);
838 chkUseCustomFont->setChecked(
false);
839 cmbCustomFont->setCurrentFont(qApp->font());
840 intFontSize->setValue(qApp->font().pointSize());
843 m_cmbMDIType->setCurrentIndex((
int)QMdiArea::TabbedView);
844 m_chkRubberBand->setChecked(cfg.
useOpenGL(
true));
850 m_chkCompressKra->setChecked(cfg.
compressKra(
true));
851 m_chkTrimKra->setChecked(cfg.
trimKra(
true));
853 chkZip64->setChecked(cfg.
useZip64(
true));
854 m_chkHiDPI->setChecked(
true);
855#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
856 m_chkHiDPIFractionalScaling->setChecked(
true);
858 chkUsageLogging->setChecked(
true);
860 cmbFlowMode->setCurrentIndex(0);
864 spnZoomSteps->setValue(cfg.
zoomSteps(
true));
869 cmbTouchPainting->setCurrentIndex(
int(cfg.
touchPainting(
true)));
870 chkTouchPressureSensitivity->setChecked(
true);
877 cursorColorButton->setColor(cursorColor);
881 eraserCursorColorButton->setColor(eraserCursorColor);
889 chkForcedFontDPI->setChecked(
false);
891 intForcedFontDPI->setEnabled(
false);
908 if (dlg.exec() == KoDialog::Accepted) {
916 m_frmColorSamplerCircleSettings->setVisible(circleSettingsVisible);
921 m_lblColorSamplerPreviewSizePreview->setDiameter(
value);
926 m_lblColorSamplerPreviewSizePreview->setThickness(
value/100.0);
931 m_lblColorSamplerPreviewSizePreview->setOutlineEnabled(
value);
936 Q_FOREACH(QAbstractButton*
button, buttonGroup.buttons()) {
945 return (
CursorStyle)m_cmbCursorShape->currentIndex();
955 return (
CursorStyle)m_cmbEraserCursorShape->currentIndex();
960 return (
OutlineStyle)m_cmbEraserOutlineShape->currentIndex();
970 return m_nmbColorSamplerPreviewSize->value();
975 return m_ssbColorSamplerPreviewThickness->value();
980 return m_chkColorSamplerPreviewOutlineEnabled->isChecked();
985 return m_chkColorSamplerPreviewExtraCircles->isChecked();
990 return m_ssbColorSamplerZoomPreviewScale->value();
995 return m_grpColorSamplerZoomPreview->isChecked();
1000 int index = m_cmbColorSamplerPreviewCirclePosition->currentIndex();
1016 return chkSaveSessionOnQuit->isChecked();
1021 return chkShowRootLayer->isChecked();
1027 return m_autosaveCheckBox->isChecked() ? m_autosaveSpinBox->value() * 60 : 0;
1032 return m_undoStackSize->value();
1037 return m_showOutlinePainting->isChecked();
1042 return m_showEraserOutlinePainting->isChecked();
1047 return m_cmbMDIType->currentIndex();
1052 return m_chkCanvasMessages->isChecked();
1057 return m_chkCompressKra->isChecked();
1062 return m_chkTrimKra->isChecked();
1067 return m_chkTrimFramesImport->isChecked();
1072 return cmbDefaultExportFileType->currentData().toString();
1077 return chkZip64->isChecked();
1082 return m_radioToolOptionsInDocker->isChecked();
1087 return spnZoomSteps->value();
1092 return chkEnableLongPress->isChecked();
1097 return m_groupBoxKineticScrollingSettings->isChecked();
1102 return m_cmbKineticScrollingGesture->currentIndex();
1107 return m_kineticScrollingSensitivitySlider->value();
1112 return m_chkKineticScrollingHideScrollbars->isChecked();
1117 return intZoomMarginSize->value();
1122 return m_chkSwitchSelectionCtrlAlt->isChecked();
1127 return m_chkConvertOnImport->isChecked();
1132 return m_chkAutoPin->isChecked();
1137 return m_chkAdaptivePlaybackRange->isChecked();
1142 return m_chkAutoZoom->isChecked();
1147 return chkForcedFontDPI->isChecked() ? intForcedFontDPI->value() : -1;
1154 i18nc(
"Preview option for no color sampler",
"None"),
1155 i18nc(
"Preview option for a circular/ring-shaped color sampler",
"Circle"),
1156 i18nc(
"Preview option for a rectangular color sampler left of the cursor",
"Rectangle Left"),
1157 i18nc(
"Preview option for a rectangular color sampler right of the cursor",
"Rectangle Right"),
1158 i18nc(
"Preview option for a rectangular color sampler above the cursor",
"Rectangle Above"),
1164 cmb->setCurrentIndex(
int(style));
1174 return chkRenameMergedLayers->isChecked();
1179 return chkRenamePastedLayers->isChecked();
1184 return chkRenameDuplicatedLayers->isChecked();
1190 dialog.setCaption(i18n(
"Select a Background Image"));
1191 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
1192 dialog.setImageFilters();
1194 QString fn = dialog.filename();
1201 if (image.isNull()) {
1202 QMessageBox::warning(
this, i18nc(
"@title:window",
"Krita"), i18n(
"%1 is not a valid image file!", fn));
1205 m_backgroundimage->setText(fn);
1212 m_backgroundimage->setText(
"");
1217 const QFileInfo fi(m_urlResourceFolder->fileName());
1218 if (!fi.isWritable()) {
1219 grpNonWritableLocation->setPixmap(
1220 grpNonWritableLocation->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
1221 grpNonWritableLocation->setText(
1222 i18nc(
"@info resource folder",
"<b>Warning:</b> this location is not writable."));
1223 grpNonWritableLocation->setVisible(
true);
1225 grpNonWritableLocation->setVisible(
false);
1231 group_subWinMode->setEnabled(mdi_mode == QMdiArea::SubWindowView);
1246 setObjectName(name);
1248 QGridLayout * l =
new QGridLayout(
this);
1249 l->setContentsMargins(0, 0, 0, 0);
1251 l->addWidget(
m_page, 0, 0);
1259 Q_FOREACH (QAction *action, collection->
actions()) {
1263 QMap<QString, KisKActionCollection*> sortedCollections =
1266 for (
auto it = sortedCollections.constBegin(); it != sortedCollections.constEnd(); ++it) {
1295 setObjectName(name);
1300 QGridLayout * l =
new QGridLayout(
this);
1301 l->setContentsMargins(0, 0, 0, 0);
1303 l->addWidget(
m_page, 0, 0);
1314 id = colorSpaces.erase(
id);
1319 m_page->cmbWorkingColorSpace->setIDList(colorSpaces);
1324 m_page->bnAddColorProfile->setIcon(
koIcon(
"document-import-16"));
1331 QMap<QString, const KoColorProfile *> profileList;
1333 profileList[profile->
name()] = profile;
1334 profiles.append(profile->
name());
1337 std::sort(profiles.begin(), profiles.end());
1338 Q_FOREACH (
const QString profile, profiles) {
1339 m_page->cmbColorProfileForEXR->addSqueezedItem(profile);
1344 const QString userProfile = cfg.
readEntry(
"ExrDefaultColorProfile", defaultProfile);
1346 m_page->cmbColorProfileForEXR->setCurrent(profiles.contains(userProfile) ? userProfile : defaultProfile);
1351 QFormLayout *monitorProfileGrid =
new QFormLayout(
m_page->monitorprofileholder);
1352 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1353 for(
int i = 0; i < QGuiApplication::screens().count(); ++i) {
1354 QLabel *lbl =
new QLabel(i18nc(
"The number of the screen (ordinal) and shortened 'name' of the screen (model + resolution)",
"Screen %1 (%2):", i + 1,
shortNameOfDisplay(i)));
1355 lbl->setWordWrap(
true);
1358 cmb->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
1359 monitorProfileGrid->addRow(lbl, cmb);
1365 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1371 QVBoxLayout *vboxLayout =
new QVBoxLayout(
m_page->monitorprofileholder);
1372 vboxLayout->setContentsMargins(0, 0, 0, 0);
1373 vboxLayout->addItem(
new QSpacerItem(20,20));
1375 QGroupBox *groupBox =
new QGroupBox(i18n(
"Display's color space is managed by the operating system"));
1376 vboxLayout->addWidget(groupBox);
1378 QFormLayout *monitorProfileGrid =
new QFormLayout(groupBox);
1379 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1382 new QCheckBox(i18n(
"Enable canvas color management"),
this);
1385 i18n(
"<p>Enabling canvas color management automatically creates "
1386 "a separate native surface for the canvas. It might cause "
1387 "performance issues on some systems.</p>"
1389 "<p>If color management is disabled, Krita will render "
1390 "the canvas into the surface of the main window, which "
1391 "is considered sRGB. It will cause two limitations:"
1394 " <li>the color gamut will be limited to sRGB</li>"
1395 " <li>color proofing mode will be limited to \"use global display settings\", "
1396 " i.e. paper white proofing will become impossible</li>"
1405 QLabel *canvasSurfaceColorSpaceLbl =
new QLabel(i18n(
"Canvas surface color space:"),
this);
1408 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Preferred by operating system"), QVariant::fromValue(CanvasSurfaceMode::Preferred));
1409 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Rec 709 Gamma 2.2"), QVariant::fromValue(CanvasSurfaceMode::Rec709g22));
1412 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Unmanaged (testing only)"), QVariant::fromValue(CanvasSurfaceMode::Unmanaged));
1415 i18n(
"<p>Color space of the pixels that are transferred to the "
1416 "window compositor. Use \"preferred\" space unless you know "
1417 "what you are doing</p>"));
1422 QLabel *canvasSurfaceBitDepthLbl =
new QLabel(i18n(
"Canvas surface bit depth (needs restart):"),
this);
1425 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"Auto"), QVariant::fromValue(CanvasSurfaceBitDepthMode::DepthAuto));
1426 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"8-bit"), QVariant::fromValue(CanvasSurfaceBitDepthMode::Depth8Bit));
1427 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"10-bit"), QVariant::fromValue(CanvasSurfaceBitDepthMode::Depth10Bit));
1430 i18n(
"<p>The bit depth of the color that is passed to the window "
1431 "compositor. You should switch into 10-bit mode if you want to use "
1432 "HDR capabilities of your display</p>"));
1434 const QString currentBitBepthString = QSurfaceFormat::defaultFormat().redBufferSize() == 10 ? i18n(
"10-bit") : i18n(
"8-bit");
1435 QLabel *currentCanvasSurfaceBitDepthLbl =
new QLabel(i18n(
"Current canvas surface bit depth:"),
this);
1436 QLabel *currentCanvasSurfaceBitDepth =
new QLabel(currentBitBepthString,
this);
1437 monitorProfileGrid->addRow(currentCanvasSurfaceBitDepthLbl, currentCanvasSurfaceBitDepth);
1439 vboxLayout->addItem(
new QSpacerItem(20,20));
1442 QTextBrowser *preferredLbl =
new QTextBrowser(
this);
1444 preferredLbl->setReadOnly(
true);
1446 QHBoxLayout *colorDescriptionChoice =
new QHBoxLayout();
1447 vboxLayout->addLayout(colorDescriptionChoice);
1449 QLabel *descriptionChoiceLabel =
new QLabel(i18n(
"Diagram:"));
1450 colorDescriptionChoice->addWidget(descriptionChoiceLabel);
1452 QRadioButton *containerSpace =
new QRadioButton(i18nc(
"@info:radiobutton",
"Preferred Space"),
this);
1453 colorDescriptionChoice->addWidget(containerSpace);
1454 containerSpace->setToolTip(i18nc(
"@info:tooltip",
"This is the space preferred by the operating system."));
1457 QRadioButton *masteringSpace =
new QRadioButton(i18nc(
"@info:radiobutton",
"Current Display"),
this);
1458 colorDescriptionChoice->addWidget(masteringSpace);
1460 masteringSpace->setToolTip(i18nc(
"@info:tooltip",
"This is the space representing the currently active display."));
1462 QHBoxLayout *colorDescriptionLayout =
new QHBoxLayout();
1463 vboxLayout->addLayout(colorDescriptionLayout);
1466 colorDescriptionLayout->addWidget(preferredLbl);
1468 containerSpace->setChecked(
true);
1469 colorDescriptionChoice->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding));
1522 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1538 button->setChecked(
true);
1544 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1557 dialog.setCaption(i18n(
"Install Color Profiles"));
1558 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
1559 dialog.setMimeTypeFilters(
QStringList() <<
"application/vnd.iccprofile",
"application/vnd.iccprofile");
1563 Q_ASSERT(iccEngine);
1567 Q_FOREACH (
const QString &profileName, profileNames) {
1568 if (!QFile::copy(profileName, saveLocation + QFileInfo(profileName).fileName())) {
1569 qWarning() <<
"Could not install profile!" << saveLocation + QFileInfo(profileName).fileName();
1572 iccEngine->
addProfile(saveLocation + QFileInfo(profileName).fileName());
1578 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1588 m_page->cmbWorkingColorSpace->setEnabled(useDefColorSpace);
1593 m_page->cmbWorkingColorSpace->setCurrent(
"RGBA");
1597 m_page->cmbColorProfileForEXR->setCurrent(defaultProfile);
1627 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1636 button->setChecked(
true);
1645 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1649 QMap<QString, const KoColorProfile *> profileList;
1651 profileList[profile->
name()] = profile;
1654 Q_FOREACH (
const KoColorProfile *profile, profileList.values()) {
1657 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1663 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1674 m_page->wdgProofingOptions->setDisplayConfigOptions(options);
1686#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1690 if (currentDescription) {
1691 if (std::holds_alternative<KisSurfaceColorimetry::Colorimetry>(currentDescription->colorSpace.primaries)) {
1692 auto col = std::get<KisSurfaceColorimetry::Colorimetry>(currentDescription->colorSpace.primaries);
1693 colorants << col.red().toxyY() << col.green().toxyY() << col.blue().toxyY();
1694 whitePoint = col.white().toxyY();
1698 auto named = std::get<KisSurfaceColorimetry::NamedPrimaries>(currentDescription->colorSpace.primaries);
1727 if (currentDescription && currentDescription->masteringInfo) {
1728 auto col = currentDescription->masteringInfo->primaries;
1729 colorants << col.red().toxyY() << col.green().toxyY() << col.blue().toxyY();
1730 whitePoint = col.white().toxyY();
1748 m_page->pressureCurve->setCurve(curve);
1750 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1751 KisConfig(
true).useRightMiddleTabletButtonWorkaround(
true));
1753#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1757 m_page->grpTabletApi->setVisible(
false);
1760#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1761 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1762 cfg.usePageUpDownMouseButtonEmulationWorkaround(
true));
1765#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1766 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1767 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround(
true));
1770#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1771 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround(
true));
1774 m_page->chkUseTimestampsForBrushSpeed->setChecked(
false);
1775 m_page->intMaxAllowedBrushSpeed->setValue(30);
1776 m_page->intBrushSpeedSmoothing->setValue(3);
1777 m_page->tiltDirectionOffsetAngle->setAngle(0);
1782 setObjectName(name);
1784 QGridLayout * l =
new QGridLayout(
this);
1785 l->setContentsMargins(0, 0, 0, 0);
1787 l->addWidget(
m_page, 0, 0);
1791 m_page->pressureCurve->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
1792 m_page->pressureCurve->setCurve(curve);
1794 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1797#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1798# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1799 QString actualTabletProtocol =
"<unknown>";
1800 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
1801 if (
auto nativeWindowsApp =
dynamic_cast<QWindowsApplication *
>(QGuiApplicationPrivate::platformIntegration())) {
1802 actualTabletProtocol = nativeWindowsApp->isWinTabEnabled() ?
"WinTab" :
"Windows Ink";
1804 m_page->grpTabletApi->setTitle(i18n(
"Tablet Input API (currently active API: \"%1\")", actualTabletProtocol));
1810 connect(
m_page->radioWintab, SIGNAL(toggled(
bool)),
m_page->btnResolutionSettings, SLOT(setEnabled(
bool)));
1811 m_page->btnResolutionSettings->setEnabled(
m_page->radioWintab->isChecked());
1813 m_page->grpTabletApi->setVisible(
false);
1818 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed (may cause severe artifacts when using WinTab tablet API)"));
1820 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed"));
1822 m_page->chkUseTimestampsForBrushSpeed->setChecked(cfg.
readEntry(
"useTimestampsForBrushSpeed",
false));
1824#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1825 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1826 cfg.usePageUpDownMouseButtonEmulationWorkaround());
1828 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->hide();
1831#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1832 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1833 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround());
1835 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->hide();
1838#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1839 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround());
1841 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->hide();
1844 m_page->intMaxAllowedBrushSpeed->setRange(1, 100);
1845 m_page->intMaxAllowedBrushSpeed->setValue(cfg.
readEntry(
"maxAllowedSpeedValue", 30));
1850 return i18np(
"Maximum brush speed: {n} px/ms",
"Maximum brush speed: {n} px/ms", value);
1853 m_page->intBrushSpeedSmoothing->setRange(3, 100);
1854 m_page->intBrushSpeedSmoothing->setValue(cfg.
readEntry(
"speedValueSmoothing", 3));
1859 return i18np(
"Brush speed smoothing: {n} sample",
"Brush speed smoothing: {n} samples", value);
1862 m_page->tiltDirectionOffsetAngle->setDecimals(0);
1863 m_page->tiltDirectionOffsetAngle->setRange(-180, 180);
1865 m_page->tiltDirectionOffsetAngle->setAngle(-cfg.
readEntry(
"tiltDirectionOffset", 0.0));
1866 m_page->tiltDirectionOffsetAngle->setPrefix(i18n(
"Pen tilt direction offset: "));
1873 tabletTestDialog.exec();
1899 return intMemoryLimit->value() - intPoolLimit->value();
1907 const double totalRAM = cfg.
totalRAM();
1908 lblTotalMemory->setText(KFormat().formatByteSize(totalRAM * 1024 * 1024, 0, KFormat::IECBinaryDialect, KFormat::UnitMegaByte));
1911 sliderMemoryLimit->setRange(1, 100, 2);
1912 sliderMemoryLimit->setSingleStep(0.01);
1915 sliderPoolLimit->setRange(0, 20, 2);
1916 sliderPoolLimit->setSingleStep(0.01);
1919 sliderUndoLimit->setRange(0, 50, 2);
1920 sliderUndoLimit->setSingleStep(0.01);
1922 intMemoryLimit->setMinimumWidth(80);
1923 intPoolLimit->setMinimumWidth(80);
1924 intUndoLimit->setMinimumWidth(80);
1927 formLayout->takeRow(2);
1928 label_5->setVisible(
false);
1929 intPoolLimit->setVisible(
false);
1930 sliderPoolLimit->setVisible(
false);
1944 std::bind(&KisIntParseSpinBox::value,
1948 connect(intMemoryLimit, SIGNAL(valueChanged(
int)), sync2, SLOT(slotParentValueChanged()));
1959 connect(intPoolLimit, SIGNAL(valueChanged(
int)), sync3, SLOT(slotParentValueChanged()));
1960 connect(intMemoryLimit, SIGNAL(valueChanged(
int)), sync3, SLOT(slotParentValueChanged()));
1964 sliderSwapSize->setSuffix(i18n(
" GiB"));
1965 sliderSwapSize->setRange(1, 64);
1966 intSwapSize->setRange(1, 64);
1972 intSwapSize, SLOT(setValue(
int)));
1975 sliderSwapSize, SLOT(setValue(
int)));
1978 swapFileLocation->setConfigurationName(
"swapfile_location");
1979 swapFileLocation->setFileName(cfg.
swapDir());
1981 sliderThreadsLimit->setRange(1, QThread::idealThreadCount());
1982 sliderFrameClonesLimit->setRange(1, QThread::idealThreadCount());
1984 sliderFrameTimeout->setRange(5, 600);
1985 sliderFrameTimeout->setSuffix(i18nc(
"suffix for \"seconds\"",
" sec"));
1988 sliderFpsLimit->setSuffix(i18n(
" fps"));
1996 intCachedFramesSizeLimit->setRange(256, 10000);
1997 intCachedFramesSizeLimit->setSuffix(i18n(
" px"));
1998 intCachedFramesSizeLimit->setSingleStep(1);
1999 intCachedFramesSizeLimit->setPageStep(1000);
2001 intRegionOfInterestMargin->setRange(1, 100);
2003 i18nc(
"{n} is the number value, % is the percent sign",
"{n}%"));
2004 intRegionOfInterestMargin->setSingleStep(1);
2005 intRegionOfInterestMargin->setPageStep(10);
2007 connect(chkCachedFramesSizeLimit, SIGNAL(toggled(
bool)), intCachedFramesSizeLimit, SLOT(setEnabled(
bool)));
2008 connect(chkUseRegionOfInterest, SIGNAL(toggled(
bool)), intRegionOfInterestMargin, SLOT(setEnabled(
bool)));
2010 connect(chkTransformToolUseInStackPreview, SIGNAL(toggled(
bool)), chkTransformToolForceLodMode, SLOT(setEnabled(
bool)));
2014 chkDisableAVXOptimizations->setVisible(
false);
2033 chkPerformanceLogging->setChecked(cfg.
enablePerfLog(requestDefault));
2036 sliderSwapSize->setValue(cfg.
maxSwapSize(requestDefault) / 1024);
2037 swapFileLocation->setFileName(cfg.
swapDir(requestDefault));
2045#if KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
2049 chkDetectFps->setVisible(
false);
2063 optOnDisk->setChecked(
true);
2065 optInMemory->setChecked(
true);
2070 intCachedFramesSizeLimit->setEnabled(chkCachedFramesSizeLimit->isChecked());
2074 intRegionOfInterestMargin->setEnabled(chkUseRegionOfInterest->isChecked());
2077 KConfigGroup group = KSharedConfig::openConfig()->group(
"KisToolTransform");
2078 chkTransformToolUseInStackPreview->setChecked(!group.readEntry(
"useOverlayPreviewStyle",
false));
2079 chkTransformToolForceLodMode->setChecked(group.readEntry(
"forceLodMode",
true));
2080 chkTransformToolForceLodMode->setEnabled(chkTransformToolUseInStackPreview->isChecked());
2084 KConfigGroup group = KSharedConfig::openConfig()->group(
"KritaTransform/KisToolMove");
2085 chkMoveToolForceLodMode->setChecked(group.readEntry(
"forceLodMode",
false));
2089 KConfigGroup group( KSharedConfig::openConfig(),
"filterdialog");
2090 chkFiltersForceLodMode->setChecked(group.readEntry(
"forceLodMode",
true));
2107 cfg.
setSwapDir(swapFileLocation->fileName());
2113#if KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
2137 KConfigGroup group = KSharedConfig::openConfig()->group(
"KisToolTransform");
2138 group.writeEntry(
"useOverlayPreviewStyle", !chkTransformToolUseInStackPreview->isChecked());
2139 group.writeEntry(
"forceLodMode", chkTransformToolForceLodMode->isChecked());
2143 KConfigGroup group = KSharedConfig::openConfig()->group(
"KritaTransform/KisToolMove");
2144 group.writeEntry(
"forceLodMode", chkMoveToolForceLodMode->isChecked());
2148 KConfigGroup group( KSharedConfig::openConfig(),
"filterdialog");
2149 group.writeEntry(
"forceLodMode", chkFiltersForceLodMode->isChecked());
2173#include <QOpenGLContext>
2180 const QString csString =
2187 "Unknown Color Space";
2189 return QString(
"%1 (%2 bit)").arg(csString).arg(depth);
2227 const QString rendererOpenGLText = i18nc(
"canvas renderer",
"OpenGL");
2228 const QString rendererSoftwareText = i18nc(
"canvas renderer",
"Software Renderer (very slow)");
2230 const QString rendererOpenGLESText =
2231 qEnvironmentVariable(
"QT_ANGLE_PLATFORM") !=
"opengl"
2232 ? i18nc(
"canvas renderer",
"Direct3D 11 via ANGLE")
2233 : i18nc(
"canvas renderer",
"OpenGL via ANGLE");
2235 const QString rendererOpenGLESText = i18nc(
"canvas renderer",
"OpenGL ES");
2242 i18nc(
"canvas renderer",
"Unknown"));
2244 cmbPreferredRenderer->clear();
2247 const bool onlyOneRendererSupported =
2253 if (!onlyOneRendererSupported) {
2254 QString qtPreferredRendererText;
2256 qtPreferredRendererText = rendererOpenGLESText;
2258 qtPreferredRendererText = rendererSoftwareText;
2260 qtPreferredRendererText = rendererOpenGLText;
2262 cmbPreferredRenderer->addItem(i18nc(
"canvas renderer",
"Auto (%1)", qtPreferredRendererText),
KisOpenGL::RendererAuto);
2263 cmbPreferredRenderer->setCurrentIndex(0);
2265 cmbPreferredRenderer->setEnabled(
false);
2271 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2278 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2285 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2289 if (!(supportedRenderers &
2294 grpOpenGL->setEnabled(
false);
2295 grpOpenGL->setChecked(
false);
2296 chkUseTextureBuffer->setEnabled(
false);
2297 cmbAssistantsDrawMode->setEnabled(
false);
2298 cmbFilterMode->setEnabled(
false);
2300 grpOpenGL->setEnabled(
true);
2302 chkUseTextureBuffer->setEnabled(cfg.
useOpenGL());
2304 cmbAssistantsDrawMode->setEnabled(cfg.
useOpenGL());
2305 cmbAssistantsDrawMode->setCurrentIndex(assistantDrawModeToIndex(cfg.
assistantsDrawMode()));
2306 cmbFilterMode->setEnabled(cfg.
useOpenGL());
2310 cmbFilterMode->removeItem(3);
2317 lblPreferredXcbGlApi->setVisible(currentXcbGlProvider.has_value());
2318 cmbPreferredXcbGlApi->setVisible(currentXcbGlProvider.has_value());
2320 if (currentXcbGlProvider.has_value()) {
2321 const QString glxCurrent = i18nc(
"@item:inlistbox",
"GLX (current)");
2322 const QString glxNotCurrent = i18nc(
"@item:inlistbox",
"GLX");
2323 const QString eglCurrent = i18nc(
"@item:inlistbox",
"EGL (current)");
2324 const QString eglNotCurrent = i18nc(
"@item:inlistbox",
"EGL");
2329 cmbPreferredXcbGlApi->setToolTip(i18nc(
"@info:tooltip",
2330 "<p>If you are using Krita on X11 or XWayland and experience slowness, "
2331 "try switching between EGL and GLX</p>"));
2336 int index = cmbPreferredXcbGlApi->findData(preferredValue);
2341 cmbPreferredXcbGlApi->setCurrentIndex(index);
2345 lblCurrentDisplayFormat->setText(
"");
2346 lblCurrentRootSurfaceFormat->setText(
"");
2347 grpHDRWarning->setVisible(
false);
2356 QOpenGLContext *context = QOpenGLContext::currentContext();
2359 context = QOpenGLContext::globalShareContext();
2365 if (screen && adapter.
isValid()) {
2370 toolTip << i18n(
"Display Id: %1", info.
screen->name());
2371 toolTip << i18n(
"Display Name: %1 %2", info.
screen->manufacturer(), info.
screen->model());
2372 toolTip << i18n(
"Min Luminance: %1", info.
minLuminance);
2373 toolTip << i18n(
"Max Luminance: %1", info.
maxLuminance);
2380 lblCurrentDisplayFormat->setToolTip(toolTip.join(
'\n'));
2383 lblCurrentDisplayFormat->setToolTip(
"");
2384 lblCurrentDisplayFormat->setText(i18n(
"Unknown"));
2387 lblCurrentDisplayFormat->setToolTip(
"");
2388 lblCurrentDisplayFormat->setText(i18n(
"Unknown"));
2389 qWarning() <<
"Failed to fetch display info:" << adapter.
errorString();
2394 lblCurrentRootSurfaceFormat->setText(colorSpaceString(colorSpace, currentFormat.redBufferSize()));
2395 cmbPreferedRootSurfaceFormat->setCurrentIndex(formatToIndex(cfg.
rootSurfaceFormat()));
2401 HDR->setEnabled(
false);
2409 const int hdrTabIndex = tabWidget->indexOf(
HDR);
2411 if (hdrTabIndex >= 0) {
2412 tabWidget->setTabVisible(hdrTabIndex,
false);
2418 if (openglWarnings.isEmpty()) {
2419 grpOpenGLWarnings->setVisible(
false);
2421 QString text = QString(
"<p><b>%1</b>").arg(i18n(
"Warning(s):"));
2422 text.append(
"<ul>");
2423 Q_FOREACH (
const QString &warning, openglWarnings) {
2424 text.append(
"<li>");
2425 text.append(warning.toHtmlEscaped());
2426 text.append(
"</li>");
2428 text.append(
"</ul></p>");
2429 grpOpenGLWarnings->setText(text);
2430 grpOpenGLWarnings->setPixmap(
2431 grpOpenGLWarnings->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
2432 grpOpenGLWarnings->setVisible(
true);
2440 btnSelectionOverlayColor->setColor(c);
2441 sldSelectionOverlayOpacity->setRange(0.0, 1.0, 2);
2442 sldSelectionOverlayOpacity->setSingleStep(0.05);
2445 sldSelectionOutlineOpacity->setRange(0.0, 1.0, 2);
2446 sldSelectionOutlineOpacity->setSingleStep(0.05);
2449 intCheckSize->setValue(cfg.
checkSize());
2453 colorChecks1->setColor(ck1);
2456 colorChecks2->setColor(ck2);
2459 canvasBorder->setColor(cb);
2470 pixelGridColorButton->setColor(gridColor);
2478 cmbPreferredRenderer->setCurrentIndex(0);
2481 grpOpenGL->setEnabled(
false);
2482 grpOpenGL->setChecked(
false);
2483 chkUseTextureBuffer->setEnabled(
false);
2484 cmbAssistantsDrawMode->setEnabled(
false);
2485 cmbFilterMode->setEnabled(
false);
2488 grpOpenGL->setEnabled(
true);
2489 grpOpenGL->setChecked(cfg.
useOpenGL(
true));
2491 chkUseTextureBuffer->setEnabled(
true);
2492 cmbAssistantsDrawMode->setEnabled(
true);
2493 cmbAssistantsDrawMode->setCurrentIndex(assistantDrawModeToIndex(cfg.
assistantsDrawMode(
true)));
2494 cmbFilterMode->setEnabled(
true);
2505 btnSelectionOverlayColor->setColor(c);
2510 intCheckSize->setValue(cfg.
checkSize(
true));
2513 colorChecks1->setColor(ck1);
2516 colorChecks2->setColor(ck2);
2519 canvasBorder->setColor(cvb);
2524 chkHidePopups->setChecked(cfg.
hidePopups(
true));
2528 pixelGridColorButton->setColor(gridColor);
2538 chkUseTextureBuffer->setEnabled(isChecked);
2539 cmbFilterMode->setEnabled(isChecked);
2540 cmbAssistantsDrawMode->setEnabled(isChecked);
2547 QOpenGLContext *context = QOpenGLContext::currentContext();
2556 grpHDRWarning->setVisible(
true);
2557 grpHDRWarning->setPixmap(
2558 grpHDRWarning->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
2559 grpHDRWarning->setText(i18n(
"<b>Warning:</b> current display doesn't support HDR rendering"));
2561 grpHDRWarning->setVisible(
false);
2607 connect(chkShowColorHistory, SIGNAL(toggled(
bool)), cmbColorHistorySorting, SLOT(setEnabled(
bool)));
2608 connect(chkShowColorHistory, SIGNAL(toggled(
bool)), lblColorHistorySorting, SLOT(setEnabled(
bool)));
2619 sbPaletteSize->setValue(config.
readEntry(
"popuppalette/size", 385));
2620 sbSelectorSize->setValue(config.
readEntry(
"popuppalette/selectorSize", 140));
2621 cmbSelectorType->setCurrentIndex(config.
readEntry<
bool>(
"popuppalette/usevisualcolorselector",
false) ? 1 : 0);
2622 chkShowColorHistory->setChecked(config.
readEntry(
"popuppalette/showColorHistory",
true));
2623 chkShowRotationTrack->setChecked(config.
readEntry(
"popuppalette/showRotationTrack",
true));
2624 chkUseDynamicSlotCount->setChecked(config.
readEntry(
"popuppalette/useDynamicSlotCount",
true));
2625 grpFixTriangleRotation->setChecked(config.
readEntry(
"popuppalette/fixTriangleRotation",
false));
2626 sbTriangleRotationAngle->setValue(config.
readEntry(
"popuppalette/triangleRotationAngle", 0));
2628 QString currentSorting = config.
readEntry(
"popuppalette/colorHistorySorting", QString(
"hsv"));
2629 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2630 currentSorting =
"hsv";
2632 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2633 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2634 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2635 grpFixTriangleRotation->setEnabled(!cmbSelectorType->currentIndex());
2644 config.
writeEntry(
"popuppalette/size", sbPaletteSize->value());
2645 config.
writeEntry(
"popuppalette/selectorSize", sbSelectorSize->value());
2646 config.
writeEntry<
bool>(
"popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2647 config.
writeEntry<
bool>(
"popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2648 config.
writeEntry<
bool>(
"popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2649 config.
writeEntry<
bool>(
"popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2650 config.
writeEntry(
"popuppalette/colorHistorySorting",
2651 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2652 config.
writeEntry<
bool>(
"popuppalette/fixTriangleRotation", grpFixTriangleRotation->isChecked());
2653 config.
writeEntry(
"popuppalette/triangleRotationAngle", sbTriangleRotationAngle->value());
2660 sbPaletteSize->setValue(385);
2661 sbSelectorSize->setValue(140);
2662 cmbSelectorType->setCurrentIndex(0);
2663 chkShowColorHistory->setChecked(
true);
2664 chkShowRotationTrack->setChecked(
true);
2665 chkUseDynamicSlotCount->setChecked(
true);
2666 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2667 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2668 grpFixTriangleRotation->setChecked(
false);
2669 sbTriangleRotationAngle->setValue(0);
2673 grpFixTriangleRotation->setEnabled(!index);
2679 : KPageDialog(parent)
2682 setWindowTitle(i18n(
"Configure Krita"));
2683 setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
2685 setFaceType(KPageDialog::List);
2689 KPageWidgetItem *page =
new KPageWidgetItem(vbox, i18n(
"General"));
2690 page->setObjectName(
"general");
2691 page->setHeader(i18n(
"General"));
2699 page =
new KPageWidgetItem(vbox, i18n(
"Keyboard Shortcuts"));
2700 page->setObjectName(
"shortcuts");
2701 page->setHeader(i18n(
"Shortcuts"));
2712 page->setHeader(i18n(
"Canvas Input"));
2713 page->setObjectName(
"canvasinput");
2719 page =
new KPageWidgetItem(vbox, i18n(
"Display"));
2720 page->setObjectName(
"display");
2721 page->setHeader(i18n(
"Display"));
2729 page =
new KPageWidgetItem(vbox, i18n(
"Color Management"));
2730 page->setObjectName(
"colormanagement");
2731 page->setHeader(i18nc(
"Label of color as in Color Management",
"Color"));
2739 page =
new KPageWidgetItem(vbox, i18n(
"Performance"));
2740 page->setObjectName(
"performance");
2741 page->setHeader(i18n(
"Performance"));
2749 page =
new KPageWidgetItem(vbox, i18n(
"Tablet settings"));
2750 page->setObjectName(
"tablet");
2751 page->setHeader(i18n(
"Tablet"));
2759 page =
new KPageWidgetItem(vbox, i18n(
"Canvas-only settings"));
2760 page->setObjectName(
"canvasonly");
2761 page->setHeader(i18n(
"Canvas-only"));
2769 page =
new KPageWidgetItem(vbox, i18n(
"Pop-up Palette"));
2770 page->setObjectName(
"popuppalette");
2771 page->setHeader(i18n(
"Pop-up Palette"));
2779 page = addPage(
m_authorPage, i18nc(
"@title:tab Author page",
"Author" ));
2780 page->setObjectName(
"author");
2781 page->setHeader(i18n(
"Author"));
2785 KGuiItem::assign(
button(QDialogButtonBox::Ok), KStandardGuiItem::ok());
2786 KGuiItem::assign(
button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
2787 QPushButton *restoreDefaultsButton =
button(QDialogButtonBox::RestoreDefaults);
2788 restoreDefaultsButton->setText(i18nc(
"@action:button",
"Restore Defaults"));
2796 Q_FOREACH(
const QString &key, keys) {
2800 page =
new KPageWidgetItem(vbox, preferenceSet->
name());
2801 page->setHeader(preferenceSet->
header());
2802 page->setIcon(preferenceSet->
icon());
2804 preferenceSet->setParent(vbox);
2807 connect(restoreDefaultsButton, SIGNAL(clicked(
bool)), preferenceSet, SLOT(loadDefaultPreferences()), Qt::UniqueConnection);
2808 connect(
this, SIGNAL(accepted()), preferenceSet, SLOT(savePreferences()), Qt::UniqueConnection);
2811 connect(restoreDefaultsButton, SIGNAL(clicked(
bool)),
this, SLOT(
slotDefault()));
2814 QString currentPageName = cfg.
readEntry<QString>(
"KisDlgPreferences/CurrentPage");
2815 Q_FOREACH(KPageWidgetItem *page,
m_pages) {
2816 if (page->objectName() == currentPageName) {
2817 setCurrentPage(page);
2823#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
2827 const auto *titleWidget = findChild<KTitleWidget*>();
2829 QLayoutItem *titleFrame = titleWidget->layout()->itemAt(0);
2831 titleFrame->widget()->setBackgroundRole(QPalette::Window);
2841 cfg.
writeEntry<QString>(
"KisDlgPreferences/CurrentPage", currentPage()->objectName());
2845 KPageDialog::showEvent(event);
2846 button(QDialogButtonBox::Cancel)->setAutoDefault(
false);
2847 button(QDialogButtonBox::Ok)->setAutoDefault(
false);
2848 button(QDialogButtonBox::RestoreDefaults)->setAutoDefault(
false);
2849 button(QDialogButtonBox::Cancel)->setDefault(
false);
2850 button(QDialogButtonBox::Ok)->setDefault(
false);
2851 button(QDialogButtonBox::RestoreDefaults)->setDefault(
false);
2856 if (buttonBox()->buttonRole(
button) == QDialogButtonBox::RejectRole) {
2863 if (currentPage()->objectName() ==
"general") {
2866 else if (currentPage()->objectName() ==
"shortcuts") {
2869 else if (currentPage()->objectName() ==
"display") {
2872 else if (currentPage()->objectName() ==
"colormanagement") {
2875 else if (currentPage()->objectName() ==
"performance") {
2878 else if (currentPage()->objectName() ==
"tablet") {
2881 else if (currentPage()->objectName() ==
"canvasonly") {
2884 else if (currentPage()->objectName() ==
"canvasinput") {
2887 else if (currentPage()->objectName() ==
"popuppalette") {
2895 switch (page_enum) {
2903 name =
"colormanagement";
2906 name =
"performance";
2915 name =
"canvasonly";
2918 name =
"canvasinput";
2921 name =
"popuppalette";
2925 Q_FOREACH (KPageWidgetItem *page,
m_pages) {
2926 if (page->objectName() == name) {
2935 switch (page.
page) {
2937 QWidget *tab =
nullptr;
2964 m_general->tabWidget->setCurrentWidget(tab);
2967 QWidget *tab =
nullptr;
2982 QWidget *tab =
nullptr;
3000 QWidget *tab =
nullptr;
3025 connect(this->buttonBox(), SIGNAL(clicked(QAbstractButton*)),
this, SLOT(
slotButtonClicked(QAbstractButton*)));
3027 if (page.has_value()) {
3033 int retval = exec();
3064 KConfigGroup group = KSharedConfig::openConfig()->group(
"File Dialogs");
3065 group.writeEntry(
"DontUseNativeFileDialog", !
m_general->m_chkNativeFileDialog->isChecked());
3071 if (
m_general->chkUseCustomFont->isChecked()) {
3072 cfg.
writeEntry<QString>(
"custom_system_font",
m_general->cmbCustomFont->currentFont().family());
3076 cfg.
writeEntry<QString>(
"custom_system_font",
"");
3101 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
3102 QSettings kritarc(configPath + QStringLiteral(
"/kritadisplayrc"), QSettings::IniFormat);
3103 kritarc.setValue(
"EnableHiDPI",
m_general->m_chkHiDPI->isChecked());
3104#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
3105 kritarc.setValue(
"EnableHiDPIFractionalScaling",
m_general->m_chkHiDPIFractionalScaling->isChecked());
3107 kritarc.setValue(
"LogUsage",
m_general->chkUsageLogging->isChecked());
3111 cfg.
writeEntry<
bool>(
"useCreamyAlphaDarken", (bool)!
m_general->cmbFlowMode->currentIndex());
3112 cfg.
writeEntry<
bool>(
"useSubtractiveBlendingForCmykColorSpaces", (bool)!
m_general->cmbCmykBlendingMode->currentIndex());
3125 cfg.
writeEntry(
"useTouchPressureSensitivity",
m_general->chkTouchPressureSensitivity->isChecked());
3141 QFileInfo fi(
m_general->m_resourceFolderSelector->currentData(Qt::UserRole).value<QString>());
3143 QFileInfo fi(
m_general->m_urlResourceFolder->fileName());
3145 if (fi.isWritable()) {
3185#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
3188# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
3190 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
3191 if (
auto nativeWindowsApp =
dynamic_cast<QWindowsApplication *
>(QGuiApplicationPrivate::platformIntegration())) {
3198#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
3199 cfg.setUsePageUpDownMouseButtonEmulationWorkaround(
3203#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
3204 cfg.setUseHighFunctionKeyMouseButtonEmulationWorkaround(
3208#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
3209 cfg.setUseIgnoreHistoricTabletEventsWorkaround(
qreal length(const QPointF &vec)
float value(const T *src, size_t ch)
QList< QString > QStringList
const KoID AlphaColorModelID("A", ki18n("Alpha mask"))
const KoID Float16BitsColorDepthID("F16", ki18n("16-bit float/channel"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
Q_GUI_EXPORT int qt_defaultDpi()
void updatePreferredSpaceGraphic()
void toggleUseDefaultColorSpace(bool useDefColorSpace)
QList< QLabel * > m_monitorProfileLabels
QPointer< KisCIETongueWidget > m_preferredSpaceGraphic
QButtonGroup m_pasteBehaviourGroup
QPointer< QCheckBox > m_chkEnableCanvasColorSpaceManagement
QPointer< KisSqueezedComboBox > m_canvasSurfaceBitDepth
QScopedPointer< KisProofingConfigModel > m_proofModel
QPointer< KisSqueezedComboBox > m_canvasSurfaceColorSpace
QList< KisSqueezedComboBox * > m_monitorProfileWidgets
void refillMonitorProfiles(const KoID &s)
void updateProofingDisplayInfo()
QButtonGroup m_preferredSpaceGraphicMode
ColorSettingsTab(QWidget *parent=0, const char *name=0)
WdgColorSettings * m_page
QScopedPointer< KisScreenMigrationTracker > m_screenMigrationTracker
DisplaySettingsTab(QWidget *parent=0, const char *name=0)
void slotUseOpenGLToggled(bool isChecked)
void slotPreferredSurfaceFormatChanged(int index)
FullscreenSettingsTab(QWidget *parent)
KisConfig::SessionOnStartup sessionOnStartup() const
bool kineticScrollingHiddenScrollbars()
bool renameDuplicatedLayers()
bool showCanvasMessages()
bool saveSessionOnQuit() const
void showAdvancedCumulativeUndoSettings()
int colorSamplerPreviewCircleDiameter() const
bool autoZoomTimelineToPlaybackRange()
bool renamePastedLayers()
static void setButtonGroupEnabled(const QButtonGroup &buttonGroup, bool value)
void colorSamplePreviewThicknessChanged(qreal value)
KisConfig::ColorSamplerPreviewStyle colorSamplerPreviewStyle() const
void colorSamplePreviewOutlineEnabledChanged(int value)
bool kineticScrollingEnabled()
bool toolOptionsInDocker()
void clearBackgroundImage()
void colorSamplePreviewStyleChanged(int index)
qreal colorSamplerZoomPreviewScale() const
bool colorSamplerPreviewCircleExtraCirclesEnabled() const
bool convertToImageColorspaceOnImport()
QButtonGroup m_pasteFormatGroup
OutlineStyle eraserOutlineStyle()
void getBackgroundImage()
static KisConfig::ColorSamplerPreviewStyle getColorSamplerPreviewStyleValue(const QComboBox *cmb)
bool switchSelectionCtrlAlt()
int kineticScrollingSensitivity()
void colorSamplePreviewSizeChanged(int value)
KisCumulativeUndoData m_cumulativeUndoData
void updateTouchPressureSensitivityEnabled(int)
bool showOutlineWhilePainting()
CursorStyle eraserCursorStyle()
static void setColorSamplerPreviewStyleItems(QComboBox *cmb)
KisConfig::IconsInMenu iconsInMenu() const
bool renameMergedLayers()
KisConfig::ColorSamplerPreviewCirclePosition colorSamplerPreviewCirclePosition() const
static void setColorSamplerPreviewStyleIndexByValue(QComboBox *cmb, KisConfig::ColorSamplerPreviewStyle style)
void enableSubWindowOptions(int)
bool colorSamplerPreviewCircleOutlineEnabled() const
bool colorSamplerZoomPreviewEnabled() const
bool adaptivePlaybackRange()
OutlineStyle outlineStyle()
bool autopinLayersToTimeline()
bool showEraserOutlineWhilePainting()
CursorStyle cursorStyle()
int kineticScrollingGesture()
qreal colorSamplerPreviewCircleThickness() const
GeneralTab(QWidget *parent=0, const char *name=0)
virtual KisPreferenceSet * createPreferenceSet()=0
static KisActionRegistry * instance()
The KisActionsSnapshot class.
void connectBackwardInt(QObject *sender, const char *signal, QObject *receiver, const char *method)
void connectForwardInt(QObject *sender, const char *signal, QObject *receiver, const char *method)
@ FlipOptionsMode_MenuButton
The flip options are shown as a menu accessible via a options button.
void setCumulativeUndoData(KisCumulativeUndoData value)
ColorSamplerPreviewCirclePosition colorSamplerPreviewCirclePosition(bool defaultValue=false) const
bool backupFile(bool defaultValue=false) const
void setAntialiasCurves(bool v) const
void setSwitchSelectionCtrlAlt(bool value)
bool antialiasSelectionOutline(bool defaultValue=false) const
void setColorSamplerZoomPreviewScale(qreal scale)
void setZoomSteps(int steps)
@ ASSISTANTS_DRAW_MODE_PIXMAP_CACHE
@ ASSISTANTS_DRAW_MODE_DIRECT
@ ASSISTANTS_DRAW_MODE_LARGE_PIXMAP_CACHE
int zoomSteps(bool defaultValue=false) const
void setHideDockersFullscreen(const bool value) const
static CanvasSurfaceBitDepthMode canvasSurfaceBitDepthMode(QSettings *settings, bool defaultValue=false)
void setAdaptivePlaybackRange(bool value)
void setEnableCanvasSurfaceColorSpaceManagement(bool value)
bool colorSamplerPreviewCircleOutlineEnabled(bool defaultValue=false) const
void setPasteFormat(qint32 format)
QColor checkersColor2(bool defaultValue=false) const
void setColorSamplerPreviewCircleOutlineEnabled(bool enabled)
void setUseRightMiddleTabletButtonWorkaround(bool value)
void setCheckersColor1(const QColor &v) const
void setHidePopups(bool hidePopups)
void setMDIBackgroundColor(const QString &v) const
QString pressureTabletCurve(bool defaultValue=false) const
void setUndoStackLimit(int limit) const
bool hideScrollbars(bool defaultValue=false) const
int openGLFilteringMode(bool defaultValue=false) const
void setUseZip64(bool value)
bool showSingleChannelAsColor(bool defaultValue=false) const
void setHideToolbarFullscreen(const bool value) const
void setCanvasState(const QString &state) const
int kineticScrollingSensitivity(bool defaultValue=false) const
bool convertToImageColorspaceOnImport(bool defaultValue=false) const
int zoomMarginSize(bool defaultValue=false) const
void setAutoZoomTimelineToPlaybackRange(bool value)
bool showRootLayer(bool defaultValue=false) const
qint32 pasteFormat(bool defaultValue) const
void setEnableBrushSpeedLogging(bool value) const
void setExportMimeType(const QString &defaultExportMimeType)
void setUseWin8PointerInput(bool value)
qreal getPixelGridDrawingThreshold(bool defaultValue=false) const
bool switchSelectionCtrlAlt(bool defaultValue=false) const
void writeEntry(const QString &name, const T &value)
void setRenamePastedLayers(bool value)
QColor checkersColor1(bool defaultValue=false) const
void setHideScrollbars(bool value) const
bool allowLCMSOptimization(bool defaultValue=false) const
static void setCanvasSurfaceBitDepthMode(QSettings *settings, CanvasSurfaceBitDepthMode value)
void setIgnoreHighFunctionKeys(bool value)
bool activateTransformToolAfterPaste(bool defaultValue=false) const
void setNewCursorStyle(CursorStyle style)
bool hideDockersFullscreen(bool defaultValue=false) const
void setEraserCursorStyle(CursorStyle style)
bool compressKra(bool defaultValue=false) const
static bool preferXcbEglProvider(const QSettings *settings, bool defaultValue=false)
bool disableVectorOptimizations(bool defaultValue=false) const
void setCursorMainColor(const QColor &v) const
void setColorSamplerPreviewCircleThickness(qreal thickness)
void setCanvasSurfaceColorSpaceManagementMode(CanvasSurfaceMode value)
void setCumulativeUndoRedo(bool value)
void setConvertToImageColorspaceOnImport(bool value)
void setPixelGridColor(const QColor &v) const
void setToolOptionsInDocker(bool inDocker)
void setForceAlwaysFullSizedOutline(bool value) const
void setLongPressEnabled(bool value)
SessionOnStartup sessionOnStartup(bool defaultValue=false) const
void setForcePaletteColors(bool forcePaletteColors)
void setHideTitlebarFullscreen(const bool value) const
bool enableOpenGLFramerateLogging(bool defaultValue=false) const
QColor getPixelGridColor(bool defaultValue=false) const
bool useDefaultColorSpace(bool defaultvalue=false) const
bool hideMenuFullscreen(bool defaultValue=false) const
QString getMDIBackgroundColor(bool defaultValue=false) const
void setUseDefaultColorSpace(bool value) const
void setDefaultColorDepth(const QString &depth) const
bool hideScrollbarsFullscreen(bool defaultValue=false) const
TouchPainting touchPainting(bool defaultValue=false) const
void setSeparateEraserCursor(bool value) const
qint32 monitorRenderIntent(bool defaultValue=false) const
void setActivateTransformToolAfterPaste(bool value)
int kineticScrollingGesture(bool defaultValue=false) const
bool useZip64(bool defaultValue=false) const
bool calculateAnimationCacheInBackground(bool defaultValue=false) const
int favoritePresets(bool defaultValue=false) const
bool zoomHorizontal(bool defaultValue=false) const
QString getMDIBackgroundImage(bool defaultValue=false) const
void setAssistantsDrawMode(AssistantsDrawMode value)
CanvasSurfaceMode canvasSurfaceColorSpaceManagementMode(bool defaultValue=false) const
bool hideToolbarFullscreen(bool defaultValue=false) const
bool showCanvasMessages(bool defaultValue=false) const
bool useWin8PointerInput(bool defaultValue=false) const
bool useOpenGLTextureBuffer(bool defaultValue=false) const
void setCalculateAnimationCacheInBackground(bool value)
void setColorSamplerPreviewCircleExtraCirclesEnabled(bool enabled)
void setAutoSaveInterval(int seconds) const
void setShowSingleChannelAsColor(bool asColor)
void setTrimFramesImport(bool trim)
bool forcePaletteColors(bool defaultValue=false) const
bool colorSamplerZoomPreviewEnabled(bool defaultValue=false) const
void setAllowLCMSOptimization(bool allowLCMSOptimization)
void setColorSamplerPreviewCircleDiameter(int style)
void setRenderIntent(qint32 monitorRenderIntent) const
void setFavoritePresets(const int value)
void setEraserOutlineStyle(OutlineStyle style)
void setShowOutlineWhilePainting(bool showOutlineWhilePainting) const
RootSurfaceFormat rootSurfaceFormat(bool defaultValue=false) const
QColor canvasBorderColor(bool defaultValue=false) const
int colorSamplerPreviewCircleDiameter(bool defaultValue=false) const
QString exportMimeType(bool defaultValue) const
void setScrollingCheckers(bool scrollCheckers) const
const QString getScreenStringIdentfier(int screenNo) const
void setBackupFile(bool backupFile) const
void logImportantSettings() const
Log the most interesting settings to the usage log.
IconsInMenu iconsInMenu(bool defaultValue=false) const
CursorStyle newCursorStyle(bool defaultValue=false) const
bool useCumulativeUndoRedo(bool defaultValue=false) const
void setCheckSize(qint32 checkSize) const
CursorStyle eraserCursorStyle(bool defaultValue=false) const
void setKineticScrollingGesture(int kineticScroll)
void setPreferXcbEglProvider(bool value)
void setPixelGridDrawingThreshold(qreal v) const
void setCanvasBorderColor(const QColor &color) const
QString monitorProfile(int screen) const
get the profile the user has selected for the given screen
@ TOUCH_PAINTING_DISABLED
void setShowCanvasMessages(bool show)
qint32 checkSize(bool defaultValue=false) const
void setWorkingColorSpace(const QString &workingColorSpace) const
void setColorSamplerPreviewCirclePosition(ColorSamplerPreviewCirclePosition position)
KisCumulativeUndoData cumulativeUndoData(bool defaultValue=false) const
OutlineStyle newOutlineStyle(bool defaultValue=false) const
bool forceAlwaysFullSizedOutline(bool defaultValue=false) const
void setPressureTabletCurve(const QString &curveString) const
qreal colorSamplerPreviewCircleThickness(bool defaultValue=false) const
QString workingColorSpace(bool defaultValue=false) const
void setEnableOpenGLFramerateLogging(bool value) const
bool renamePastedLayers(bool defaultValue=false) const
void setNewOutlineStyle(OutlineStyle style)
void setCheckersColor2(const QColor &v) const
void setShowRootLayer(bool showRootLayer) const
void setColorSamplerZoomPreviewEnabled(bool enabled)
OutlineStyle eraserOutlineStyle(bool defaultValue=false) const
void setUseBlackPointCompensation(bool useBlackPointCompensation) const
bool kineticScrollingEnabled(bool defaultValue=false) const
void setUseOpenGLTextureBuffer(bool useBuffer)
void setTrimKra(bool trim)
void setIconsInMenu(IconsInMenu value)
ColorSamplerPreviewCirclePosition
bool hideTitlebarFullscreen(bool defaultValue=false) const
bool useRightMiddleTabletButtonWorkaround(bool defaultValue=false) const
bool longPressEnabled(bool defaultValue=false) const
void setColorSamplerPreviewStyle(ColorSamplerPreviewStyle style)
bool hidePopups(bool defaultValue=false) const
bool enableCanvasSurfaceColorSpaceManagement(bool defaultValue=false) const
void setRootSurfaceFormat(RootSurfaceFormat value)
bool autoPinLayersToTimeline(bool defaultValue=false) const
bool toolOptionsInDocker(bool defaultValue=false) const
void setOpenGLFilteringMode(int filteringMode)
void setKineticScrollingHideScrollbars(bool scrollbar)
void setAntialiasSelectionOutline(bool v) const
bool trimKra(bool defaultValue=false) const
bool enableBrushSpeedLogging(bool defaultValue=false) const
bool forceAlwaysFullSizedEraserOutline(bool defaultValue=false) const
T readEntry(const QString &name, const T &defaultValue=T())
int autoSaveInterval(bool defaultValue=false) const
QString defColorModel(bool defaultValue=false) const
void setDisableVectorOptimizations(bool value)
void setHideStatusbarFullscreen(const bool value) const
void setCompressKra(bool compress)
void setTouchPainting(TouchPainting value) const
bool showOutlineWhilePainting(bool defaultValue=false) const
void setShowEraserOutlineWhilePainting(bool showEraserOutlineWhilePainting) const
void setHideMenuFullscreen(const bool value) const
bool autoZoomTimelineToPlaybackRange(bool defaultValue=false) const
bool scrollCheckers(bool defaultValue=false) const
CanvasSurfaceBitDepthMode
void setZoomMarginSize(int zoomMarginSize)
bool hideStatusbarFullscreen(bool defaultValue=false) const
bool colorSamplerPreviewCircleExtraCirclesEnabled(bool defaultValue=false) const
void setZoomHorizontal(bool value)
bool kineticScrollingHiddenScrollbars(bool defaultValue=false) const
bool useOpenGL(bool defaultValue=false) const
bool trimFramesImport(bool defaultValue=false) const
void setForceAlwaysFullSizedEraserOutline(bool value) const
bool selectionActionBar(bool defaultValue=false) const
int undoStackLimit(bool defaultValue=false) const
bool useBlackPointCompensation(bool defaultValue=false) const
bool saveSessionOnQuit(bool defaultValue) const
ColorSamplerPreviewStyle colorSamplerPreviewStyle(bool defaultValue=false) const
void setMDIBackgroundImage(const QString &fileName) const
QColor getCursorMainColor(bool defaultValue=false) const
void setSelectionActionBar(bool value)
qint32 pasteBehaviour(bool defaultValue=false) const
AssistantsDrawMode assistantsDrawMode(bool defaultValue=false) const
bool separateEraserCursor(bool defaultValue=false) const
void setEraserCursorMainColor(const QColor &v) const
void setSaveSessionOnQuit(bool value)
bool disableAVXOptimizations(bool defaultValue=false) const
bool showEraserOutlineWhilePainting(bool defaultValue=false) const
void setPasteBehaviour(qint32 behaviour) const
void setSessionOnStartup(SessionOnStartup value)
void setHideScrollbarsFullscreen(const bool value) const
void setAutoPinLayersToTimeline(bool value)
QColor getEraserCursorMainColor(bool defaultValue=false) const
qreal colorSamplerZoomPreviewScale(bool defaultValue=false) const
bool antialiasCurves(bool defaultValue=false) const
void setKineticScrollingSensitivity(int sensitivity)
bool ignoreHighFunctionKeys(bool defaultValue=false) const
void setDisableAVXOptimizations(bool value)
bool adaptivePlaybackRange(bool defaultValue=false) const
void setKineticScrollingEnabled(bool enabled)
std::pair< KoColorConversionTransformation::Intent, KoColorConversionTransformation::ConversionFlags > Options
KoConfigAuthorPage * m_authorPage
PerformanceTab * m_performanceSettings
ColorSettingsTab * m_colorSettings
PopupPaletteTab * m_popupPaletteSettings
KPageWidgetItem * getPage(Page page_enum)
KisInputConfigurationPage * m_inputConfiguration
~KisDlgPreferences() override
FullscreenSettingsTab * m_fullscreenSettings
ShortcutSettingsTab * m_shortcutSettings
TabletSettingsTab * m_tabletSettings
bool editPreferences(std::optional< PageDesc > page)
QList< KPageWidgetItem * > m_pages
DisplaySettingsTab * m_displaySettings
void slotButtonClicked(QAbstractButton *button)
KisDlgPreferences(QWidget *parent=0, const char *name=0)
void switchTab(PageDesc tab)
void showEvent(QShowEvent *event) override
void setEnableProgressReporting(bool value)
void setUseAnimationCacheRegionOfInterest(bool value)
bool useAnimationCacheFrameSizeLimit(bool defaultValue=false) const
void setAnimationCacheFrameSizeLimit(int value)
void setFrameRenderingClones(int value)
int animationCacheFrameSizeLimit(bool defaultValue=false) const
KisProofingConfigurationSP defaultProofingconfiguration(bool requestDefault=false)
void setMaxNumberOfThreads(int value)
bool useAnimationCacheRegionOfInterest(bool defaultValue=false) const
int frameRenderingClones(bool defaultValue=false) const
void setDetectFpsLimit(bool value)
void setFpsLimit(int value)
QString swapDir(bool requestDefault=false)
int maxNumberOfThreads(bool defaultValue=false) const
qreal memoryPoolLimitPercent(bool requestDefault=false) const
void setEnablePerfLog(bool value)
bool detectFpsLimit(bool defaultValue=false) const
bool enableProgressReporting(bool requestDefault=false) const
void setUseAnimationCacheFrameSizeLimit(bool value)
int fpsLimit(bool defaultValue=false) const
void setSelectionOutlineOpacity(qreal value)
int maxSwapSize(bool requestDefault=false) const
void setUseOnDiskAnimationCacheSwapping(bool value)
qreal animationCacheRegionOfInterestMargin(bool defaultValue=false) const
void setFrameRenderingTimeout(int value)
void setMaxSwapSize(int value)
qreal memoryHardLimitPercent(bool requestDefault=false) const
void setMemorySoftLimitPercent(qreal value)
void setSwapDir(const QString &swapDir)
void setSelectionOverlayMaskColor(const QColor &color)
qreal selectionOutlineOpacity(bool defaultValue=false) const
void setRenameDuplicatedLayers(bool value)
int frameRenderingTimeout(bool defaultValue=false) const
bool enablePerfLog(bool requestDefault=false) const
void setMaxBrushSize(int value)
void setRenameMergedLayers(bool value)
void setDefaultProofingConfig(const KisProofingConfiguration &config)
QColor selectionOverlayMaskColor(bool defaultValue=false) const
qreal memorySoftLimitPercent(bool requestDefault=false) const
void setMemoryHardLimitPercent(qreal value)
bool useOnDiskAnimationCacheSwapping(bool defaultValue=false) const
void setMemoryPoolLimitPercent(qreal value)
void setAnimationCacheRegionOfInterestMargin(qreal value)
static QStringList supportedMimeTypes(Direction direction)
A Configuration Dialog Page to configure the canvas input.
A container for a set of QAction objects.
Q_INVOKABLE QAction * addAction(const QString &name, QAction *action)
QList< QAction * > actions() const
virtual KisKActionCollection * actionCollection() const
static QString descriptionForMimeType(const QString &mimeType)
Find the user-readable description for the given mimetype.
static KisOpenGLModeProber * instance()
QSurfaceFormat surfaceformatInUse() const
static OpenGLRenderer getCurrentOpenGLRenderer()
static OpenGLRenderers getSupportedOpenGLRenderers()
static QStringList getOpenGLWarnings()
static bool supportsLoD()
static OpenGLRenderer getUserPreferredOpenGLRendererConfig()
static OpenGLRenderer getQtPreferredOpenGLRenderer()
static std::optional< XcbGLProviderProtocol > xcbGlProviderProtocol()
static void setUserPreferredOpenGLRendererConfig(OpenGLRenderer renderer)
static KisPart * instance()
KisMainWindow * currentMainwindow() const
static KisPreferenceSetRegistry * instance()
virtual QString header()=0
virtual void loadPreferences()=0
The KisProofingConfigModel class.
static const QString resourceLocationKey
std::optional< KisSurfaceColorimetry::SurfaceDescription > currentSurfaceDescription() const
void sigScreenChanged(QScreen *screen)
void addCollection(KisKActionCollection *, const QString &title=QString())
static KisSurfaceColorSpaceWrapper fromQtColorSpace(const QColorSpace &colorSpace)
static KoColorSpaceEngineRegistry * instance()
static KoColor fromXML(const QDomElement &elt, const QString &channelDepthId)
void setColor(const quint8 *data, const KoColorSpace *colorSpace=0)
void setOpacity(quint8 alpha)
void fromQColor(const QColor &c)
Convenient function for converting from a QColor.
void toQColor(QColor *c) const
a convenience method for the above.
static const Colorimetry DCIP3
static const Colorimetry BT2020
static const Colorimetry BT709
static const Colorimetry DisplayP3
static const Colorimetry AdobeRGB
const XYZ & white() const
const XYZ & green() const
const T value(const QString &id) const
T get(const QString &id) const
QList< QString > keys() const
static bool tabletInputReceived()
static void getAllUserResourceFoldersLocationsForWindowsStore(QString &standardLocation, QString &privateLocation)
getAllAppDataLocationsForWindowsStore Use this to get both private and general appdata folders which ...
static QString getAppDataLocation()
static QString saveLocation(const QString &type, const QString &suffix=QString(), bool create=true)
~ShortcutSettingsTab() override
WdgShortcutSettings * m_page
QScopedPointer< KisActionsSnapshot > m_snapshot
ShortcutSettingsTab(QWidget *parent=0, const char *name=0)
void slotParentValueChanged()
void slotResolutionSettings()
WdgTabletSettings * m_page
TabletSettingsTab(QWidget *parent=0, const char *name=0)
#define KIS_SAFE_ASSERT_RECOVER(cond)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
QString shortNameOfDisplay(int index)
Q_GUI_EXPORT int qt_defaultDpi()
QIcon addDisabledStatesToIcon(const QIcon &_icon, const QSize &size)
#define koIcon(name)
Use these macros for icons without any issues.
QString button(const QWheelEvent &ev)
QIcon loadIcon(const QString &name)
void setText(QSpinBox *spinBox, const QStringView textTemplate)
void install(QSpinBox *spinBox, std::function< QString(int)> messageFn)
~BackupSuffixValidator() override
State validate(QString &line, int &) const override
BackupSuffixValidator(QObject *parent)
const QStringList invalidCharacters
void linkActivated(const QString &link)
virtual bool isSuitableForDisplay() const =0
virtual const KoColorProfile * addProfile(const QString &filename)=0
QString colorSpaceId(const QString &colorModelId, const QString &colorDepthId) const
static KoColorSpaceRegistry * instance()
QString defaultProfileForColorSpace(const QString &colorSpaceId) const
KoID colorSpaceColorModelId(const QString &_colorSpaceId) const
QList< KoID > listKeys() const
State validate(QString &line, int &) const override
WritableLocationValidator(QObject *parent)