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)
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) {
218 scrollAreaWidgetContents->setAutoFillBackground(
false);
219 scrollAreaWidgetContents->parentWidget()->setAutoFillBackground(
false);
230 << i18n(
"Small Circle")
232 << i18n(
"Triangle Righthanded")
233 << i18n(
"Triangle Lefthanded")
234 << i18n(
"Black Pixel")
235 << i18n(
"White Pixel");
238 << i18nc(
"Display options label to not DISPLAY brush outline",
"No Outline")
239 << i18n(
"Circle Outline")
240 << i18n(
"Preview Outline")
241 << i18n(
"Tilt Outline");
245 m_cmbCursorShape->addItems(cursorItems);
249 m_cmbOutlineShape->addItems(outlineItems);
258 cursorColorButton->setColor(cursorColor);
264 m_cmbEraserCursorShape->addItems(cursorItems);
265 m_cmbEraserCursorShape->addItem(i18n(
"Eraser"));
269 m_cmbEraserOutlineShape->addItems(outlineItems);
278 eraserCursorColorButton->setColor(eraserCursorColor);
284 connect(m_cmbColorSamplerPreviewStyle,
285 QOverload<int>::of(&QComboBox::currentIndexChanged),
290 m_nmbColorSamplerPreviewSize->setRange(1, 400);
295 m_ssbColorSamplerPreviewThickness->setRange(1, 50);
319 chkUseCustomFont->setChecked(cfg.
readEntry<
bool>(
"use_custom_system_font",
false));
320 cmbCustomFont->findChild <QComboBox*>(
"stylesComboBox")->setVisible(
false);
322 QString fontName = cfg.
readEntry<QString>(
"custom_system_font",
"");
323 if (fontName.isEmpty()) {
324 cmbCustomFont->setCurrentFont(qApp->font());
328 int pointSize = qApp->font().pointSize();
329 cmbCustomFont->setCurrentFont(QFont(fontName, pointSize));
331 int fontSize = cfg.
readEntry<
int>(
"custom_font_size", -1);
333 intFontSize->setValue(qApp->font().pointSize());
336 intFontSize->setValue(fontSize);
339 m_cmbMDIType->setCurrentIndex(cfg.
readEntry<
int>(
"mdi_viewmode", (
int)QMdiArea::TabbedView));
349 m_mdiColor->setColor(mdiColor);
355 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
356 QSettings kritarc(configPath + QStringLiteral(
"/kritadisplayrc"), QSettings::IniFormat);
357 m_chkHiDPI->setChecked(kritarc.value(
"EnableHiDPI",
true).toBool());
358#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
359 m_chkHiDPIFractionalScaling->setChecked(kritarc.value(
"EnableHiDPIFractionalScaling",
false).toBool());
361 m_wdgHiDPIFractionalScaling->setEnabled(
false);
363 chkUsageLogging->setChecked(kritarc.value(
"LogUsage",
true).toBool());
370 cmbFlowMode->setCurrentIndex((
int)!cfg.
readEntry<
bool>(
"useCreamyAlphaDarken",
true));
371 cmbCmykBlendingMode->setCurrentIndex((
int)!cfg.
readEntry<
bool>(
"useSubtractiveBlendingForCmykColorSpaces",
true));
373 cmbTouchPainting->addItem(
375 : i18nc(
"touch painting",
"Auto (Enabled)"));
376 cmbTouchPainting->addItem(i18nc(
"touch painting",
"Enabled"));
377 cmbTouchPainting->addItem(i18nc(
"touch painting",
"Disabled"));
379 chkTouchPressureSensitivity->setChecked(cfg.
readEntry(
"useTouchPressureSensitivity",
true));
380 connect(cmbTouchPainting, SIGNAL(currentIndexChanged(
int)),
391 m_cmbKineticScrollingGesture->addItem(i18n(
"On Touch Drag"));
392 m_cmbKineticScrollingGesture->addItem(i18n(
"On Click Drag"));
393 m_cmbKineticScrollingGesture->addItem(i18n(
"On Middle-Click Drag"));
400 m_kineticScrollingSensitivitySlider->setRange(0, 100);
413 m_autosaveSpinBox->setValue(autosaveInterval / 60);
414 m_autosaveCheckBox->setChecked(autosaveInterval > 0);
415 chkHideAutosaveFiles->setChecked(cfg.
readEntry<
bool>(
"autosavefileshidden",
true));
418 chkZip64->setChecked(cfg.
useZip64());
419 m_chkTrimKra->setChecked(cfg.
trimKra());
422 m_backupFileCheckBox->setChecked(cfg.
backupFile());
423 cmbBackupFileLocation->setCurrentIndex(cfg.
readEntry<
int>(
"backupfilelocation", 0));
424 txtBackupFileSuffix->setText(cfg.
readEntry<QString>(
"backupfilesuffix",
"~"));
426 txtBackupFileSuffix->setValidator(validator);
427 intNumBackupFiles->setValue(cfg.
readEntry<
int>(
"numberofbackupfiles", 1));
429 cmbDefaultExportFileType->clear();
432 QMap<QString, QString> mimeTypeMap;
434 foreach (
const QString &mimeType, mimeFilter) {
436 mimeTypeMap.insert(description, mimeType);
440 QStringList sortedDescriptions = mimeTypeMap.keys();
441 sortedDescriptions.sort(Qt::CaseInsensitive);
443 cmbDefaultExportFileType->addItem(i18n(
"All Supported Files"),
"all/mime");
444 foreach (
const QString &description, sortedDescriptions) {
445 const QString &mimeType = mimeTypeMap.value(description);
446 cmbDefaultExportFileType->addItem(description, mimeType);
449 const QString mimeTypeToFind = cfg.
exportMimeType(
false).toUtf8();
450 const int index = cmbDefaultExportFileType->findData(mimeTypeToFind);
453 cmbDefaultExportFileType->setCurrentIndex(index);
456 const QString defaultMimeType =
"image/png";
457 const int defaultIndex = cmbDefaultExportFileType->findData(defaultMimeType);
458 if (defaultIndex >= 0) {
459 cmbDefaultExportFileType->setCurrentIndex(defaultIndex);
462 qDebug() <<
"Default mime type not found in the combo box.";
466 QString selectedMimeType = cmbDefaultExportFileType->currentData().toString();
478 cmbStartupSession->addItem(i18n(
"Open default window"));
479 cmbStartupSession->addItem(i18n(
"Load previous session"));
480 cmbStartupSession->addItem(i18n(
"Show session manager"));
489 connect(chkCumulativeUndo, SIGNAL(toggled(
bool)), btnAdvancedCumulativeUndo, SLOT(setEnabled(
bool)));
490 btnAdvancedCumulativeUndo->setEnabled(chkCumulativeUndo->isChecked());
500 KConfigGroup group = KSharedConfig::openConfig()->group(
"File Dialogs");
501 bool dontUseNative =
true;
503 dontUseNative =
false;
506 if (qgetenv(
"XDG_CURRENT_DESKTOP") ==
"KDE") {
507 dontUseNative =
false;
511 dontUseNative =
false;
514 dontUseNative =
false;
516 m_chkNativeFileDialog->setChecked(!group.readEntry(
"DontUseNativeFileDialog", dontUseNative));
518 if (!qEnvironmentVariable(
"APPIMAGE").isEmpty()) {
521 m_chkNativeFileDialog->setChecked(
false);
522 m_chkNativeFileDialog->setEnabled(
false);
530 chkIgnoreHighFunctionKeys->setVisible(
false);
537 m_urlResourceFolder->setConfigurationName(
"resource_directory");
539 if (QFileInfo(resourceLocation).isWritable()) {
540 m_urlResourceFolder->setFileName(resourceLocation);
543 m_urlResourceFolder->setFileName(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
546 txtBackupFileSuffix->setValidator(writableValidator);
547 connect(m_urlResourceFolder, SIGNAL(textChanged(QString)), SLOT(
checkResourcePath()));
550 grpRestartMessage->setPixmap(
551 grpRestartMessage->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
552 grpRestartMessage->setText(i18n(
"You will need to Restart Krita for the changes to take an effect."));
554 grpAndroidWarningMessage->setVisible(
false);
555 grpAndroidWarningMessage->setPixmap(
556 grpAndroidWarningMessage->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
557 grpAndroidWarningMessage->setText(
558 i18n(
"Saving at a Location picked from the File Picker may slow down the startup!"));
561 m_urlResourceFolder->setVisible(
false);
563 m_resourceFolderSelector->setVisible(
true);
571 const QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
572 Q_FOREACH(
const QString &location, locations) {
573 if (!filteredLocations.contains(location)) {
574 filteredLocations.append(location);
577 return filteredLocations;
582 Q_FOREACH (QString location, locations) {
584 QFileInfo fileLocation(location);
587 text = i18n(
"Default");
589 }
else if (location.startsWith(
"/data")) {
590 text = i18n(
"Internal Storage");
592 text = i18n(
"SD-Card");
594 if (fileLocation.isWritable()) {
595 writableLocationsAndText.append({text, location});
598 return writableLocationsAndText;
601 for (
auto it = writableLocations.constBegin(); it != writableLocations.constEnd(); ++it) {
602 m_resourceFolderSelector->addItem(it->first +
" - " + it->second);
604 m_resourceFolderSelector->setItemData(m_resourceFolderSelector->count() - 1, it->second, Qt::UserRole);
608 if (resourceLocation.startsWith(
"content://")) {
609 m_resourceFolderSelector->addItem(resourceLocation);
610 int index = m_resourceFolderSelector->count() - 1;
611 m_resourceFolderSelector->setItemData(index, resourceLocation, Qt::UserRole);
612 m_resourceFolderSelector->setCurrentIndex(index);
613 grpAndroidWarningMessage->setVisible(
true);
616 auto iterator = std::find_if(writableLocations.constBegin(),
617 writableLocations.constEnd(),
618 [&resourceLocation](QPair<QString, QString> location) {
619 return location.second == resourceLocation;
622 if (iterator != writableLocations.constEnd()) {
623 int index = writableLocations.indexOf(*iterator);
625 m_resourceFolderSelector->setCurrentIndex(index);
630 m_resourceFolderSelector->addItem(i18n(
"Choose Manually"));
632 connect(m_resourceFolderSelector, qOverload<int>(&QComboBox::activated), [
this](
int index) {
633 const int previousIndex = m_resourceFolderSelector->currentIndex();
636 if (m_resourceFolderSelector->count() - 1 == index) {
637 KoFileDialog dialog(this, KoFileDialog::OpenDirectory,
"Select Directory");
638 const QString selectedDirectory = dialog.filename();
640 if (!selectedDirectory.isEmpty()) {
643 if (m_resourceFolderSelector->itemData(index - 1, Qt::DisplayRole)
645 .startsWith(
"content://")) {
646 m_resourceFolderSelector->setItemText(index - 1, selectedDirectory);
647 m_resourceFolderSelector->setItemData(index - 1, selectedDirectory, Qt::UserRole);
648 m_resourceFolderSelector->setCurrentIndex(index - 1);
651 m_resourceFolderSelector->insertItem(index, selectedDirectory);
652 m_resourceFolderSelector->setItemData(index, selectedDirectory, Qt::UserRole);
653 m_resourceFolderSelector->setCurrentIndex(index);
656 grpAndroidWarningMessage->setVisible(true);
658 m_resourceFolderSelector->setCurrentIndex(previousIndex);
663 grpAndroidWarningMessage->setVisible(
664 m_resourceFolderSelector->currentData(Qt::UserRole).value<QString>().startsWith(
"content://"));
668 m_resourceFolderSelector->setVisible(
false);
671 grpWindowsAppData->setVisible(
false);
673 QString folderInStandardAppData;
674 QString folderInPrivateAppData;
677 if (!folderInPrivateAppData.isEmpty()) {
678 const auto pathToDisplay = [](
const QString &path) {
686 return QDir::toNativeSeparators(path).replace(QChar(
'\\'), QStringLiteral(
u"\\\u200B"));
689 const QDir privateResourceDir(folderInPrivateAppData);
690 const QDir appDataDir(folderInStandardAppData);
691 grpWindowsAppData->setPixmap(
692 grpWindowsAppData->style()->standardIcon(QStyle::SP_MessageBoxInformation).pixmap(QSize(32, 32)));
694 grpWindowsAppData->setText(i18nc(
"@info resource folder",
695 "<p>You are using the Microsoft Store package version of Krita. "
696 "Even though Krita can be configured to place resources under the "
697 "user AppData location, Windows may actually store the files "
698 "inside a private app location.</p>\n"
699 "<p>You should check both locations to determine where "
700 "the files are located.</p>\n"
701 "<p><b>User AppData</b> (<a href=\"copyuser\">Copy</a>):<br/>\n"
703 "<p><b>Private app location</b> (<a href=\"copyprivate\">Copy</a>):<br/>\n"
705 pathToDisplay(appDataDir.absolutePath()),
706 pathToDisplay(privateResourceDir.absolutePath())));
707 grpWindowsAppData->setVisible(
true);
709 connect(grpWindowsAppData,
711 [userPath = appDataDir.absolutePath(),
712 privatePath = privateResourceDir.absolutePath()](
const QString &link) {
713 if (link == QStringLiteral(
"copyuser")) {
714 qApp->clipboard()->setText(QDir::toNativeSeparators(userPath));
715 }
else if (link == QStringLiteral(
"copyprivate")) {
716 qApp->clipboard()->
setText(QDir::toNativeSeparators(privatePath));
718 qWarning() <<
"Unexpected link activated in lblWindowsAppDataNote:" << link;
725 const int forcedFontDPI = cfg.readEntry(
"forcedDpiForQtFontBugWorkaround", -1);
726 chkForcedFontDPI->setChecked(forcedFontDPI > 0);
727 intForcedFontDPI->setValue(forcedFontDPI > 0 ? forcedFontDPI :
qt_defaultDpi());
728 intForcedFontDPI->setEnabled(forcedFontDPI > 0);
729 connect(chkForcedFontDPI, SIGNAL(toggled(
bool)), intForcedFontDPI, SLOT(setEnabled(
bool)));
736 QAbstractButton *
button = m_pasteFormatGroup.button(cfg.pasteFormat(
false));
751 m_chkSeparateEraserCursor->setChecked(cfg.
readEntry<
bool>(
"separateEraserCursor",
false));
764 chkHideAutosaveFiles->setChecked(
true);
770 m_backupFileCheckBox->setChecked(cfg.
backupFile(
true));
771 cmbBackupFileLocation->setCurrentIndex(0);
772 txtBackupFileSuffix->setText(
"~");
773 intNumBackupFiles->setValue(1);
780#if defined Q_OS_ANDROID || defined Q_OS_MACOS || defined Q_OS_WIN
781 m_chkNativeFileDialog->setChecked(
true);
783 m_chkNativeFileDialog->setChecked(
false);
786 intMaxBrushSize->setValue(1000);
791 chkUseCustomFont->setChecked(
false);
792 cmbCustomFont->setCurrentFont(qApp->font());
793 intFontSize->setValue(qApp->font().pointSize());
796 m_cmbMDIType->setCurrentIndex((
int)QMdiArea::TabbedView);
797 m_chkRubberBand->setChecked(cfg.
useOpenGL(
true));
803 m_chkCompressKra->setChecked(cfg.
compressKra(
true));
804 m_chkTrimKra->setChecked(cfg.
trimKra(
true));
806 chkZip64->setChecked(cfg.
useZip64(
true));
807 m_chkHiDPI->setChecked(
true);
808#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
809 m_chkHiDPIFractionalScaling->setChecked(
true);
811 chkUsageLogging->setChecked(
true);
813 cmbFlowMode->setCurrentIndex(0);
817 spnZoomSteps->setValue(cfg.
zoomSteps(
true));
822 cmbTouchPainting->setCurrentIndex(
int(cfg.
touchPainting(
true)));
823 chkTouchPressureSensitivity->setChecked(
true);
830 cursorColorButton->setColor(cursorColor);
834 eraserCursorColorButton->setColor(eraserCursorColor);
842 chkForcedFontDPI->setChecked(
false);
844 intForcedFontDPI->setEnabled(
false);
861 if (dlg.exec() == KoDialog::Accepted) {
869 m_frmColorSamplerCircleSettings->setVisible(circleSettingsVisible);
874 m_lblColorSamplerPreviewSizePreview->setDiameter(
value);
879 m_lblColorSamplerPreviewSizePreview->setThickness(
value/100.0);
884 m_lblColorSamplerPreviewSizePreview->setOutlineEnabled(
value);
889 return (
CursorStyle)m_cmbCursorShape->currentIndex();
899 return (
CursorStyle)m_cmbEraserCursorShape->currentIndex();
904 return (
OutlineStyle)m_cmbEraserOutlineShape->currentIndex();
914 return m_nmbColorSamplerPreviewSize->value();
919 return m_ssbColorSamplerPreviewThickness->value();
924 return m_chkColorSamplerPreviewOutlineEnabled->isChecked();
929 return m_chkColorSamplerPreviewExtraCircles->isChecked();
940 return chkSaveSessionOnQuit->isChecked();
945 return chkShowRootLayer->isChecked();
951 return m_autosaveCheckBox->isChecked() ? m_autosaveSpinBox->value() * 60 : 0;
956 return m_undoStackSize->value();
961 return m_showOutlinePainting->isChecked();
966 return m_showEraserOutlinePainting->isChecked();
971 return m_cmbMDIType->currentIndex();
976 return m_chkCanvasMessages->isChecked();
981 return m_chkCompressKra->isChecked();
986 return m_chkTrimKra->isChecked();
991 return m_chkTrimFramesImport->isChecked();
996 return cmbDefaultExportFileType->currentData().toString();
1001 return chkZip64->isChecked();
1006 return m_radioToolOptionsInDocker->isChecked();
1011 return spnZoomSteps->value();
1016 return chkEnableLongPress->isChecked();
1021 return m_groupBoxKineticScrollingSettings->isChecked();
1026 return m_cmbKineticScrollingGesture->currentIndex();
1031 return m_kineticScrollingSensitivitySlider->value();
1036 return m_chkKineticScrollingHideScrollbars->isChecked();
1041 return intZoomMarginSize->value();
1046 return m_chkSwitchSelectionCtrlAlt->isChecked();
1051 return m_chkConvertOnImport->isChecked();
1056 return m_chkAutoPin->isChecked();
1061 return m_chkAdaptivePlaybackRange->isChecked();
1066 return m_chkAutoZoom->isChecked();
1071 return chkForcedFontDPI->isChecked() ? intForcedFontDPI->value() : -1;
1078 i18nc(
"Preview option for no color sampler",
"None"),
1079 i18nc(
"Preview option for a circular/ring-shaped color sampler",
"Circle"),
1080 i18nc(
"Preview option for a rectangular color sampler left of the cursor",
"Rectangle Left"),
1081 i18nc(
"Preview option for a rectangular color sampler right of the cursor",
"Rectangle Right"),
1082 i18nc(
"Preview option for a rectangular color sampler above the cursor",
"Rectangle Above"),
1088 cmb->setCurrentIndex(
int(style));
1098 return chkRenameMergedLayers->isChecked();
1103 return chkRenamePastedLayers->isChecked();
1108 return chkRenameDuplicatedLayers->isChecked();
1114 dialog.setCaption(i18n(
"Select a Background Image"));
1115 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
1116 dialog.setImageFilters();
1118 QString fn = dialog.filename();
1125 if (image.isNull()) {
1126 QMessageBox::warning(
this, i18nc(
"@title:window",
"Krita"), i18n(
"%1 is not a valid image file!", fn));
1129 m_backgroundimage->setText(fn);
1136 m_backgroundimage->setText(
"");
1141 const QFileInfo fi(m_urlResourceFolder->fileName());
1142 if (!fi.isWritable()) {
1143 grpNonWritableLocation->setPixmap(
1144 grpNonWritableLocation->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
1145 grpNonWritableLocation->setText(
1146 i18nc(
"@info resource folder",
"<b>Warning:</b> this location is not writable."));
1147 grpNonWritableLocation->setVisible(
true);
1149 grpNonWritableLocation->setVisible(
false);
1155 group_subWinMode->setEnabled(mdi_mode == QMdiArea::SubWindowView);
1170 setObjectName(name);
1172 QGridLayout * l =
new QGridLayout(
this);
1173 l->setContentsMargins(0, 0, 0, 0);
1175 l->addWidget(
m_page, 0, 0);
1183 Q_FOREACH (QAction *action, collection->
actions()) {
1187 QMap<QString, KisKActionCollection*> sortedCollections =
1190 for (
auto it = sortedCollections.constBegin(); it != sortedCollections.constEnd(); ++it) {
1219 setObjectName(name);
1224 QGridLayout * l =
new QGridLayout(
this);
1225 l->setContentsMargins(0, 0, 0, 0);
1227 l->addWidget(
m_page, 0, 0);
1244 id = colorSpaces.erase(
id);
1249 m_page->cmbWorkingColorSpace->setIDList(colorSpaces);
1254 m_page->bnAddColorProfile->setIcon(
koIcon(
"document-import-16"));
1261 QMap<QString, const KoColorProfile *> profileList;
1263 profileList[profile->
name()] = profile;
1264 profiles.append(profile->
name());
1267 std::sort(profiles.begin(), profiles.end());
1268 Q_FOREACH (
const QString profile, profiles) {
1269 m_page->cmbColorProfileForEXR->addSqueezedItem(profile);
1274 const QString userProfile = cfg.
readEntry(
"ExrDefaultColorProfile", defaultProfile);
1276 m_page->cmbColorProfileForEXR->setCurrent(profiles.contains(userProfile) ? userProfile : defaultProfile);
1281 QFormLayout *monitorProfileGrid =
new QFormLayout(
m_page->monitorprofileholder);
1282 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1283 for(
int i = 0; i < QGuiApplication::screens().count(); ++i) {
1284 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)));
1285 lbl->setWordWrap(
true);
1288 cmb->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
1289 monitorProfileGrid->addRow(lbl, cmb);
1295 m_page->chkUseSystemMonitorProfile->setChecked(
false);
1296 m_page->chkUseSystemMonitorProfile->setDisabled(
true);
1297 m_page->chkUseSystemMonitorProfile->setHidden(
true);
1302 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1308 QVBoxLayout *vboxLayout =
new QVBoxLayout(
m_page->monitorprofileholder);
1309 vboxLayout->setContentsMargins(0, 0, 0, 0);
1310 vboxLayout->addItem(
new QSpacerItem(20,20));
1312 QGroupBox *groupBox =
new QGroupBox(i18n(
"Display's color space is managed by the operating system"));
1313 vboxLayout->addWidget(groupBox);
1315 QFormLayout *monitorProfileGrid =
new QFormLayout(groupBox);
1316 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1319 new QCheckBox(i18n(
"Enable canvas color management"),
this);
1322 i18n(
"<p>Enabling canvas color management automatically creates "
1323 "a separate native surface for the canvas. It might cause "
1324 "performance issues on some systems.</p>"
1326 "<p>If color management is disabled, Krita will render "
1327 "the canvas into the surface of the main window, which "
1328 "is considered sRGB. It will cause two limitations:"
1331 " <li>the color gamut will be limited to sRGB</li>"
1332 " <li>color proofing mode will be limited to \"use global display settings\", "
1333 " i.e. paper white proofing will become impossible</li>"
1342 QLabel *canvasSurfaceColorSpaceLbl =
new QLabel(i18n(
"Canvas surface color space:"),
this);
1345 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Preferred by operating system"), QVariant::fromValue(CanvasSurfaceMode::Preferred));
1346 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Rec 709 Gamma 2.2"), QVariant::fromValue(CanvasSurfaceMode::Rec709g22));
1349 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Unmanaged (testing only)"), QVariant::fromValue(CanvasSurfaceMode::Unmanaged));
1352 i18n(
"<p>Color space of the pixels that are transferred to the "
1353 "window compositor. Use \"preferred\" space unless you know "
1354 "what you are doing</p>"));
1359 QLabel *canvasSurfaceBitDepthLbl =
new QLabel(i18n(
"Canvas surface bit depth (needs restart):"),
this);
1362 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"Auto"), QVariant::fromValue(CanvasSurfaceBitDepthMode::DepthAuto));
1363 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"8-bit"), QVariant::fromValue(CanvasSurfaceBitDepthMode::Depth8Bit));
1364 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"10-bit"), QVariant::fromValue(CanvasSurfaceBitDepthMode::Depth10Bit));
1367 i18n(
"<p>The bit depth of the color that is passed to the window "
1368 "compositor. You should switch into 10-bit mode if you want to use "
1369 "HDR capabilities of your display</p>"));
1371 const QString currentBitBepthString = QSurfaceFormat::defaultFormat().redBufferSize() == 10 ? i18n(
"10-bit") : i18n(
"8-bit");
1372 QLabel *currentCanvasSurfaceBitDepthLbl =
new QLabel(i18n(
"Current canvas surface bit depth:"),
this);
1373 QLabel *currentCanvasSurfaceBitDepth =
new QLabel(currentBitBepthString,
this);
1374 monitorProfileGrid->addRow(currentCanvasSurfaceBitDepthLbl, currentCanvasSurfaceBitDepth);
1376 vboxLayout->addItem(
new QSpacerItem(20,20));
1379 QTextBrowser *preferredLbl =
new QTextBrowser(
this);
1381 preferredLbl->setReadOnly(
true);
1383 QHBoxLayout *colorDescriptionChoice =
new QHBoxLayout();
1384 vboxLayout->addLayout(colorDescriptionChoice);
1386 QLabel *descriptionChoiceLabel =
new QLabel(i18n(
"Diagram:"));
1387 colorDescriptionChoice->addWidget(descriptionChoiceLabel);
1389 QRadioButton *containerSpace =
new QRadioButton(i18nc(
"@info:radiobutton",
"Preferred Space"),
this);
1390 colorDescriptionChoice->addWidget(containerSpace);
1391 containerSpace->setToolTip(i18nc(
"@info:tooltip",
"This is the space preferred by the operating system."));
1394 QRadioButton *masteringSpace =
new QRadioButton(i18nc(
"@info:radiobutton",
"Current Display"),
this);
1395 colorDescriptionChoice->addWidget(masteringSpace);
1397 masteringSpace->setToolTip(i18nc(
"@info:tooltip",
"This is the space representing the currently active display."));
1399 QHBoxLayout *colorDescriptionLayout =
new QHBoxLayout();
1400 vboxLayout->addLayout(colorDescriptionLayout);
1403 colorDescriptionLayout->addWidget(preferredLbl);
1405 containerSpace->setChecked(
true);
1406 colorDescriptionChoice->addItem(
new QSpacerItem(0, 0, QSizePolicy::Expanding));
1459 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1475 button->setChecked(
true);
1488 dialog.setCaption(i18n(
"Install Color Profiles"));
1489 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
1490 dialog.setMimeTypeFilters(
QStringList() <<
"application/vnd.iccprofile",
"application/vnd.iccprofile");
1494 Q_ASSERT(iccEngine);
1498 Q_FOREACH (
const QString &profileName, profileNames) {
1499 if (!QFile::copy(profileName, saveLocation + QFileInfo(profileName).fileName())) {
1500 qWarning() <<
"Could not install profile!" << saveLocation + QFileInfo(profileName).fileName();
1503 iccEngine->
addProfile(saveLocation + QFileInfo(profileName).fileName());
1509 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1523 if (useSystemProfile) {
1525 if (devices.size() == QApplication::screens().count()) {
1526 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1529 Q_FOREACH (
const QString &device, devices) {
1532 if (devices[i] == monitorForScreen) {
1542 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1552 m_page->cmbWorkingColorSpace->setEnabled(useDefColorSpace);
1557 m_page->cmbWorkingColorSpace->setCurrent(
"RGBA");
1561 m_page->cmbColorProfileForEXR->setCurrent(defaultProfile);
1591 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1603 button->setChecked(
true);
1612 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1616 QMap<QString, const KoColorProfile *> profileList;
1618 profileList[profile->
name()] = profile;
1621 Q_FOREACH (
const KoColorProfile *profile, profileList.values()) {
1624 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1630 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1641 m_page->wdgProofingOptions->setDisplayConfigOptions(options);
1650 QVector <double> whitePoint;
1653#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1657 if (currentDescription) {
1658 if (std::holds_alternative<KisSurfaceColorimetry::Colorimetry>(currentDescription->colorSpace.primaries)) {
1659 auto col = std::get<KisSurfaceColorimetry::Colorimetry>(currentDescription->colorSpace.primaries);
1660 colorants << col.red().toxy().x << col.red().toxy().y << col.red().toxyY().Y
1661 << col.green().toxy().x << col.green().toxy().y << col.green().toxyY().Y
1662 << col.blue().toxy().x << col.blue().toxy().y << col.blue().toxyY().Y;
1663 whitePoint << col.white().toxy().x << col.white().toxy().y << col.white().toxyY().Y;
1667 auto named = std::get<KisSurfaceColorimetry::NamedPrimaries>(currentDescription->colorSpace.primaries);
1698 if (currentDescription && currentDescription->masteringInfo) {
1699 auto col = currentDescription->masteringInfo->primaries;
1700 colorants << col.red().toxy().x << col.red().toxy().y << col.red().toxyY().Y
1701 << col.green().toxy().x << col.green().toxy().y << col.green().toxyY().Y
1702 << col.blue().toxy().x << col.blue().toxy().y << col.blue().toxyY().Y;
1703 whitePoint << col.white().toxy().x << col.white().toxy().y << col.white().toxyY().Y;
1721 m_page->pressureCurve->setCurve(curve);
1723 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1724 KisConfig(
true).useRightMiddleTabletButtonWorkaround(
true));
1726#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1730 m_page->grpTabletApi->setVisible(
false);
1733#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1734 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1735 cfg.usePageUpDownMouseButtonEmulationWorkaround(
true));
1738#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1739 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1740 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround(
true));
1743#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1744 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround(
true));
1747 m_page->chkUseTimestampsForBrushSpeed->setChecked(
false);
1748 m_page->intMaxAllowedBrushSpeed->setValue(30);
1749 m_page->intBrushSpeedSmoothing->setValue(3);
1750 m_page->tiltDirectionOffsetAngle->setAngle(0);
1755 setObjectName(name);
1757 QGridLayout * l =
new QGridLayout(
this);
1758 l->setContentsMargins(0, 0, 0, 0);
1760 l->addWidget(
m_page, 0, 0);
1764 m_page->pressureCurve->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
1765 m_page->pressureCurve->setCurve(curve);
1767 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1770#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1771# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1772 QString actualTabletProtocol =
"<unknown>";
1773 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
1774 if (
auto nativeWindowsApp =
dynamic_cast<QWindowsApplication *
>(QGuiApplicationPrivate::platformIntegration())) {
1775 actualTabletProtocol = nativeWindowsApp->isWinTabEnabled() ?
"WinTab" :
"Windows Ink";
1777 m_page->grpTabletApi->setTitle(i18n(
"Tablet Input API (currently active API: \"%1\")", actualTabletProtocol));
1783 connect(
m_page->radioWintab, SIGNAL(toggled(
bool)),
m_page->btnResolutionSettings, SLOT(setEnabled(
bool)));
1784 m_page->btnResolutionSettings->setEnabled(
m_page->radioWintab->isChecked());
1786 m_page->grpTabletApi->setVisible(
false);
1791 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed (may cause severe artifacts when using WinTab tablet API)"));
1793 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed"));
1795 m_page->chkUseTimestampsForBrushSpeed->setChecked(cfg.
readEntry(
"useTimestampsForBrushSpeed",
false));
1797#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1798 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1799 cfg.usePageUpDownMouseButtonEmulationWorkaround());
1801 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->hide();
1804#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1805 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1806 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround());
1808 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->hide();
1811#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1812 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround());
1814 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->hide();
1817 m_page->intMaxAllowedBrushSpeed->setRange(1, 100);
1818 m_page->intMaxAllowedBrushSpeed->setValue(cfg.
readEntry(
"maxAllowedSpeedValue", 30));
1823 return i18np(
"Maximum brush speed: {n} px/ms",
"Maximum brush speed: {n} px/ms", value);
1826 m_page->intBrushSpeedSmoothing->setRange(3, 100);
1827 m_page->intBrushSpeedSmoothing->setValue(cfg.
readEntry(
"speedValueSmoothing", 3));
1832 return i18np(
"Brush speed smoothing: {n} sample",
"Brush speed smoothing: {n} samples", value);
1835 m_page->tiltDirectionOffsetAngle->setDecimals(0);
1836 m_page->tiltDirectionOffsetAngle->setRange(-180, 180);
1838 m_page->tiltDirectionOffsetAngle->setAngle(-cfg.
readEntry(
"tiltDirectionOffset", 0.0));
1839 m_page->tiltDirectionOffsetAngle->setPrefix(i18n(
"Pen tilt direction offset: "));
1846 tabletTestDialog.exec();
1872 return intMemoryLimit->value() - intPoolLimit->value();
1880 const double totalRAM = cfg.
totalRAM();
1881 lblTotalMemory->setText(KFormat().formatByteSize(totalRAM * 1024 * 1024, 0, KFormat::IECBinaryDialect, KFormat::UnitMegaByte));
1884 sliderMemoryLimit->setRange(1, 100, 2);
1885 sliderMemoryLimit->setSingleStep(0.01);
1888 sliderPoolLimit->setRange(0, 20, 2);
1889 sliderPoolLimit->setSingleStep(0.01);
1892 sliderUndoLimit->setRange(0, 50, 2);
1893 sliderUndoLimit->setSingleStep(0.01);
1895 intMemoryLimit->setMinimumWidth(80);
1896 intPoolLimit->setMinimumWidth(80);
1897 intUndoLimit->setMinimumWidth(80);
1900 formLayout->takeRow(2);
1901 label_5->setVisible(
false);
1902 intPoolLimit->setVisible(
false);
1903 sliderPoolLimit->setVisible(
false);
1917 std::bind(&KisIntParseSpinBox::value,
1921 connect(intMemoryLimit, SIGNAL(valueChanged(
int)), sync2, SLOT(slotParentValueChanged()));
1932 connect(intPoolLimit, SIGNAL(valueChanged(
int)), sync3, SLOT(slotParentValueChanged()));
1933 connect(intMemoryLimit, SIGNAL(valueChanged(
int)), sync3, SLOT(slotParentValueChanged()));
1937 sliderSwapSize->setSuffix(i18n(
" GiB"));
1938 sliderSwapSize->setRange(1, 64);
1939 intSwapSize->setRange(1, 64);
1945 intSwapSize, SLOT(setValue(
int)));
1948 sliderSwapSize, SLOT(setValue(
int)));
1951 swapFileLocation->setConfigurationName(
"swapfile_location");
1952 swapFileLocation->setFileName(cfg.
swapDir());
1954 sliderThreadsLimit->setRange(1, QThread::idealThreadCount());
1955 sliderFrameClonesLimit->setRange(1, QThread::idealThreadCount());
1957 sliderFrameTimeout->setRange(5, 600);
1958 sliderFrameTimeout->setSuffix(i18nc(
"suffix for \"seconds\"",
" sec"));
1961 sliderFpsLimit->setSuffix(i18n(
" fps"));
1969 intCachedFramesSizeLimit->setRange(256, 10000);
1970 intCachedFramesSizeLimit->setSuffix(i18n(
" px"));
1971 intCachedFramesSizeLimit->setSingleStep(1);
1972 intCachedFramesSizeLimit->setPageStep(1000);
1974 intRegionOfInterestMargin->setRange(1, 100);
1976 i18nc(
"{n} is the number value, % is the percent sign",
"{n}%"));
1977 intRegionOfInterestMargin->setSingleStep(1);
1978 intRegionOfInterestMargin->setPageStep(10);
1980 connect(chkCachedFramesSizeLimit, SIGNAL(toggled(
bool)), intCachedFramesSizeLimit, SLOT(setEnabled(
bool)));
1981 connect(chkUseRegionOfInterest, SIGNAL(toggled(
bool)), intRegionOfInterestMargin, SLOT(setEnabled(
bool)));
1983 connect(chkTransformToolUseInStackPreview, SIGNAL(toggled(
bool)), chkTransformToolForceLodMode, SLOT(setEnabled(
bool)));
1987 chkDisableAVXOptimizations->setVisible(
false);
2006 chkPerformanceLogging->setChecked(cfg.
enablePerfLog(requestDefault));
2009 sliderSwapSize->setValue(cfg.
maxSwapSize(requestDefault) / 1024);
2010 swapFileLocation->setFileName(cfg.
swapDir(requestDefault));
2018#if KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
2022 chkDetectFps->setVisible(
false);
2036 optOnDisk->setChecked(
true);
2038 optInMemory->setChecked(
true);
2043 intCachedFramesSizeLimit->setEnabled(chkCachedFramesSizeLimit->isChecked());
2047 intRegionOfInterestMargin->setEnabled(chkUseRegionOfInterest->isChecked());
2050 KConfigGroup group = KSharedConfig::openConfig()->group(
"KisToolTransform");
2051 chkTransformToolUseInStackPreview->setChecked(!group.readEntry(
"useOverlayPreviewStyle",
false));
2052 chkTransformToolForceLodMode->setChecked(group.readEntry(
"forceLodMode",
true));
2053 chkTransformToolForceLodMode->setEnabled(chkTransformToolUseInStackPreview->isChecked());
2057 KConfigGroup group = KSharedConfig::openConfig()->group(
"KritaTransform/KisToolMove");
2058 chkMoveToolForceLodMode->setChecked(group.readEntry(
"forceLodMode",
false));
2062 KConfigGroup group( KSharedConfig::openConfig(),
"filterdialog");
2063 chkFiltersForceLodMode->setChecked(group.readEntry(
"forceLodMode",
true));
2080 cfg.
setSwapDir(swapFileLocation->fileName());
2086#if KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
2110 KConfigGroup group = KSharedConfig::openConfig()->group(
"KisToolTransform");
2111 group.writeEntry(
"useOverlayPreviewStyle", !chkTransformToolUseInStackPreview->isChecked());
2112 group.writeEntry(
"forceLodMode", chkTransformToolForceLodMode->isChecked());
2116 KConfigGroup group = KSharedConfig::openConfig()->group(
"KritaTransform/KisToolMove");
2117 group.writeEntry(
"forceLodMode", chkMoveToolForceLodMode->isChecked());
2121 KConfigGroup group( KSharedConfig::openConfig(),
"filterdialog");
2122 group.writeEntry(
"forceLodMode", chkFiltersForceLodMode->isChecked());
2146#include <QOpenGLContext>
2153 const QString csString =
2160 "Unknown Color Space";
2162 return QString(
"%1 (%2 bit)").arg(csString).arg(depth);
2200 const QString rendererOpenGLText = i18nc(
"canvas renderer",
"OpenGL");
2201 const QString rendererSoftwareText = i18nc(
"canvas renderer",
"Software Renderer (very slow)");
2203 const QString rendererOpenGLESText =
2204 qEnvironmentVariable(
"QT_ANGLE_PLATFORM") !=
"opengl"
2205 ? i18nc(
"canvas renderer",
"Direct3D 11 via ANGLE")
2206 : i18nc(
"canvas renderer",
"OpenGL via ANGLE");
2208 const QString rendererOpenGLESText = i18nc(
"canvas renderer",
"OpenGL ES");
2215 i18nc(
"canvas renderer",
"Unknown"));
2217 cmbPreferredRenderer->clear();
2220 const bool onlyOneRendererSupported =
2226 if (!onlyOneRendererSupported) {
2227 QString qtPreferredRendererText;
2229 qtPreferredRendererText = rendererOpenGLESText;
2231 qtPreferredRendererText = rendererSoftwareText;
2233 qtPreferredRendererText = rendererOpenGLText;
2235 cmbPreferredRenderer->addItem(i18nc(
"canvas renderer",
"Auto (%1)", qtPreferredRendererText),
KisOpenGL::RendererAuto);
2236 cmbPreferredRenderer->setCurrentIndex(0);
2238 cmbPreferredRenderer->setEnabled(
false);
2244 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2251 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2258 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2262 if (!(supportedRenderers &
2267 grpOpenGL->setEnabled(
false);
2268 grpOpenGL->setChecked(
false);
2269 chkUseTextureBuffer->setEnabled(
false);
2270 cmbAssistantsDrawMode->setEnabled(
false);
2271 cmbFilterMode->setEnabled(
false);
2273 grpOpenGL->setEnabled(
true);
2275 chkUseTextureBuffer->setEnabled(cfg.
useOpenGL());
2277 cmbAssistantsDrawMode->setEnabled(cfg.
useOpenGL());
2278 cmbAssistantsDrawMode->setCurrentIndex(assistantDrawModeToIndex(cfg.
assistantsDrawMode()));
2279 cmbFilterMode->setEnabled(cfg.
useOpenGL());
2283 cmbFilterMode->removeItem(3);
2290 lblPreferredXcbGlApi->setVisible(currentXcbGlProvider.has_value());
2291 cmbPreferredXcbGlApi->setVisible(currentXcbGlProvider.has_value());
2293 if (currentXcbGlProvider.has_value()) {
2294 const QString glxCurrent = i18nc(
"@item:inlistbox",
"GLX (current)");
2295 const QString glxNotCurrent = i18nc(
"@item:inlistbox",
"GLX");
2296 const QString eglCurrent = i18nc(
"@item:inlistbox",
"EGL (current)");
2297 const QString eglNotCurrent = i18nc(
"@item:inlistbox",
"EGL");
2302 cmbPreferredXcbGlApi->setToolTip(i18nc(
"@info:tooltip",
2303 "<p>If you are using Krita on X11 or XWayland and experience slowness, "
2304 "try switching between EGL and GLX</p>"));
2309 int index = cmbPreferredXcbGlApi->findData(preferredValue);
2314 cmbPreferredXcbGlApi->setCurrentIndex(index);
2318 lblCurrentDisplayFormat->setText(
"");
2319 lblCurrentRootSurfaceFormat->setText(
"");
2320 grpHDRWarning->setVisible(
false);
2329 QOpenGLContext *context = QOpenGLContext::currentContext();
2332 context = QOpenGLContext::globalShareContext();
2338 if (screen && adapter.
isValid()) {
2343 toolTip << i18n(
"Display Id: %1", info.
screen->name());
2344 toolTip << i18n(
"Display Name: %1 %2", info.
screen->manufacturer(), info.
screen->model());
2345 toolTip << i18n(
"Min Luminance: %1", info.
minLuminance);
2346 toolTip << i18n(
"Max Luminance: %1", info.
maxLuminance);
2353 lblCurrentDisplayFormat->setToolTip(toolTip.join(
'\n'));
2356 lblCurrentDisplayFormat->setToolTip(
"");
2357 lblCurrentDisplayFormat->setText(i18n(
"Unknown"));
2360 lblCurrentDisplayFormat->setToolTip(
"");
2361 lblCurrentDisplayFormat->setText(i18n(
"Unknown"));
2362 qWarning() <<
"Failed to fetch display info:" << adapter.
errorString();
2367 lblCurrentRootSurfaceFormat->setText(colorSpaceString(colorSpace, currentFormat.redBufferSize()));
2368 cmbPreferedRootSurfaceFormat->setCurrentIndex(formatToIndex(cfg.
rootSurfaceFormat()));
2374 HDR->setEnabled(
false);
2382 const int hdrTabIndex = tabWidget->indexOf(
HDR);
2384 if (hdrTabIndex >= 0) {
2385 tabWidget->setTabVisible(hdrTabIndex,
false);
2391 if (openglWarnings.isEmpty()) {
2392 grpOpenGLWarnings->setVisible(
false);
2394 QString text = QString(
"<p><b>%1</b>").arg(i18n(
"Warning(s):"));
2395 text.append(
"<ul>");
2396 Q_FOREACH (
const QString &warning, openglWarnings) {
2397 text.append(
"<li>");
2398 text.append(warning.toHtmlEscaped());
2399 text.append(
"</li>");
2401 text.append(
"</ul></p>");
2402 grpOpenGLWarnings->setText(text);
2403 grpOpenGLWarnings->setPixmap(
2404 grpOpenGLWarnings->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
2405 grpOpenGLWarnings->setVisible(
true);
2413 btnSelectionOverlayColor->setColor(c);
2414 sldSelectionOverlayOpacity->setRange(0.0, 1.0, 2);
2415 sldSelectionOverlayOpacity->setSingleStep(0.05);
2418 sldSelectionOutlineOpacity->setRange(0.0, 1.0, 2);
2419 sldSelectionOutlineOpacity->setSingleStep(0.05);
2422 intCheckSize->setValue(cfg.
checkSize());
2426 colorChecks1->setColor(ck1);
2429 colorChecks2->setColor(ck2);
2432 canvasBorder->setColor(cb);
2443 pixelGridColorButton->setColor(gridColor);
2451 cmbPreferredRenderer->setCurrentIndex(0);
2454 grpOpenGL->setEnabled(
false);
2455 grpOpenGL->setChecked(
false);
2456 chkUseTextureBuffer->setEnabled(
false);
2457 cmbAssistantsDrawMode->setEnabled(
false);
2458 cmbFilterMode->setEnabled(
false);
2461 grpOpenGL->setEnabled(
true);
2462 grpOpenGL->setChecked(cfg.
useOpenGL(
true));
2464 chkUseTextureBuffer->setEnabled(
true);
2465 cmbAssistantsDrawMode->setEnabled(
true);
2466 cmbAssistantsDrawMode->setCurrentIndex(assistantDrawModeToIndex(cfg.
assistantsDrawMode(
true)));
2467 cmbFilterMode->setEnabled(
true);
2478 btnSelectionOverlayColor->setColor(c);
2483 intCheckSize->setValue(cfg.
checkSize(
true));
2486 colorChecks1->setColor(ck1);
2489 colorChecks2->setColor(ck2);
2492 canvasBorder->setColor(cvb);
2497 chkHidePopups->setChecked(cfg.
hidePopups(
true));
2501 pixelGridColorButton->setColor(gridColor);
2511 chkUseTextureBuffer->setEnabled(isChecked);
2512 cmbFilterMode->setEnabled(isChecked);
2513 cmbAssistantsDrawMode->setEnabled(isChecked);
2520 QOpenGLContext *context = QOpenGLContext::currentContext();
2529 grpHDRWarning->setVisible(
true);
2530 grpHDRWarning->setPixmap(
2531 grpHDRWarning->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
2532 grpHDRWarning->setText(i18n(
"<b>Warning:</b> current display doesn't support HDR rendering"));
2534 grpHDRWarning->setVisible(
false);
2580 connect(chkShowColorHistory, SIGNAL(toggled(
bool)), cmbColorHistorySorting, SLOT(setEnabled(
bool)));
2581 connect(chkShowColorHistory, SIGNAL(toggled(
bool)), lblColorHistorySorting, SLOT(setEnabled(
bool)));
2592 sbPaletteSize->setValue(config.
readEntry(
"popuppalette/size", 385));
2593 sbSelectorSize->setValue(config.
readEntry(
"popuppalette/selectorSize", 140));
2594 cmbSelectorType->setCurrentIndex(config.
readEntry<
bool>(
"popuppalette/usevisualcolorselector",
false) ? 1 : 0);
2595 chkShowColorHistory->setChecked(config.
readEntry(
"popuppalette/showColorHistory",
true));
2596 chkShowRotationTrack->setChecked(config.
readEntry(
"popuppalette/showRotationTrack",
true));
2597 chkUseDynamicSlotCount->setChecked(config.
readEntry(
"popuppalette/useDynamicSlotCount",
true));
2598 grpFixTriangleRotation->setChecked(config.
readEntry(
"popuppalette/fixTriangleRotation",
false));
2599 sbTriangleRotationAngle->setValue(config.
readEntry(
"popuppalette/triangleRotationAngle", 0));
2601 QString currentSorting = config.
readEntry(
"popuppalette/colorHistorySorting", QString(
"hsv"));
2602 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2603 currentSorting =
"hsv";
2605 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2606 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2607 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2608 grpFixTriangleRotation->setEnabled(!cmbSelectorType->currentIndex());
2617 config.
writeEntry(
"popuppalette/size", sbPaletteSize->value());
2618 config.
writeEntry(
"popuppalette/selectorSize", sbSelectorSize->value());
2619 config.
writeEntry<
bool>(
"popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2620 config.
writeEntry<
bool>(
"popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2621 config.
writeEntry<
bool>(
"popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2622 config.
writeEntry<
bool>(
"popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2623 config.
writeEntry(
"popuppalette/colorHistorySorting",
2624 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2625 config.
writeEntry<
bool>(
"popuppalette/fixTriangleRotation", grpFixTriangleRotation->isChecked());
2626 config.
writeEntry(
"popuppalette/triangleRotationAngle", sbTriangleRotationAngle->value());
2633 sbPaletteSize->setValue(385);
2634 sbSelectorSize->setValue(140);
2635 cmbSelectorType->setCurrentIndex(0);
2636 chkShowColorHistory->setChecked(
true);
2637 chkShowRotationTrack->setChecked(
true);
2638 chkUseDynamicSlotCount->setChecked(
true);
2639 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2640 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2641 grpFixTriangleRotation->setChecked(
false);
2642 sbTriangleRotationAngle->setValue(0);
2646 grpFixTriangleRotation->setEnabled(!index);
2652 : KPageDialog(parent)
2655 setWindowTitle(i18n(
"Configure Krita"));
2656 setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
2658 setFaceType(KPageDialog::List);
2662 KPageWidgetItem *page =
new KPageWidgetItem(vbox, i18n(
"General"));
2663 page->setObjectName(
"general");
2664 page->setHeader(i18n(
"General"));
2672 page =
new KPageWidgetItem(vbox, i18n(
"Keyboard Shortcuts"));
2673 page->setObjectName(
"shortcuts");
2674 page->setHeader(i18n(
"Shortcuts"));
2685 page->setHeader(i18n(
"Canvas Input"));
2686 page->setObjectName(
"canvasinput");
2692 page =
new KPageWidgetItem(vbox, i18n(
"Display"));
2693 page->setObjectName(
"display");
2694 page->setHeader(i18n(
"Display"));
2702 page =
new KPageWidgetItem(vbox, i18n(
"Color Management"));
2703 page->setObjectName(
"colormanagement");
2704 page->setHeader(i18nc(
"Label of color as in Color Management",
"Color"));
2712 page =
new KPageWidgetItem(vbox, i18n(
"Performance"));
2713 page->setObjectName(
"performance");
2714 page->setHeader(i18n(
"Performance"));
2722 page =
new KPageWidgetItem(vbox, i18n(
"Tablet settings"));
2723 page->setObjectName(
"tablet");
2724 page->setHeader(i18n(
"Tablet"));
2732 page =
new KPageWidgetItem(vbox, i18n(
"Canvas-only settings"));
2733 page->setObjectName(
"canvasonly");
2734 page->setHeader(i18n(
"Canvas-only"));
2742 page =
new KPageWidgetItem(vbox, i18n(
"Pop-up Palette"));
2743 page->setObjectName(
"popuppalette");
2744 page->setHeader(i18n(
"Pop-up Palette"));
2752 page = addPage(
m_authorPage, i18nc(
"@title:tab Author page",
"Author" ));
2753 page->setObjectName(
"author");
2754 page->setHeader(i18n(
"Author"));
2758 KGuiItem::assign(
button(QDialogButtonBox::Ok), KStandardGuiItem::ok());
2759 KGuiItem::assign(
button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
2760 QPushButton *restoreDefaultsButton =
button(QDialogButtonBox::RestoreDefaults);
2761 restoreDefaultsButton->setText(i18nc(
"@action:button",
"Restore Defaults"));
2769 Q_FOREACH(
const QString &key, keys) {
2773 page =
new KPageWidgetItem(vbox, preferenceSet->
name());
2774 page->setHeader(preferenceSet->
header());
2775 page->setIcon(preferenceSet->
icon());
2777 preferenceSet->setParent(vbox);
2780 connect(restoreDefaultsButton, SIGNAL(clicked(
bool)), preferenceSet, SLOT(loadDefaultPreferences()), Qt::UniqueConnection);
2781 connect(
this, SIGNAL(accepted()), preferenceSet, SLOT(savePreferences()), Qt::UniqueConnection);
2784 connect(restoreDefaultsButton, SIGNAL(clicked(
bool)),
this, SLOT(
slotDefault()));
2787 QString currentPageName = cfg.
readEntry<QString>(
"KisDlgPreferences/CurrentPage");
2788 Q_FOREACH(KPageWidgetItem *page,
m_pages) {
2789 if (page->objectName() == currentPageName) {
2790 setCurrentPage(page);
2796#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
2800 const auto *titleWidget = findChild<KTitleWidget*>();
2802 QLayoutItem *titleFrame = titleWidget->layout()->itemAt(0);
2804 titleFrame->widget()->setBackgroundRole(QPalette::Window);
2814 cfg.
writeEntry<QString>(
"KisDlgPreferences/CurrentPage", currentPage()->objectName());
2818 KPageDialog::showEvent(event);
2819 button(QDialogButtonBox::Cancel)->setAutoDefault(
false);
2820 button(QDialogButtonBox::Ok)->setAutoDefault(
false);
2821 button(QDialogButtonBox::RestoreDefaults)->setAutoDefault(
false);
2822 button(QDialogButtonBox::Cancel)->setDefault(
false);
2823 button(QDialogButtonBox::Ok)->setDefault(
false);
2824 button(QDialogButtonBox::RestoreDefaults)->setDefault(
false);
2829 if (buttonBox()->buttonRole(
button) == QDialogButtonBox::RejectRole) {
2836 if (currentPage()->objectName() ==
"general") {
2839 else if (currentPage()->objectName() ==
"shortcuts") {
2842 else if (currentPage()->objectName() ==
"display") {
2845 else if (currentPage()->objectName() ==
"colormanagement") {
2848 else if (currentPage()->objectName() ==
"performance") {
2851 else if (currentPage()->objectName() ==
"tablet") {
2854 else if (currentPage()->objectName() ==
"canvasonly") {
2857 else if (currentPage()->objectName() ==
"canvasinput") {
2860 else if (currentPage()->objectName() ==
"popuppalette") {
2868 switch (page_enum) {
2876 name =
"colormanagement";
2879 name =
"performance";
2888 name =
"canvasonly";
2891 name =
"canvasinput";
2894 name =
"popuppalette";
2898 Q_FOREACH (KPageWidgetItem *page,
m_pages) {
2899 if (page->objectName() == name) {
2908 switch (page.
page) {
2910 QWidget *tab =
nullptr;
2937 m_general->tabWidget->setCurrentWidget(tab);
2940 QWidget *tab =
nullptr;
2955 QWidget *tab =
nullptr;
2973 QWidget *tab =
nullptr;
2998 connect(this->buttonBox(), SIGNAL(clicked(QAbstractButton*)),
this, SLOT(
slotButtonClicked(QAbstractButton*)));
3000 if (page.has_value()) {
3006 int retval = exec();
3033 KConfigGroup group = KSharedConfig::openConfig()->group(
"File Dialogs");
3034 group.writeEntry(
"DontUseNativeFileDialog", !
m_general->m_chkNativeFileDialog->isChecked());
3040 if (
m_general->chkUseCustomFont->isChecked()) {
3041 cfg.
writeEntry<QString>(
"custom_system_font",
m_general->cmbCustomFont->currentFont().family());
3045 cfg.
writeEntry<QString>(
"custom_system_font",
"");
3070 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
3071 QSettings kritarc(configPath + QStringLiteral(
"/kritadisplayrc"), QSettings::IniFormat);
3072 kritarc.setValue(
"EnableHiDPI",
m_general->m_chkHiDPI->isChecked());
3073#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
3074 kritarc.setValue(
"EnableHiDPIFractionalScaling",
m_general->m_chkHiDPIFractionalScaling->isChecked());
3076 kritarc.setValue(
"LogUsage",
m_general->chkUsageLogging->isChecked());
3080 cfg.
writeEntry<
bool>(
"useCreamyAlphaDarken", (bool)!
m_general->cmbFlowMode->currentIndex());
3081 cfg.
writeEntry<
bool>(
"useSubtractiveBlendingForCmykColorSpaces", (bool)!
m_general->cmbCmykBlendingMode->currentIndex());
3094 cfg.
writeEntry(
"useTouchPressureSensitivity",
m_general->chkTouchPressureSensitivity->isChecked());
3109 QFileInfo fi(
m_general->m_resourceFolderSelector->currentData(Qt::UserRole).value<QString>());
3111 QFileInfo fi(
m_general->m_urlResourceFolder->fileName());
3113 if (fi.isWritable()) {
3124 for (
int i = 0; i < QApplication::screens().count(); ++i) {
3163#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
3166# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
3168 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
3169 if (
auto nativeWindowsApp =
dynamic_cast<QWindowsApplication *
>(QGuiApplicationPrivate::platformIntegration())) {
3176#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
3177 cfg.setUsePageUpDownMouseButtonEmulationWorkaround(
3181#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
3182 cfg.setUseHighFunctionKeyMouseButtonEmulationWorkaround(
3186#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
3187 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()
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()
static const Colorimetry AdobeRGB
static const Colorimetry BT709
const XYZ & white() const
const XYZ & green() const
static const Colorimetry DisplayP3
static const Colorimetry BT2020
static const Colorimetry DCIP3
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.
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()
#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)