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>
94#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
111#include <config-qt-patches-present.h>
114#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
116# include "config_qt5_has_wintab_switch.h"
118# include <QtGui/private/qguiapplication_p.h>
119# include <QtGui/qpa/qplatformintegration.h>
121#include "config-high-dpi-scale-factor-rounding-policy.h"
134 if (QGuiApplication::screens().
length() <= index) {
137 QScreen* screen = QGuiApplication::screens()[index];
138 QString resolution = QString::number(screen->geometry().width()).append(
"x").append(QString::number(screen->geometry().height()));
139 QString name = screen->name();
154 State
validate(QString &line,
int &)
const override
157 if (!fi.isWritable()) {
168 <<
"0" <<
"1" <<
"2" <<
"3" <<
"4" <<
"5" <<
"6" <<
"7" <<
"8" <<
"9"
169 <<
"/" <<
"\\" <<
":" <<
";" <<
" ")
176 State
validate(QString &line,
int &)
const override
179 if (line.contains(invalidChar)) {
202 if (event->type() == QEvent::Wheel) {
213 QImage imageOrig = _icon.pixmap(size).toImage();
215 auto makeFainter = [imageOrig] (
int alphaVal) {
216 QImage image = imageOrig;
217 QImage alpha = QImage(image.size(), QImage::Format_Alpha8);
218 alpha.fill(alphaVal);
219 image.setAlphaChannel(alpha);
220 QPixmap pixmap = QPixmap();
221 pixmap.convertFromImage(image);
225 QPixmap thirdOpaque = makeFainter(
int(256*0.3));
226 QPixmap halfOpaque = makeFainter(
int(256*0.65));
228 icon.addPixmap(thirdOpaque, QIcon::Mode::Disabled, QIcon::State::Off);
229 icon.addPixmap(thirdOpaque, QIcon::Mode::Disabled, QIcon::State::On);
230 icon.addPixmap(halfOpaque, QIcon::Mode::Normal, QIcon::State::Off);
244 scrollAreaWidgetContents->setAutoFillBackground(
false);
245 scrollAreaWidgetContents->parentWidget()->setAutoFillBackground(
false);
256 << i18n(
"Small Circle")
258 << i18n(
"Triangle Righthanded")
259 << i18n(
"Triangle Lefthanded")
260 << i18n(
"Black Pixel")
261 << i18n(
"White Pixel");
264 << i18nc(
"Display options label to not DISPLAY brush outline",
"No Outline")
265 << i18n(
"Circle Outline")
266 << i18n(
"Preview Outline")
267 << i18n(
"Tilt Outline");
271 m_cmbCursorShape->addItems(cursorItems);
275 m_cmbOutlineShape->addItems(outlineItems);
284 cursorColorButton->setColor(cursorColor);
290 m_cmbEraserCursorShape->addItems(cursorItems);
291 m_cmbEraserCursorShape->addItem(i18n(
"Eraser"));
295 m_cmbEraserOutlineShape->addItems(outlineItems);
304 eraserCursorColorButton->setColor(eraserCursorColor);
310 connect(m_cmbColorSamplerPreviewStyle,
311 QOverload<int>::of(&QComboBox::currentIndexChanged),
316 m_nmbColorSamplerPreviewSize->setRange(1, 400);
321 m_ssbColorSamplerPreviewThickness->setRange(1, 50);
345 chkUseCustomFont->setChecked(cfg.
readEntry<
bool>(
"use_custom_system_font",
false));
346 cmbCustomFont->findChild <QComboBox*>(
"stylesComboBox")->setVisible(
false);
348 QString fontName = cfg.
readEntry<QString>(
"custom_system_font",
"");
349 if (fontName.isEmpty()) {
350 cmbCustomFont->setCurrentFont(qApp->font());
354 int pointSize = qApp->font().pointSize();
355 cmbCustomFont->setCurrentFont(QFont(fontName, pointSize));
357 int fontSize = cfg.
readEntry<
int>(
"custom_font_size", -1);
359 intFontSize->setValue(qApp->font().pointSize());
362 intFontSize->setValue(fontSize);
365 m_cmbMDIType->setCurrentIndex(cfg.
readEntry<
int>(
"mdi_viewmode", (
int)QMdiArea::TabbedView));
375 m_mdiColor->setColor(mdiColor);
381 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
382 QSettings kritarc(configPath + QStringLiteral(
"/kritadisplayrc"), QSettings::IniFormat);
383 m_chkHiDPI->setChecked(kritarc.value(
"EnableHiDPI",
true).toBool());
384#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
385 m_chkHiDPIFractionalScaling->setChecked(kritarc.value(
"EnableHiDPIFractionalScaling",
false).toBool());
387 m_wdgHiDPIFractionalScaling->setEnabled(
false);
389 chkUsageLogging->setChecked(kritarc.value(
"LogUsage",
true).toBool());
396 cmbFlowMode->setCurrentIndex((
int)!cfg.
readEntry<
bool>(
"useCreamyAlphaDarken",
true));
397 cmbCmykBlendingMode->setCurrentIndex((
int)!cfg.
readEntry<
bool>(
"useSubtractiveBlendingForCmykColorSpaces",
true));
399 cmbTouchPainting->addItem(
401 : i18nc(
"touch painting",
"Auto (Enabled)"));
402 cmbTouchPainting->addItem(i18nc(
"touch painting",
"Enabled"));
403 cmbTouchPainting->addItem(i18nc(
"touch painting",
"Disabled"));
405 chkTouchPressureSensitivity->setChecked(cfg.
readEntry(
"useTouchPressureSensitivity",
true));
406 connect(cmbTouchPainting, SIGNAL(currentIndexChanged(
int)),
417 m_cmbKineticScrollingGesture->addItem(i18n(
"On Touch Drag"));
418 m_cmbKineticScrollingGesture->addItem(i18n(
"On Click Drag"));
419 m_cmbKineticScrollingGesture->addItem(i18n(
"On Middle-Click Drag"));
426 m_kineticScrollingSensitivitySlider->setRange(0, 100);
434 chkEnableSelectionActionBar->setChecked(sapEnabled);
441 m_autosaveSpinBox->setValue(autosaveInterval / 60);
442 m_autosaveCheckBox->setChecked(autosaveInterval > 0);
443 chkHideAutosaveFiles->setChecked(cfg.
readEntry<
bool>(
"autosavefileshidden",
true));
446 chkZip64->setChecked(cfg.
useZip64());
447 m_chkTrimKra->setChecked(cfg.
trimKra());
450 m_backupFileCheckBox->setChecked(cfg.
backupFile());
451 cmbBackupFileLocation->setCurrentIndex(cfg.
readEntry<
int>(
"backupfilelocation", 0));
452 txtBackupFileSuffix->setText(cfg.
readEntry<QString>(
"backupfilesuffix",
"~"));
454 txtBackupFileSuffix->setValidator(validator);
455 intNumBackupFiles->setValue(cfg.
readEntry<
int>(
"numberofbackupfiles", 1));
457 cmbDefaultExportFileType->clear();
460 QMap<QString, QString> mimeTypeMap;
462 foreach (
const QString &mimeType, mimeFilter) {
464 mimeTypeMap.insert(description, mimeType);
468 QStringList sortedDescriptions = mimeTypeMap.keys();
469 sortedDescriptions.sort(Qt::CaseInsensitive);
471 cmbDefaultExportFileType->addItem(i18n(
"All Supported Files"),
"all/mime");
472 foreach (
const QString &description, sortedDescriptions) {
473 const QString &mimeType = mimeTypeMap.value(description);
474 cmbDefaultExportFileType->addItem(description, mimeType);
477 const QString mimeTypeToFind = cfg.
exportMimeType(
false).toUtf8();
478 const int index = cmbDefaultExportFileType->findData(mimeTypeToFind);
481 cmbDefaultExportFileType->setCurrentIndex(index);
484 const QString defaultMimeType =
"image/png";
485 const int defaultIndex = cmbDefaultExportFileType->findData(defaultMimeType);
486 if (defaultIndex >= 0) {
487 cmbDefaultExportFileType->setCurrentIndex(defaultIndex);
490 qDebug() <<
"Default mime type not found in the combo box.";
494 QString selectedMimeType = cmbDefaultExportFileType->currentData().toString();
506 cmbStartupSession->addItem(i18n(
"Open default window"));
507 cmbStartupSession->addItem(i18n(
"Load previous session"));
508 cmbStartupSession->addItem(i18n(
"Show session manager"));
517 connect(chkCumulativeUndo, SIGNAL(toggled(
bool)), btnAdvancedCumulativeUndo, SLOT(setEnabled(
bool)));
518 btnAdvancedCumulativeUndo->setEnabled(chkCumulativeUndo->isChecked());
528 KConfigGroup group = KSharedConfig::openConfig()->group(
"File Dialogs");
529 bool dontUseNative =
true;
531 dontUseNative =
false;
534 if (qgetenv(
"XDG_CURRENT_DESKTOP") ==
"KDE") {
535 dontUseNative =
false;
539 dontUseNative =
false;
542 dontUseNative =
false;
544 m_chkNativeFileDialog->setChecked(!group.readEntry(
"DontUseNativeFileDialog", dontUseNative));
546 if (!qEnvironmentVariable(
"APPIMAGE").isEmpty()) {
549 m_chkNativeFileDialog->setChecked(
false);
550 m_chkNativeFileDialog->setEnabled(
false);
558 chkIgnoreHighFunctionKeys->setVisible(
false);
565 m_urlResourceFolder->setConfigurationName(
"resource_directory");
567 if (QFileInfo(resourceLocation).isWritable()) {
568 m_urlResourceFolder->setFileName(resourceLocation);
571 m_urlResourceFolder->setFileName(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
574 m_urlResourceFolder->setValidator(writableValidator);
575 connect(m_urlResourceFolder, SIGNAL(textChanged(QString)), SLOT(
checkResourcePath()));
578 grpRestartMessage->setPixmap(
579 grpRestartMessage->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
580 grpRestartMessage->setText(i18n(
"You will need to Restart Krita for the changes to take an effect."));
582 grpAndroidWarningMessage->setVisible(
false);
583 grpAndroidWarningMessage->setPixmap(
584 grpAndroidWarningMessage->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
585 grpAndroidWarningMessage->setText(
586 i18n(
"Saving at a Location picked from the File Picker may slow down the startup!"));
589 m_urlResourceFolder->setVisible(
false);
591 m_resourceFolderSelector->setVisible(
true);
599 const QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
600 Q_FOREACH(
const QString &location, locations) {
601 if (!filteredLocations.contains(location)) {
602 filteredLocations.append(location);
605 return filteredLocations;
610 Q_FOREACH (QString location, locations) {
612 QFileInfo fileLocation(location);
615 text = i18n(
"Default");
617 }
else if (location.startsWith(
"/data")) {
618 text = i18n(
"Internal Storage");
620 text = i18n(
"SD-Card");
622 if (fileLocation.isWritable()) {
623 writableLocationsAndText.append({text, location});
626 return writableLocationsAndText;
629 for (
auto it = writableLocations.constBegin(); it != writableLocations.constEnd(); ++it) {
630 m_resourceFolderSelector->addItem(it->first +
" - " + it->second);
632 m_resourceFolderSelector->setItemData(m_resourceFolderSelector->count() - 1, it->second, Qt::UserRole);
636 if (resourceLocation.startsWith(
"content://")) {
637 m_resourceFolderSelector->addItem(resourceLocation);
638 int index = m_resourceFolderSelector->count() - 1;
639 m_resourceFolderSelector->setItemData(index, resourceLocation, Qt::UserRole);
640 m_resourceFolderSelector->setCurrentIndex(index);
641 grpAndroidWarningMessage->setVisible(
true);
644 auto iterator = std::find_if(writableLocations.constBegin(),
645 writableLocations.constEnd(),
646 [&resourceLocation](QPair<QString, QString> location) {
647 return location.second == resourceLocation;
650 if (iterator != writableLocations.constEnd()) {
651 int index = writableLocations.indexOf(*iterator);
653 m_resourceFolderSelector->setCurrentIndex(index);
658 m_resourceFolderSelector->addItem(i18n(
"Choose Manually"));
660 connect(m_resourceFolderSelector, qOverload<int>(&QComboBox::activated), [
this](
int index) {
661 const int previousIndex = m_resourceFolderSelector->currentIndex();
664 if (m_resourceFolderSelector->count() - 1 == index) {
665 KoFileDialog dialog(this, KoFileDialog::OpenDirectory,
"Select Directory");
666 const QString selectedDirectory = dialog.filename();
668 if (!selectedDirectory.isEmpty()) {
671 if (m_resourceFolderSelector->itemData(index - 1, Qt::DisplayRole)
673 .startsWith(
"content://")) {
674 m_resourceFolderSelector->setItemText(index - 1, selectedDirectory);
675 m_resourceFolderSelector->setItemData(index - 1, selectedDirectory, Qt::UserRole);
676 m_resourceFolderSelector->setCurrentIndex(index - 1);
679 m_resourceFolderSelector->insertItem(index, selectedDirectory);
680 m_resourceFolderSelector->setItemData(index, selectedDirectory, Qt::UserRole);
681 m_resourceFolderSelector->setCurrentIndex(index);
684 grpAndroidWarningMessage->setVisible(true);
686 m_resourceFolderSelector->setCurrentIndex(previousIndex);
691 grpAndroidWarningMessage->setVisible(
692 m_resourceFolderSelector->currentData(Qt::UserRole).value<QString>().startsWith(
"content://"));
696 m_resourceFolderSelector->setVisible(
false);
699 grpWindowsAppData->setVisible(
false);
701 QString folderInStandardAppData;
702 QString folderInPrivateAppData;
705 if (!folderInPrivateAppData.isEmpty()) {
706 const auto pathToDisplay = [](
const QString &path) {
714 return QDir::toNativeSeparators(path).replace(QChar(
'\\'), QStringLiteral(
u"\\\u200B"));
717 const QDir privateResourceDir(folderInPrivateAppData);
718 const QDir appDataDir(folderInStandardAppData);
719 grpWindowsAppData->setPixmap(
720 grpWindowsAppData->style()->standardIcon(QStyle::SP_MessageBoxInformation).pixmap(QSize(32, 32)));
722 grpWindowsAppData->setText(i18nc(
"@info resource folder",
723 "<p>You are using the Microsoft Store package version of Krita. "
724 "Even though Krita can be configured to place resources under the "
725 "user AppData location, Windows may actually store the files "
726 "inside a private app location.</p>\n"
727 "<p>You should check both locations to determine where "
728 "the files are located.</p>\n"
729 "<p><b>User AppData</b> (<a href=\"copyuser\">Copy</a>):<br/>\n"
731 "<p><b>Private app location</b> (<a href=\"copyprivate\">Copy</a>):<br/>\n"
733 pathToDisplay(appDataDir.absolutePath()),
734 pathToDisplay(privateResourceDir.absolutePath())));
735 grpWindowsAppData->setVisible(
true);
737 connect(grpWindowsAppData,
739 [userPath = appDataDir.absolutePath(),
740 privatePath = privateResourceDir.absolutePath()](
const QString &link) {
741 if (link == QStringLiteral(
"copyuser")) {
742 qApp->clipboard()->setText(QDir::toNativeSeparators(userPath));
743 }
else if (link == QStringLiteral(
"copyprivate")) {
744 qApp->clipboard()->
setText(QDir::toNativeSeparators(privatePath));
746 qWarning() <<
"Unexpected link activated in lblWindowsAppDataNote:" << link;
753 const int forcedFontDPI = cfg.readEntry(
"forcedDpiForQtFontBugWorkaround", -1);
754 chkForcedFontDPI->setChecked(forcedFontDPI > 0);
755 intForcedFontDPI->setValue(forcedFontDPI > 0 ? forcedFontDPI :
qt_defaultDpi());
756 intForcedFontDPI->setEnabled(forcedFontDPI > 0);
757 connect(chkForcedFontDPI, SIGNAL(toggled(
bool)), intForcedFontDPI, SLOT(setEnabled(
bool)));
764 QAbstractButton *
button = m_pasteFormatGroup.button(cfg.pasteFormat(
false));
779 m_chkSeparateEraserCursor->setChecked(cfg.
readEntry<
bool>(
"separateEraserCursor",
false));
792 chkHideAutosaveFiles->setChecked(
true);
798 m_backupFileCheckBox->setChecked(cfg.
backupFile(
true));
799 cmbBackupFileLocation->setCurrentIndex(0);
800 txtBackupFileSuffix->setText(
"~");
801 intNumBackupFiles->setValue(1);
808#if defined Q_OS_ANDROID || defined Q_OS_MACOS || defined Q_OS_WIN
809 m_chkNativeFileDialog->setChecked(
true);
811 m_chkNativeFileDialog->setChecked(
false);
814 intMaxBrushSize->setValue(1000);
819 chkUseCustomFont->setChecked(
false);
820 cmbCustomFont->setCurrentFont(qApp->font());
821 intFontSize->setValue(qApp->font().pointSize());
824 m_cmbMDIType->setCurrentIndex((
int)QMdiArea::TabbedView);
825 m_chkRubberBand->setChecked(cfg.
useOpenGL(
true));
831 m_chkCompressKra->setChecked(cfg.
compressKra(
true));
832 m_chkTrimKra->setChecked(cfg.
trimKra(
true));
834 chkZip64->setChecked(cfg.
useZip64(
true));
835 m_chkHiDPI->setChecked(
true);
836#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
837 m_chkHiDPIFractionalScaling->setChecked(
true);
839 chkUsageLogging->setChecked(
true);
841 cmbFlowMode->setCurrentIndex(0);
845 spnZoomSteps->setValue(cfg.
zoomSteps(
true));
850 cmbTouchPainting->setCurrentIndex(
int(cfg.
touchPainting(
true)));
851 chkTouchPressureSensitivity->setChecked(
true);
858 cursorColorButton->setColor(cursorColor);
862 eraserCursorColorButton->setColor(eraserCursorColor);
870 chkForcedFontDPI->setChecked(
false);
872 intForcedFontDPI->setEnabled(
false);
889 if (dlg.exec() == KoDialog::Accepted) {
897 m_frmColorSamplerCircleSettings->setVisible(circleSettingsVisible);
902 m_lblColorSamplerPreviewSizePreview->setDiameter(
value);
907 m_lblColorSamplerPreviewSizePreview->setThickness(
value/100.0);
912 m_lblColorSamplerPreviewSizePreview->setOutlineEnabled(
value);
917 Q_FOREACH(QAbstractButton*
button, buttonGroup.buttons()) {
926 return (
CursorStyle)m_cmbCursorShape->currentIndex();
936 return (
CursorStyle)m_cmbEraserCursorShape->currentIndex();
941 return (
OutlineStyle)m_cmbEraserOutlineShape->currentIndex();
951 return m_nmbColorSamplerPreviewSize->value();
956 return m_ssbColorSamplerPreviewThickness->value();
961 return m_chkColorSamplerPreviewOutlineEnabled->isChecked();
966 return m_chkColorSamplerPreviewExtraCircles->isChecked();
977 return chkSaveSessionOnQuit->isChecked();
982 return chkShowRootLayer->isChecked();
988 return m_autosaveCheckBox->isChecked() ? m_autosaveSpinBox->value() * 60 : 0;
993 return m_undoStackSize->value();
998 return m_showOutlinePainting->isChecked();
1003 return m_showEraserOutlinePainting->isChecked();
1008 return m_cmbMDIType->currentIndex();
1013 return m_chkCanvasMessages->isChecked();
1018 return m_chkCompressKra->isChecked();
1023 return m_chkTrimKra->isChecked();
1028 return m_chkTrimFramesImport->isChecked();
1033 return cmbDefaultExportFileType->currentData().toString();
1038 return chkZip64->isChecked();
1043 return m_radioToolOptionsInDocker->isChecked();
1048 return spnZoomSteps->value();
1053 return chkEnableLongPress->isChecked();
1058 return m_groupBoxKineticScrollingSettings->isChecked();
1063 return m_cmbKineticScrollingGesture->currentIndex();
1068 return m_kineticScrollingSensitivitySlider->value();
1073 return m_chkKineticScrollingHideScrollbars->isChecked();
1078 return intZoomMarginSize->value();
1083 return m_chkSwitchSelectionCtrlAlt->isChecked();
1088 return m_chkConvertOnImport->isChecked();
1093 return m_chkAutoPin->isChecked();
1098 return m_chkAdaptivePlaybackRange->isChecked();
1103 return m_chkAutoZoom->isChecked();
1108 return chkForcedFontDPI->isChecked() ? intForcedFontDPI->value() : -1;
1115 i18nc(
"Preview option for no color sampler",
"None"),
1116 i18nc(
"Preview option for a circular/ring-shaped color sampler",
"Circle"),
1117 i18nc(
"Preview option for a rectangular color sampler left of the cursor",
"Rectangle Left"),
1118 i18nc(
"Preview option for a rectangular color sampler right of the cursor",
"Rectangle Right"),
1119 i18nc(
"Preview option for a rectangular color sampler above the cursor",
"Rectangle Above"),
1125 cmb->setCurrentIndex(
int(style));
1135 return chkRenameMergedLayers->isChecked();
1140 return chkRenamePastedLayers->isChecked();
1145 return chkRenameDuplicatedLayers->isChecked();
1151 dialog.setCaption(i18n(
"Select a Background Image"));
1152 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
1153 dialog.setImageFilters();
1155 QString fn = dialog.filename();
1162 if (image.isNull()) {
1163 QMessageBox::warning(
this, i18nc(
"@title:window",
"Krita"), i18n(
"%1 is not a valid image file!", fn));
1166 m_backgroundimage->setText(fn);
1173 m_backgroundimage->setText(
"");
1178 const QFileInfo fi(m_urlResourceFolder->fileName());
1179 if (!fi.isWritable()) {
1180 grpNonWritableLocation->setPixmap(
1181 grpNonWritableLocation->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
1182 grpNonWritableLocation->setText(
1183 i18nc(
"@info resource folder",
"<b>Warning:</b> this location is not writable."));
1184 grpNonWritableLocation->setVisible(
true);
1186 grpNonWritableLocation->setVisible(
false);
1192 group_subWinMode->setEnabled(mdi_mode == QMdiArea::SubWindowView);
1207 setObjectName(name);
1209 QGridLayout * l =
new QGridLayout(
this);
1210 l->setContentsMargins(0, 0, 0, 0);
1212 l->addWidget(
m_page, 0, 0);
1220 Q_FOREACH (QAction *action, collection->
actions()) {
1224 QMap<QString, KisKActionCollection*> sortedCollections =
1227 for (
auto it = sortedCollections.constBegin(); it != sortedCollections.constEnd(); ++it) {
1256 setObjectName(name);
1261 QGridLayout * l =
new QGridLayout(
this);
1262 l->setContentsMargins(0, 0, 0, 0);
1264 l->addWidget(
m_page, 0, 0);
1281 id = colorSpaces.erase(
id);
1286 m_page->cmbWorkingColorSpace->setIDList(colorSpaces);
1291 m_page->bnAddColorProfile->setIcon(
koIcon(
"document-import-16"));
1298 QMap<QString, const KoColorProfile *> profileList;
1300 profileList[profile->
name()] = profile;
1301 profiles.append(profile->
name());
1304 std::sort(profiles.begin(), profiles.end());
1305 Q_FOREACH (
const QString profile, profiles) {
1306 m_page->cmbColorProfileForEXR->addSqueezedItem(profile);
1311 const QString userProfile = cfg.
readEntry(
"ExrDefaultColorProfile", defaultProfile);
1313 m_page->cmbColorProfileForEXR->setCurrent(profiles.contains(userProfile) ? userProfile : defaultProfile);
1318 QFormLayout *monitorProfileGrid =
new QFormLayout(
m_page->monitorprofileholder);
1319 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1320 for(
int i = 0; i < QGuiApplication::screens().count(); ++i) {
1321 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)));
1322 lbl->setWordWrap(
true);
1325 cmb->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
1326 monitorProfileGrid->addRow(lbl, cmb);
1332 m_page->chkUseSystemMonitorProfile->setChecked(
false);
1333 m_page->chkUseSystemMonitorProfile->setDisabled(
true);
1334 m_page->chkUseSystemMonitorProfile->setHidden(
true);
1339 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1345 QVBoxLayout *vboxLayout =
new QVBoxLayout(
m_page->monitorprofileholder);
1346 vboxLayout->setContentsMargins(0, 0, 0, 0);
1347 vboxLayout->addItem(
new QSpacerItem(20,20));
1349 QGroupBox *groupBox =
new QGroupBox(i18n(
"Display's color space is managed by the operating system"));
1350 vboxLayout->addWidget(groupBox);
1352 QFormLayout *monitorProfileGrid =
new QFormLayout(groupBox);
1353 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1356 new QCheckBox(i18n(
"Enable canvas color management"),
this);
1359 i18n(
"<p>Enabling canvas color management automatically creates "
1360 "a separate native surface for the canvas. It might cause "
1361 "performance issues on some systems.</p>"
1363 "<p>If color management is disabled, Krita will render "
1364 "the canvas into the surface of the main window, which "
1365 "is considered sRGB. It will cause two limitations:"
1368 " <li>the color gamut will be limited to sRGB</li>"
1369 " <li>color proofing mode will be limited to \"use global display settings\", "
1370 " i.e. paper white proofing will become impossible</li>"
1379 QLabel *canvasSurfaceColorSpaceLbl =
new QLabel(i18n(
"Canvas surface color space:"),
this);
1382 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Preferred by operating system"), QVariant::fromValue(CanvasSurfaceMode::Preferred));
1383 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Rec 709 Gamma 2.2"), QVariant::fromValue(CanvasSurfaceMode::Rec709g22));
1386 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Unmanaged (testing only)"), QVariant::fromValue(CanvasSurfaceMode::Unmanaged));
1389 i18n(
"<p>Color space of the pixels that are transferred to the "
1390 "window compositor. Use \"preferred\" space unless you know "
1391 "what you are doing</p>"));
1396 QLabel *canvasSurfaceBitDepthLbl =
new QLabel(i18n(
"Canvas surface bit depth (needs restart):"),
this);
1399 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"Auto"), QVariant::fromValue(CanvasSurfaceBitDepthMode::DepthAuto));
1400 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"8-bit"), QVariant::fromValue(CanvasSurfaceBitDepthMode::Depth8Bit));
1401 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"10-bit"), QVariant::fromValue(CanvasSurfaceBitDepthMode::Depth10Bit));
1404 i18n(
"<p>The bit depth of the color that is passed to the window "
1405 "compositor. You should switch into 10-bit mode if you want to use "
1406 "HDR capabilities of your display</p>"));
1408 const QString currentBitBepthString = QSurfaceFormat::defaultFormat().redBufferSize() == 10 ? i18n(
"10-bit") : i18n(
"8-bit");
1409 QLabel *currentCanvasSurfaceBitDepthLbl =
new QLabel(i18n(
"Current canvas surface bit depth:"),
this);
1410 QLabel *currentCanvasSurfaceBitDepth =
new QLabel(currentBitBepthString,
this);
1411 monitorProfileGrid->addRow(currentCanvasSurfaceBitDepthLbl, currentCanvasSurfaceBitDepth);
1413 vboxLayout->addItem(
new QSpacerItem(20,20));
1416 QTextBrowser *preferredLbl =
new QTextBrowser(
this);
1418 preferredLbl->setReadOnly(
true);
1420 QHBoxLayout *colorDescriptionChoice =
new QHBoxLayout();
1421 vboxLayout->addLayout(colorDescriptionChoice);
1423 QLabel *descriptionChoiceLabel =
new QLabel(i18n(
"Diagram:"));
1424 colorDescriptionChoice->addWidget(descriptionChoiceLabel);
1426 QRadioButton *containerSpace =
new QRadioButton(i18nc(
"@info:radiobutton",
"Preferred Space"),
this);
1427 colorDescriptionChoice->addWidget(containerSpace);
1428 containerSpace->setToolTip(i18nc(
"@info:tooltip",
"This is the space preferred by the operating system."));
1431 QRadioButton *masteringSpace =
new QRadioButton(i18nc(
"@info:radiobutton",
"Current Display"),
this);
1432 colorDescriptionChoice->addWidget(masteringSpace);
1434 masteringSpace->setToolTip(i18nc(
"@info:tooltip",
"This is the space representing the currently active display."));
1436 QHBoxLayout *colorDescriptionLayout =
new QHBoxLayout();
1437 vboxLayout->addLayout(colorDescriptionLayout);
1440 colorDescriptionLayout->addWidget(preferredLbl);
1442 containerSpace->setChecked(
true);
1443 colorDescriptionChoice->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding));
1496 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1512 button->setChecked(
true);
1525 dialog.setCaption(i18n(
"Install Color Profiles"));
1526 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
1527 dialog.setMimeTypeFilters(
QStringList() <<
"application/vnd.iccprofile",
"application/vnd.iccprofile");
1531 Q_ASSERT(iccEngine);
1535 Q_FOREACH (
const QString &profileName, profileNames) {
1536 if (!QFile::copy(profileName, saveLocation + QFileInfo(profileName).fileName())) {
1537 qWarning() <<
"Could not install profile!" << saveLocation + QFileInfo(profileName).fileName();
1540 iccEngine->
addProfile(saveLocation + QFileInfo(profileName).fileName());
1546 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1560 if (useSystemProfile) {
1562 if (devices.size() == QApplication::screens().count()) {
1563 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1566 Q_FOREACH (
const QString &device, devices) {
1569 if (devices[i] == monitorForScreen) {
1579 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1589 m_page->cmbWorkingColorSpace->setEnabled(useDefColorSpace);
1594 m_page->cmbWorkingColorSpace->setCurrent(
"RGBA");
1598 m_page->cmbColorProfileForEXR->setCurrent(defaultProfile);
1628 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1640 button->setChecked(
true);
1649 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1653 QMap<QString, const KoColorProfile *> profileList;
1655 profileList[profile->
name()] = profile;
1658 Q_FOREACH (
const KoColorProfile *profile, profileList.values()) {
1661 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1667 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1678 m_page->wdgProofingOptions->setDisplayConfigOptions(options);
1690#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1694 if (currentDescription) {
1695 if (std::holds_alternative<KisSurfaceColorimetry::Colorimetry>(currentDescription->colorSpace.primaries)) {
1696 auto col = std::get<KisSurfaceColorimetry::Colorimetry>(currentDescription->colorSpace.primaries);
1697 colorants << col.red().toxyY() << col.green().toxyY() << col.blue().toxyY();
1698 whitePoint = col.white().toxyY();
1702 auto named = std::get<KisSurfaceColorimetry::NamedPrimaries>(currentDescription->colorSpace.primaries);
1731 if (currentDescription && currentDescription->masteringInfo) {
1732 auto col = currentDescription->masteringInfo->primaries;
1733 colorants << col.red().toxyY() << col.green().toxyY() << col.blue().toxyY();
1734 whitePoint = col.white().toxyY();
1752 m_page->pressureCurve->setCurve(curve);
1754 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1755 KisConfig(
true).useRightMiddleTabletButtonWorkaround(
true));
1757#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1761 m_page->grpTabletApi->setVisible(
false);
1764#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1765 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1766 cfg.usePageUpDownMouseButtonEmulationWorkaround(
true));
1769#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1770 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1771 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround(
true));
1774#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1775 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround(
true));
1778 m_page->chkUseTimestampsForBrushSpeed->setChecked(
false);
1779 m_page->intMaxAllowedBrushSpeed->setValue(30);
1780 m_page->intBrushSpeedSmoothing->setValue(3);
1781 m_page->tiltDirectionOffsetAngle->setAngle(0);
1786 setObjectName(name);
1788 QGridLayout * l =
new QGridLayout(
this);
1789 l->setContentsMargins(0, 0, 0, 0);
1791 l->addWidget(
m_page, 0, 0);
1795 m_page->pressureCurve->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
1796 m_page->pressureCurve->setCurve(curve);
1798 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1801#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1802# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1803 QString actualTabletProtocol =
"<unknown>";
1804 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
1805 if (
auto nativeWindowsApp =
dynamic_cast<QWindowsApplication *
>(QGuiApplicationPrivate::platformIntegration())) {
1806 actualTabletProtocol = nativeWindowsApp->isWinTabEnabled() ?
"WinTab" :
"Windows Ink";
1808 m_page->grpTabletApi->setTitle(i18n(
"Tablet Input API (currently active API: \"%1\")", actualTabletProtocol));
1814 connect(
m_page->radioWintab, SIGNAL(toggled(
bool)),
m_page->btnResolutionSettings, SLOT(setEnabled(
bool)));
1815 m_page->btnResolutionSettings->setEnabled(
m_page->radioWintab->isChecked());
1817 m_page->grpTabletApi->setVisible(
false);
1822 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed (may cause severe artifacts when using WinTab tablet API)"));
1824 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed"));
1826 m_page->chkUseTimestampsForBrushSpeed->setChecked(cfg.
readEntry(
"useTimestampsForBrushSpeed",
false));
1828#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1829 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1830 cfg.usePageUpDownMouseButtonEmulationWorkaround());
1832 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->hide();
1835#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1836 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1837 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround());
1839 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->hide();
1842#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1843 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround());
1845 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->hide();
1848 m_page->intMaxAllowedBrushSpeed->setRange(1, 100);
1849 m_page->intMaxAllowedBrushSpeed->setValue(cfg.
readEntry(
"maxAllowedSpeedValue", 30));
1854 return i18np(
"Maximum brush speed: {n} px/ms",
"Maximum brush speed: {n} px/ms", value);
1857 m_page->intBrushSpeedSmoothing->setRange(3, 100);
1858 m_page->intBrushSpeedSmoothing->setValue(cfg.
readEntry(
"speedValueSmoothing", 3));
1863 return i18np(
"Brush speed smoothing: {n} sample",
"Brush speed smoothing: {n} samples", value);
1866 m_page->tiltDirectionOffsetAngle->setDecimals(0);
1867 m_page->tiltDirectionOffsetAngle->setRange(-180, 180);
1869 m_page->tiltDirectionOffsetAngle->setAngle(-cfg.
readEntry(
"tiltDirectionOffset", 0.0));
1870 m_page->tiltDirectionOffsetAngle->setPrefix(i18n(
"Pen tilt direction offset: "));
1877 tabletTestDialog.exec();
1903 return intMemoryLimit->value() - intPoolLimit->value();
1911 const double totalRAM = cfg.
totalRAM();
1912 lblTotalMemory->setText(KFormat().formatByteSize(totalRAM * 1024 * 1024, 0, KFormat::IECBinaryDialect, KFormat::UnitMegaByte));
1915 sliderMemoryLimit->setRange(1, 100, 2);
1916 sliderMemoryLimit->setSingleStep(0.01);
1919 sliderPoolLimit->setRange(0, 20, 2);
1920 sliderPoolLimit->setSingleStep(0.01);
1923 sliderUndoLimit->setRange(0, 50, 2);
1924 sliderUndoLimit->setSingleStep(0.01);
1926 intMemoryLimit->setMinimumWidth(80);
1927 intPoolLimit->setMinimumWidth(80);
1928 intUndoLimit->setMinimumWidth(80);
1931 formLayout->takeRow(2);
1932 label_5->setVisible(
false);
1933 intPoolLimit->setVisible(
false);
1934 sliderPoolLimit->setVisible(
false);
1948 std::bind(&KisIntParseSpinBox::value,
1952 connect(intMemoryLimit, SIGNAL(valueChanged(
int)), sync2, SLOT(slotParentValueChanged()));
1963 connect(intPoolLimit, SIGNAL(valueChanged(
int)), sync3, SLOT(slotParentValueChanged()));
1964 connect(intMemoryLimit, SIGNAL(valueChanged(
int)), sync3, SLOT(slotParentValueChanged()));
1968 sliderSwapSize->setSuffix(i18n(
" GiB"));
1969 sliderSwapSize->setRange(1, 64);
1970 intSwapSize->setRange(1, 64);
1976 intSwapSize, SLOT(setValue(
int)));
1979 sliderSwapSize, SLOT(setValue(
int)));
1982 swapFileLocation->setConfigurationName(
"swapfile_location");
1983 swapFileLocation->setFileName(cfg.
swapDir());
1985 sliderThreadsLimit->setRange(1, QThread::idealThreadCount());
1986 sliderFrameClonesLimit->setRange(1, QThread::idealThreadCount());
1988 sliderFrameTimeout->setRange(5, 600);
1989 sliderFrameTimeout->setSuffix(i18nc(
"suffix for \"seconds\"",
" sec"));
1992 sliderFpsLimit->setSuffix(i18n(
" fps"));
2000 intCachedFramesSizeLimit->setRange(256, 10000);
2001 intCachedFramesSizeLimit->setSuffix(i18n(
" px"));
2002 intCachedFramesSizeLimit->setSingleStep(1);
2003 intCachedFramesSizeLimit->setPageStep(1000);
2005 intRegionOfInterestMargin->setRange(1, 100);
2007 i18nc(
"{n} is the number value, % is the percent sign",
"{n}%"));
2008 intRegionOfInterestMargin->setSingleStep(1);
2009 intRegionOfInterestMargin->setPageStep(10);
2011 connect(chkCachedFramesSizeLimit, SIGNAL(toggled(
bool)), intCachedFramesSizeLimit, SLOT(setEnabled(
bool)));
2012 connect(chkUseRegionOfInterest, SIGNAL(toggled(
bool)), intRegionOfInterestMargin, SLOT(setEnabled(
bool)));
2014 connect(chkTransformToolUseInStackPreview, SIGNAL(toggled(
bool)), chkTransformToolForceLodMode, SLOT(setEnabled(
bool)));
2018 chkDisableAVXOptimizations->setVisible(
false);
2037 chkPerformanceLogging->setChecked(cfg.
enablePerfLog(requestDefault));
2040 sliderSwapSize->setValue(cfg.
maxSwapSize(requestDefault) / 1024);
2041 swapFileLocation->setFileName(cfg.
swapDir(requestDefault));
2049#if KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
2053 chkDetectFps->setVisible(
false);
2067 optOnDisk->setChecked(
true);
2069 optInMemory->setChecked(
true);
2074 intCachedFramesSizeLimit->setEnabled(chkCachedFramesSizeLimit->isChecked());
2078 intRegionOfInterestMargin->setEnabled(chkUseRegionOfInterest->isChecked());
2081 KConfigGroup group = KSharedConfig::openConfig()->group(
"KisToolTransform");
2082 chkTransformToolUseInStackPreview->setChecked(!group.readEntry(
"useOverlayPreviewStyle",
false));
2083 chkTransformToolForceLodMode->setChecked(group.readEntry(
"forceLodMode",
true));
2084 chkTransformToolForceLodMode->setEnabled(chkTransformToolUseInStackPreview->isChecked());
2088 KConfigGroup group = KSharedConfig::openConfig()->group(
"KritaTransform/KisToolMove");
2089 chkMoveToolForceLodMode->setChecked(group.readEntry(
"forceLodMode",
false));
2093 KConfigGroup group( KSharedConfig::openConfig(),
"filterdialog");
2094 chkFiltersForceLodMode->setChecked(group.readEntry(
"forceLodMode",
true));
2111 cfg.
setSwapDir(swapFileLocation->fileName());
2117#if KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
2141 KConfigGroup group = KSharedConfig::openConfig()->group(
"KisToolTransform");
2142 group.writeEntry(
"useOverlayPreviewStyle", !chkTransformToolUseInStackPreview->isChecked());
2143 group.writeEntry(
"forceLodMode", chkTransformToolForceLodMode->isChecked());
2147 KConfigGroup group = KSharedConfig::openConfig()->group(
"KritaTransform/KisToolMove");
2148 group.writeEntry(
"forceLodMode", chkMoveToolForceLodMode->isChecked());
2152 KConfigGroup group( KSharedConfig::openConfig(),
"filterdialog");
2153 group.writeEntry(
"forceLodMode", chkFiltersForceLodMode->isChecked());
2177#include <QOpenGLContext>
2184 const QString csString =
2191 "Unknown Color Space";
2193 return QString(
"%1 (%2 bit)").arg(csString).arg(depth);
2231 const QString rendererOpenGLText = i18nc(
"canvas renderer",
"OpenGL");
2232 const QString rendererSoftwareText = i18nc(
"canvas renderer",
"Software Renderer (very slow)");
2234 const QString rendererOpenGLESText =
2235 qEnvironmentVariable(
"QT_ANGLE_PLATFORM") !=
"opengl"
2236 ? i18nc(
"canvas renderer",
"Direct3D 11 via ANGLE")
2237 : i18nc(
"canvas renderer",
"OpenGL via ANGLE");
2239 const QString rendererOpenGLESText = i18nc(
"canvas renderer",
"OpenGL ES");
2246 i18nc(
"canvas renderer",
"Unknown"));
2248 cmbPreferredRenderer->clear();
2251 const bool onlyOneRendererSupported =
2257 if (!onlyOneRendererSupported) {
2258 QString qtPreferredRendererText;
2260 qtPreferredRendererText = rendererOpenGLESText;
2262 qtPreferredRendererText = rendererSoftwareText;
2264 qtPreferredRendererText = rendererOpenGLText;
2266 cmbPreferredRenderer->addItem(i18nc(
"canvas renderer",
"Auto (%1)", qtPreferredRendererText),
KisOpenGL::RendererAuto);
2267 cmbPreferredRenderer->setCurrentIndex(0);
2269 cmbPreferredRenderer->setEnabled(
false);
2275 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2282 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2289 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2293 if (!(supportedRenderers &
2298 grpOpenGL->setEnabled(
false);
2299 grpOpenGL->setChecked(
false);
2300 chkUseTextureBuffer->setEnabled(
false);
2301 cmbAssistantsDrawMode->setEnabled(
false);
2302 cmbFilterMode->setEnabled(
false);
2304 grpOpenGL->setEnabled(
true);
2306 chkUseTextureBuffer->setEnabled(cfg.
useOpenGL());
2308 cmbAssistantsDrawMode->setEnabled(cfg.
useOpenGL());
2309 cmbAssistantsDrawMode->setCurrentIndex(assistantDrawModeToIndex(cfg.
assistantsDrawMode()));
2310 cmbFilterMode->setEnabled(cfg.
useOpenGL());
2314 cmbFilterMode->removeItem(3);
2321 lblPreferredXcbGlApi->setVisible(currentXcbGlProvider.has_value());
2322 cmbPreferredXcbGlApi->setVisible(currentXcbGlProvider.has_value());
2324 if (currentXcbGlProvider.has_value()) {
2325 const QString glxCurrent = i18nc(
"@item:inlistbox",
"GLX (current)");
2326 const QString glxNotCurrent = i18nc(
"@item:inlistbox",
"GLX");
2327 const QString eglCurrent = i18nc(
"@item:inlistbox",
"EGL (current)");
2328 const QString eglNotCurrent = i18nc(
"@item:inlistbox",
"EGL");
2333 cmbPreferredXcbGlApi->setToolTip(i18nc(
"@info:tooltip",
2334 "<p>If you are using Krita on X11 or XWayland and experience slowness, "
2335 "try switching between EGL and GLX</p>"));
2340 int index = cmbPreferredXcbGlApi->findData(preferredValue);
2345 cmbPreferredXcbGlApi->setCurrentIndex(index);
2349 lblCurrentDisplayFormat->setText(
"");
2350 lblCurrentRootSurfaceFormat->setText(
"");
2351 grpHDRWarning->setVisible(
false);
2360 QOpenGLContext *context = QOpenGLContext::currentContext();
2363 context = QOpenGLContext::globalShareContext();
2369 if (screen && adapter.
isValid()) {
2374 toolTip << i18n(
"Display Id: %1", info.
screen->name());
2375 toolTip << i18n(
"Display Name: %1 %2", info.
screen->manufacturer(), info.
screen->model());
2376 toolTip << i18n(
"Min Luminance: %1", info.
minLuminance);
2377 toolTip << i18n(
"Max Luminance: %1", info.
maxLuminance);
2384 lblCurrentDisplayFormat->setToolTip(toolTip.join(
'\n'));
2387 lblCurrentDisplayFormat->setToolTip(
"");
2388 lblCurrentDisplayFormat->setText(i18n(
"Unknown"));
2391 lblCurrentDisplayFormat->setToolTip(
"");
2392 lblCurrentDisplayFormat->setText(i18n(
"Unknown"));
2393 qWarning() <<
"Failed to fetch display info:" << adapter.
errorString();
2398 lblCurrentRootSurfaceFormat->setText(colorSpaceString(colorSpace, currentFormat.redBufferSize()));
2399 cmbPreferedRootSurfaceFormat->setCurrentIndex(formatToIndex(cfg.
rootSurfaceFormat()));
2405 HDR->setEnabled(
false);
2413 const int hdrTabIndex = tabWidget->indexOf(
HDR);
2415 if (hdrTabIndex >= 0) {
2416 tabWidget->setTabVisible(hdrTabIndex,
false);
2422 if (openglWarnings.isEmpty()) {
2423 grpOpenGLWarnings->setVisible(
false);
2425 QString text = QString(
"<p><b>%1</b>").arg(i18n(
"Warning(s):"));
2426 text.append(
"<ul>");
2427 Q_FOREACH (
const QString &warning, openglWarnings) {
2428 text.append(
"<li>");
2429 text.append(warning.toHtmlEscaped());
2430 text.append(
"</li>");
2432 text.append(
"</ul></p>");
2433 grpOpenGLWarnings->setText(text);
2434 grpOpenGLWarnings->setPixmap(
2435 grpOpenGLWarnings->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
2436 grpOpenGLWarnings->setVisible(
true);
2444 btnSelectionOverlayColor->setColor(c);
2445 sldSelectionOverlayOpacity->setRange(0.0, 1.0, 2);
2446 sldSelectionOverlayOpacity->setSingleStep(0.05);
2449 sldSelectionOutlineOpacity->setRange(0.0, 1.0, 2);
2450 sldSelectionOutlineOpacity->setSingleStep(0.05);
2453 intCheckSize->setValue(cfg.
checkSize());
2457 colorChecks1->setColor(ck1);
2460 colorChecks2->setColor(ck2);
2463 canvasBorder->setColor(cb);
2474 pixelGridColorButton->setColor(gridColor);
2482 cmbPreferredRenderer->setCurrentIndex(0);
2485 grpOpenGL->setEnabled(
false);
2486 grpOpenGL->setChecked(
false);
2487 chkUseTextureBuffer->setEnabled(
false);
2488 cmbAssistantsDrawMode->setEnabled(
false);
2489 cmbFilterMode->setEnabled(
false);
2492 grpOpenGL->setEnabled(
true);
2493 grpOpenGL->setChecked(cfg.
useOpenGL(
true));
2495 chkUseTextureBuffer->setEnabled(
true);
2496 cmbAssistantsDrawMode->setEnabled(
true);
2497 cmbAssistantsDrawMode->setCurrentIndex(assistantDrawModeToIndex(cfg.
assistantsDrawMode(
true)));
2498 cmbFilterMode->setEnabled(
true);
2509 btnSelectionOverlayColor->setColor(c);
2514 intCheckSize->setValue(cfg.
checkSize(
true));
2517 colorChecks1->setColor(ck1);
2520 colorChecks2->setColor(ck2);
2523 canvasBorder->setColor(cvb);
2528 chkHidePopups->setChecked(cfg.
hidePopups(
true));
2532 pixelGridColorButton->setColor(gridColor);
2542 chkUseTextureBuffer->setEnabled(isChecked);
2543 cmbFilterMode->setEnabled(isChecked);
2544 cmbAssistantsDrawMode->setEnabled(isChecked);
2551 QOpenGLContext *context = QOpenGLContext::currentContext();
2560 grpHDRWarning->setVisible(
true);
2561 grpHDRWarning->setPixmap(
2562 grpHDRWarning->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
2563 grpHDRWarning->setText(i18n(
"<b>Warning:</b> current display doesn't support HDR rendering"));
2565 grpHDRWarning->setVisible(
false);
2611 connect(chkShowColorHistory, SIGNAL(toggled(
bool)), cmbColorHistorySorting, SLOT(setEnabled(
bool)));
2612 connect(chkShowColorHistory, SIGNAL(toggled(
bool)), lblColorHistorySorting, SLOT(setEnabled(
bool)));
2623 sbPaletteSize->setValue(config.
readEntry(
"popuppalette/size", 385));
2624 sbSelectorSize->setValue(config.
readEntry(
"popuppalette/selectorSize", 140));
2625 cmbSelectorType->setCurrentIndex(config.
readEntry<
bool>(
"popuppalette/usevisualcolorselector",
false) ? 1 : 0);
2626 chkShowColorHistory->setChecked(config.
readEntry(
"popuppalette/showColorHistory",
true));
2627 chkShowRotationTrack->setChecked(config.
readEntry(
"popuppalette/showRotationTrack",
true));
2628 chkUseDynamicSlotCount->setChecked(config.
readEntry(
"popuppalette/useDynamicSlotCount",
true));
2629 grpFixTriangleRotation->setChecked(config.
readEntry(
"popuppalette/fixTriangleRotation",
false));
2630 sbTriangleRotationAngle->setValue(config.
readEntry(
"popuppalette/triangleRotationAngle", 0));
2632 QString currentSorting = config.
readEntry(
"popuppalette/colorHistorySorting", QString(
"hsv"));
2633 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2634 currentSorting =
"hsv";
2636 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2637 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2638 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2639 grpFixTriangleRotation->setEnabled(!cmbSelectorType->currentIndex());
2648 config.
writeEntry(
"popuppalette/size", sbPaletteSize->value());
2649 config.
writeEntry(
"popuppalette/selectorSize", sbSelectorSize->value());
2650 config.
writeEntry<
bool>(
"popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2651 config.
writeEntry<
bool>(
"popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2652 config.
writeEntry<
bool>(
"popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2653 config.
writeEntry<
bool>(
"popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2654 config.
writeEntry(
"popuppalette/colorHistorySorting",
2655 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2656 config.
writeEntry<
bool>(
"popuppalette/fixTriangleRotation", grpFixTriangleRotation->isChecked());
2657 config.
writeEntry(
"popuppalette/triangleRotationAngle", sbTriangleRotationAngle->value());
2664 sbPaletteSize->setValue(385);
2665 sbSelectorSize->setValue(140);
2666 cmbSelectorType->setCurrentIndex(0);
2667 chkShowColorHistory->setChecked(
true);
2668 chkShowRotationTrack->setChecked(
true);
2669 chkUseDynamicSlotCount->setChecked(
true);
2670 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2671 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2672 grpFixTriangleRotation->setChecked(
false);
2673 sbTriangleRotationAngle->setValue(0);
2677 grpFixTriangleRotation->setEnabled(!index);
2683 : KPageDialog(parent)
2686 setWindowTitle(i18n(
"Configure Krita"));
2687 setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
2689 setFaceType(KPageDialog::List);
2693 KPageWidgetItem *page =
new KPageWidgetItem(vbox, i18n(
"General"));
2694 page->setObjectName(
"general");
2695 page->setHeader(i18n(
"General"));
2703 page =
new KPageWidgetItem(vbox, i18n(
"Keyboard Shortcuts"));
2704 page->setObjectName(
"shortcuts");
2705 page->setHeader(i18n(
"Shortcuts"));
2716 page->setHeader(i18n(
"Canvas Input"));
2717 page->setObjectName(
"canvasinput");
2723 page =
new KPageWidgetItem(vbox, i18n(
"Display"));
2724 page->setObjectName(
"display");
2725 page->setHeader(i18n(
"Display"));
2733 page =
new KPageWidgetItem(vbox, i18n(
"Color Management"));
2734 page->setObjectName(
"colormanagement");
2735 page->setHeader(i18nc(
"Label of color as in Color Management",
"Color"));
2743 page =
new KPageWidgetItem(vbox, i18n(
"Performance"));
2744 page->setObjectName(
"performance");
2745 page->setHeader(i18n(
"Performance"));
2753 page =
new KPageWidgetItem(vbox, i18n(
"Tablet settings"));
2754 page->setObjectName(
"tablet");
2755 page->setHeader(i18n(
"Tablet"));
2763 page =
new KPageWidgetItem(vbox, i18n(
"Canvas-only settings"));
2764 page->setObjectName(
"canvasonly");
2765 page->setHeader(i18n(
"Canvas-only"));
2773 page =
new KPageWidgetItem(vbox, i18n(
"Pop-up Palette"));
2774 page->setObjectName(
"popuppalette");
2775 page->setHeader(i18n(
"Pop-up Palette"));
2783 page = addPage(
m_authorPage, i18nc(
"@title:tab Author page",
"Author" ));
2784 page->setObjectName(
"author");
2785 page->setHeader(i18n(
"Author"));
2789 KGuiItem::assign(
button(QDialogButtonBox::Ok), KStandardGuiItem::ok());
2790 KGuiItem::assign(
button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
2791 QPushButton *restoreDefaultsButton =
button(QDialogButtonBox::RestoreDefaults);
2792 restoreDefaultsButton->setText(i18nc(
"@action:button",
"Restore Defaults"));
2800 Q_FOREACH(
const QString &key, keys) {
2804 page =
new KPageWidgetItem(vbox, preferenceSet->
name());
2805 page->setHeader(preferenceSet->
header());
2806 page->setIcon(preferenceSet->
icon());
2808 preferenceSet->setParent(vbox);
2811 connect(restoreDefaultsButton, SIGNAL(clicked(
bool)), preferenceSet, SLOT(loadDefaultPreferences()), Qt::UniqueConnection);
2812 connect(
this, SIGNAL(accepted()), preferenceSet, SLOT(savePreferences()), Qt::UniqueConnection);
2815 connect(restoreDefaultsButton, SIGNAL(clicked(
bool)),
this, SLOT(
slotDefault()));
2818 QString currentPageName = cfg.
readEntry<QString>(
"KisDlgPreferences/CurrentPage");
2819 Q_FOREACH(KPageWidgetItem *page,
m_pages) {
2820 if (page->objectName() == currentPageName) {
2821 setCurrentPage(page);
2827#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
2831 const auto *titleWidget = findChild<KTitleWidget*>();
2833 QLayoutItem *titleFrame = titleWidget->layout()->itemAt(0);
2835 titleFrame->widget()->setBackgroundRole(QPalette::Window);
2845 cfg.
writeEntry<QString>(
"KisDlgPreferences/CurrentPage", currentPage()->objectName());
2849 KPageDialog::showEvent(event);
2850 button(QDialogButtonBox::Cancel)->setAutoDefault(
false);
2851 button(QDialogButtonBox::Ok)->setAutoDefault(
false);
2852 button(QDialogButtonBox::RestoreDefaults)->setAutoDefault(
false);
2853 button(QDialogButtonBox::Cancel)->setDefault(
false);
2854 button(QDialogButtonBox::Ok)->setDefault(
false);
2855 button(QDialogButtonBox::RestoreDefaults)->setDefault(
false);
2860 if (buttonBox()->buttonRole(
button) == QDialogButtonBox::RejectRole) {
2867 if (currentPage()->objectName() ==
"general") {
2870 else if (currentPage()->objectName() ==
"shortcuts") {
2873 else if (currentPage()->objectName() ==
"display") {
2876 else if (currentPage()->objectName() ==
"colormanagement") {
2879 else if (currentPage()->objectName() ==
"performance") {
2882 else if (currentPage()->objectName() ==
"tablet") {
2885 else if (currentPage()->objectName() ==
"canvasonly") {
2888 else if (currentPage()->objectName() ==
"canvasinput") {
2891 else if (currentPage()->objectName() ==
"popuppalette") {
2899 switch (page_enum) {
2907 name =
"colormanagement";
2910 name =
"performance";
2919 name =
"canvasonly";
2922 name =
"canvasinput";
2925 name =
"popuppalette";
2929 Q_FOREACH (KPageWidgetItem *page,
m_pages) {
2930 if (page->objectName() == name) {
2939 switch (page.
page) {
2941 QWidget *tab =
nullptr;
2968 m_general->tabWidget->setCurrentWidget(tab);
2971 QWidget *tab =
nullptr;
2986 QWidget *tab =
nullptr;
3004 QWidget *tab =
nullptr;
3029 connect(this->buttonBox(), SIGNAL(clicked(QAbstractButton*)),
this, SLOT(
slotButtonClicked(QAbstractButton*)));
3031 if (page.has_value()) {
3037 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()) {
3156 for (
int i = 0; i < QApplication::screens().count(); ++i) {
3195#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
3198# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
3200 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
3201 if (
auto nativeWindowsApp =
dynamic_cast<QWindowsApplication *
>(QGuiApplicationPrivate::platformIntegration())) {
3208#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
3209 cfg.setUsePageUpDownMouseButtonEmulationWorkaround(
3213#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
3214 cfg.setUseHighFunctionKeyMouseButtonEmulationWorkaround(
3218#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
3219 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
void toggleAllowMonitorProfileSelection(bool useSystemProfile)
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)
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)
bool renameMergedLayers()
static void setColorSamplerPreviewStyleIndexByValue(QComboBox *cmb, KisConfig::ColorSamplerPreviewStyle style)
void enableSubWindowOptions(int)
bool colorSamplerPreviewCircleOutlineEnabled() 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.
QStringList devices(DeviceType type=screen) const
Return a list of device id's for the specified type.
static KisColorManager * instance()
void setCumulativeUndoData(KisCumulativeUndoData value)
bool backupFile(bool defaultValue=false) const
void setAntialiasCurves(bool v) const
void setSwitchSelectionCtrlAlt(bool value)
bool antialiasSelectionOutline(bool defaultValue=false) const
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 setMonitorProfile(int screen, const QString &monitorProfile, bool override) 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
void setUseSystemMonitorProfile(bool _useSystemMonitorProfile) 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
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.
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 setMonitorForScreen(int screen, const QString &monitor)
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
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
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)
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 useSystemMonitorProfile(bool defaultValue=false) 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
QString monitorForScreen(int screen, const QString &defaultMonitor, bool defaultValue=true) const
void setAutoPinLayersToTimeline(bool value)
QColor getEraserCursorMainColor(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()
KoID colorSpaceColorDepthId(const QString &_colorSpaceId) const
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)