12#include <config-hdr.h>
31#include <QRadioButton>
34#include <QStandardPaths>
36#include <QStyleFactory>
38#include <QFontComboBox>
40#include <QSurfaceFormat>
59#include <KTitleWidget>
62#include <klocalizedstring.h>
63#include <kstandardguiitem.h>
101#include <config-qt-patches-present.h>
104#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
106# include "config_qt5_has_wintab_switch.h"
108# include <QtGui/private/qguiapplication_p.h>
109# include <QtGui/qpa/qplatformintegration.h>
111#include "config-high-dpi-scale-factor-rounding-policy.h"
124 if (QGuiApplication::screens().
length() <= index) {
127 QScreen* screen = QGuiApplication::screens()[index];
128 QString resolution = QString::number(screen->geometry().width()).append(
"x").append(QString::number(screen->geometry().height()));
129 QString name = screen->name();
144 State
validate(QString &line,
int &)
const override
147 if (!fi.isWritable()) {
158 <<
"0" <<
"1" <<
"2" <<
"3" <<
"4" <<
"5" <<
"6" <<
"7" <<
"8" <<
"9"
159 <<
"/" <<
"\\" <<
":" <<
";" <<
" ")
166 State
validate(QString &line,
int &)
const override
169 if (line.contains(invalidChar)) {
192 if (event->type() == QEvent::Wheel) {
209 scrollAreaWidgetContents->setAutoFillBackground(
false);
210 scrollAreaWidgetContents->parentWidget()->setAutoFillBackground(
false);
221 << i18n(
"Small Circle")
223 << i18n(
"Triangle Righthanded")
224 << i18n(
"Triangle Lefthanded")
225 << i18n(
"Black Pixel")
226 << i18n(
"White Pixel");
229 << i18nc(
"Display options label to not DISPLAY brush outline",
"No Outline")
230 << i18n(
"Circle Outline")
231 << i18n(
"Preview Outline")
232 << i18n(
"Tilt Outline");
236 m_cmbCursorShape->addItems(cursorItems);
240 m_cmbOutlineShape->addItems(outlineItems);
249 cursorColorButton->setColor(cursorColor);
255 m_cmbEraserCursorShape->addItems(cursorItems);
256 m_cmbEraserCursorShape->addItem(i18n(
"Eraser"));
260 m_cmbEraserOutlineShape->addItems(outlineItems);
269 eraserCursorColorButton->setColor(eraserCursorColor);
275 connect(m_cmbColorSamplerPreviewStyle,
276 QOverload<int>::of(&QComboBox::currentIndexChanged),
281 m_nmbColorSamplerPreviewSize->setRange(1, 400);
286 m_ssbColorSamplerPreviewThickness->setRange(1, 50);
310 chkUseCustomFont->setChecked(cfg.
readEntry<
bool>(
"use_custom_system_font",
false));
311 cmbCustomFont->findChild <QComboBox*>(
"stylesComboBox")->setVisible(
false);
313 QString fontName = cfg.
readEntry<QString>(
"custom_system_font",
"");
314 if (fontName.isEmpty()) {
315 cmbCustomFont->setCurrentFont(qApp->font());
319 int pointSize = qApp->font().pointSize();
320 cmbCustomFont->setCurrentFont(QFont(fontName, pointSize));
322 int fontSize = cfg.
readEntry<
int>(
"custom_font_size", -1);
324 intFontSize->setValue(qApp->font().pointSize());
327 intFontSize->setValue(fontSize);
330 m_cmbMDIType->setCurrentIndex(cfg.
readEntry<
int>(
"mdi_viewmode", (
int)QMdiArea::TabbedView));
340 m_mdiColor->setColor(mdiColor);
346 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
347 QSettings kritarc(configPath + QStringLiteral(
"/kritadisplayrc"), QSettings::IniFormat);
348 m_chkHiDPI->setChecked(kritarc.value(
"EnableHiDPI",
true).toBool());
349#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
350 m_chkHiDPIFractionalScaling->setChecked(kritarc.value(
"EnableHiDPIFractionalScaling",
false).toBool());
352 m_wdgHiDPIFractionalScaling->setEnabled(
false);
354 chkUsageLogging->setChecked(kritarc.value(
"LogUsage",
true).toBool());
361 cmbFlowMode->setCurrentIndex((
int)!cfg.
readEntry<
bool>(
"useCreamyAlphaDarken",
true));
362 cmbCmykBlendingMode->setCurrentIndex((
int)!cfg.
readEntry<
bool>(
"useSubtractiveBlendingForCmykColorSpaces",
true));
364 cmbTouchPainting->addItem(
366 : i18nc(
"touch painting",
"Auto (Enabled)"));
367 cmbTouchPainting->addItem(i18nc(
"touch painting",
"Enabled"));
368 cmbTouchPainting->addItem(i18nc(
"touch painting",
"Disabled"));
370 chkTouchPressureSensitivity->setChecked(cfg.
readEntry(
"useTouchPressureSensitivity",
true));
371 connect(cmbTouchPainting, SIGNAL(currentIndexChanged(
int)),
382 m_cmbKineticScrollingGesture->addItem(i18n(
"On Touch Drag"));
383 m_cmbKineticScrollingGesture->addItem(i18n(
"On Click Drag"));
384 m_cmbKineticScrollingGesture->addItem(i18n(
"On Middle-Click Drag"));
391 m_kineticScrollingSensitivitySlider->setRange(0, 100);
404 m_autosaveSpinBox->setValue(autosaveInterval / 60);
405 m_autosaveCheckBox->setChecked(autosaveInterval > 0);
406 chkHideAutosaveFiles->setChecked(cfg.
readEntry<
bool>(
"autosavefileshidden",
true));
409 chkZip64->setChecked(cfg.
useZip64());
410 m_chkTrimKra->setChecked(cfg.
trimKra());
413 m_backupFileCheckBox->setChecked(cfg.
backupFile());
414 cmbBackupFileLocation->setCurrentIndex(cfg.
readEntry<
int>(
"backupfilelocation", 0));
415 txtBackupFileSuffix->setText(cfg.
readEntry<QString>(
"backupfilesuffix",
"~"));
417 txtBackupFileSuffix->setValidator(validator);
418 intNumBackupFiles->setValue(cfg.
readEntry<
int>(
"numberofbackupfiles", 1));
420 cmbDefaultExportFileType->clear();
423 QMap<QString, QString> mimeTypeMap;
425 foreach (
const QString &mimeType, mimeFilter) {
427 mimeTypeMap.insert(description, mimeType);
431 QStringList sortedDescriptions = mimeTypeMap.keys();
432 sortedDescriptions.sort(Qt::CaseInsensitive);
434 cmbDefaultExportFileType->addItem(i18n(
"All Supported Files"),
"all/mime");
435 foreach (
const QString &description, sortedDescriptions) {
436 const QString &mimeType = mimeTypeMap.value(description);
437 cmbDefaultExportFileType->addItem(description, mimeType);
440 const QString mimeTypeToFind = cfg.
exportMimeType(
false).toUtf8();
441 const int index = cmbDefaultExportFileType->findData(mimeTypeToFind);
444 cmbDefaultExportFileType->setCurrentIndex(index);
447 const QString defaultMimeType =
"image/png";
448 const int defaultIndex = cmbDefaultExportFileType->findData(defaultMimeType);
449 if (defaultIndex >= 0) {
450 cmbDefaultExportFileType->setCurrentIndex(defaultIndex);
453 qDebug() <<
"Default mime type not found in the combo box.";
457 QString selectedMimeType = cmbDefaultExportFileType->currentData().toString();
469 cmbStartupSession->addItem(i18n(
"Open default window"));
470 cmbStartupSession->addItem(i18n(
"Load previous session"));
471 cmbStartupSession->addItem(i18n(
"Show session manager"));
480 connect(chkCumulativeUndo, SIGNAL(toggled(
bool)), btnAdvancedCumulativeUndo, SLOT(setEnabled(
bool)));
481 btnAdvancedCumulativeUndo->setEnabled(chkCumulativeUndo->isChecked());
491 KConfigGroup group = KSharedConfig::openConfig()->group(
"File Dialogs");
492 bool dontUseNative =
true;
494 dontUseNative =
false;
497 if (qgetenv(
"XDG_CURRENT_DESKTOP") ==
"KDE") {
498 dontUseNative =
false;
502 dontUseNative =
false;
505 dontUseNative =
false;
507 m_chkNativeFileDialog->setChecked(!group.readEntry(
"DontUseNativeFileDialog", dontUseNative));
509 if (!qEnvironmentVariable(
"APPIMAGE").isEmpty()) {
512 m_chkNativeFileDialog->setChecked(
false);
513 m_chkNativeFileDialog->setEnabled(
false);
521 chkIgnoreHighFunctionKeys->setVisible(
false);
528 m_urlResourceFolder->setConfigurationName(
"resource_directory");
530 if (QFileInfo(resourceLocation).isWritable()) {
531 m_urlResourceFolder->setFileName(resourceLocation);
534 m_urlResourceFolder->setFileName(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
537 txtBackupFileSuffix->setValidator(writableValidator);
538 connect(m_urlResourceFolder, SIGNAL(textChanged(QString)), SLOT(
checkResourcePath()));
541 grpRestartMessage->setPixmap(
542 grpRestartMessage->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
543 grpRestartMessage->setText(i18n(
"You will need to Restart Krita for the changes to take an effect."));
545 grpAndroidWarningMessage->setVisible(
false);
546 grpAndroidWarningMessage->setPixmap(
547 grpAndroidWarningMessage->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
548 grpAndroidWarningMessage->setText(
549 i18n(
"Saving at a Location picked from the File Picker may slow down the startup!"));
552 m_urlResourceFolder->setVisible(
false);
554 m_resourceFolderSelector->setVisible(
true);
562 const QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppDataLocation);
563 Q_FOREACH(
const QString &location, locations) {
564 if (!filteredLocations.contains(location)) {
565 filteredLocations.append(location);
568 return filteredLocations;
573 Q_FOREACH (QString location, locations) {
575 QFileInfo fileLocation(location);
578 text = i18n(
"Default");
580 }
else if (location.startsWith(
"/data")) {
581 text = i18n(
"Internal Storage");
583 text = i18n(
"SD-Card");
585 if (fileLocation.isWritable()) {
586 writableLocationsAndText.append({text, location});
589 return writableLocationsAndText;
592 for (
auto it = writableLocations.constBegin(); it != writableLocations.constEnd(); ++it) {
593 m_resourceFolderSelector->addItem(it->first +
" - " + it->second);
595 m_resourceFolderSelector->setItemData(m_resourceFolderSelector->count() - 1, it->second, Qt::UserRole);
599 if (resourceLocation.startsWith(
"content://")) {
600 m_resourceFolderSelector->addItem(resourceLocation);
601 int index = m_resourceFolderSelector->count() - 1;
602 m_resourceFolderSelector->setItemData(index, resourceLocation, Qt::UserRole);
603 m_resourceFolderSelector->setCurrentIndex(index);
604 grpAndroidWarningMessage->setVisible(
true);
607 auto iterator = std::find_if(writableLocations.constBegin(),
608 writableLocations.constEnd(),
609 [&resourceLocation](QPair<QString, QString> location) {
610 return location.second == resourceLocation;
613 if (iterator != writableLocations.constEnd()) {
614 int index = writableLocations.indexOf(*iterator);
616 m_resourceFolderSelector->setCurrentIndex(index);
621 m_resourceFolderSelector->addItem(i18n(
"Choose Manually"));
623 connect(m_resourceFolderSelector, qOverload<int>(&QComboBox::activated), [
this](
int index) {
624 const int previousIndex = m_resourceFolderSelector->currentIndex();
627 if (m_resourceFolderSelector->count() - 1 == index) {
628 KoFileDialog dialog(this, KoFileDialog::OpenDirectory,
"Select Directory");
629 const QString selectedDirectory = dialog.filename();
631 if (!selectedDirectory.isEmpty()) {
634 if (m_resourceFolderSelector->itemData(index - 1, Qt::DisplayRole)
636 .startsWith(
"content://")) {
637 m_resourceFolderSelector->setItemText(index - 1, selectedDirectory);
638 m_resourceFolderSelector->setItemData(index - 1, selectedDirectory, Qt::UserRole);
639 m_resourceFolderSelector->setCurrentIndex(index - 1);
642 m_resourceFolderSelector->insertItem(index, selectedDirectory);
643 m_resourceFolderSelector->setItemData(index, selectedDirectory, Qt::UserRole);
644 m_resourceFolderSelector->setCurrentIndex(index);
647 grpAndroidWarningMessage->setVisible(true);
649 m_resourceFolderSelector->setCurrentIndex(previousIndex);
654 grpAndroidWarningMessage->setVisible(
655 m_resourceFolderSelector->currentData(Qt::UserRole).value<QString>().startsWith(
"content://"));
659 m_resourceFolderSelector->setVisible(
false);
662 grpWindowsAppData->setVisible(
false);
664 QString folderInStandardAppData;
665 QString folderInPrivateAppData;
668 if (!folderInPrivateAppData.isEmpty()) {
669 const auto pathToDisplay = [](
const QString &path) {
677 return QDir::toNativeSeparators(path).replace(QChar(
'\\'), QStringLiteral(
u"\\\u200B"));
680 const QDir privateResourceDir(folderInPrivateAppData);
681 const QDir appDataDir(folderInStandardAppData);
682 grpWindowsAppData->setPixmap(
683 grpWindowsAppData->style()->standardIcon(QStyle::SP_MessageBoxInformation).pixmap(QSize(32, 32)));
685 grpWindowsAppData->setText(i18nc(
"@info resource folder",
686 "<p>You are using the Microsoft Store package version of Krita. "
687 "Even though Krita can be configured to place resources under the "
688 "user AppData location, Windows may actually store the files "
689 "inside a private app location.</p>\n"
690 "<p>You should check both locations to determine where "
691 "the files are located.</p>\n"
692 "<p><b>User AppData</b> (<a href=\"copyuser\">Copy</a>):<br/>\n"
694 "<p><b>Private app location</b> (<a href=\"copyprivate\">Copy</a>):<br/>\n"
696 pathToDisplay(appDataDir.absolutePath()),
697 pathToDisplay(privateResourceDir.absolutePath())));
698 grpWindowsAppData->setVisible(
true);
700 connect(grpWindowsAppData,
702 [userPath = appDataDir.absolutePath(),
703 privatePath = privateResourceDir.absolutePath()](
const QString &link) {
704 if (link == QStringLiteral(
"copyuser")) {
705 qApp->clipboard()->setText(QDir::toNativeSeparators(userPath));
706 }
else if (link == QStringLiteral(
"copyprivate")) {
707 qApp->clipboard()->
setText(QDir::toNativeSeparators(privatePath));
709 qWarning() <<
"Unexpected link activated in lblWindowsAppDataNote:" << link;
716 const int forcedFontDPI = cfg.readEntry(
"forcedDpiForQtFontBugWorkaround", -1);
717 chkForcedFontDPI->setChecked(forcedFontDPI > 0);
718 intForcedFontDPI->setValue(forcedFontDPI > 0 ? forcedFontDPI :
qt_defaultDpi());
719 intForcedFontDPI->setEnabled(forcedFontDPI > 0);
720 connect(chkForcedFontDPI, SIGNAL(toggled(
bool)), intForcedFontDPI, SLOT(setEnabled(
bool)));
727 QAbstractButton *
button = m_pasteFormatGroup.button(cfg.pasteFormat(
false));
742 m_chkSeparateEraserCursor->setChecked(cfg.
readEntry<
bool>(
"separateEraserCursor",
false));
755 chkHideAutosaveFiles->setChecked(
true);
761 m_backupFileCheckBox->setChecked(cfg.
backupFile(
true));
762 cmbBackupFileLocation->setCurrentIndex(0);
763 txtBackupFileSuffix->setText(
"~");
764 intNumBackupFiles->setValue(1);
771#if defined Q_OS_ANDROID || defined Q_OS_MACOS || defined Q_OS_WIN
772 m_chkNativeFileDialog->setChecked(
true);
774 m_chkNativeFileDialog->setChecked(
false);
777 intMaxBrushSize->setValue(1000);
782 chkUseCustomFont->setChecked(
false);
783 cmbCustomFont->setCurrentFont(qApp->font());
784 intFontSize->setValue(qApp->font().pointSize());
787 m_cmbMDIType->setCurrentIndex((
int)QMdiArea::TabbedView);
788 m_chkRubberBand->setChecked(cfg.
useOpenGL(
true));
794 m_chkCompressKra->setChecked(cfg.
compressKra(
true));
795 m_chkTrimKra->setChecked(cfg.
trimKra(
true));
797 chkZip64->setChecked(cfg.
useZip64(
true));
798 m_chkHiDPI->setChecked(
true);
799#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
800 m_chkHiDPIFractionalScaling->setChecked(
true);
802 chkUsageLogging->setChecked(
true);
804 cmbFlowMode->setCurrentIndex(0);
808 spnZoomSteps->setValue(cfg.
zoomSteps(
true));
813 cmbTouchPainting->setCurrentIndex(
int(cfg.
touchPainting(
true)));
814 chkTouchPressureSensitivity->setChecked(
true);
821 cursorColorButton->setColor(cursorColor);
825 eraserCursorColorButton->setColor(eraserCursorColor);
833 chkForcedFontDPI->setChecked(
false);
835 intForcedFontDPI->setEnabled(
false);
852 if (dlg.exec() == KoDialog::Accepted) {
860 m_frmColorSamplerCircleSettings->setVisible(circleSettingsVisible);
865 m_lblColorSamplerPreviewSizePreview->setDiameter(
value);
870 m_lblColorSamplerPreviewSizePreview->setThickness(
value/100.0);
875 m_lblColorSamplerPreviewSizePreview->setOutlineEnabled(
value);
880 return (
CursorStyle)m_cmbCursorShape->currentIndex();
890 return (
CursorStyle)m_cmbEraserCursorShape->currentIndex();
895 return (
OutlineStyle)m_cmbEraserOutlineShape->currentIndex();
905 return m_nmbColorSamplerPreviewSize->value();
910 return m_ssbColorSamplerPreviewThickness->value();
915 return m_chkColorSamplerPreviewOutlineEnabled->isChecked();
920 return m_chkColorSamplerPreviewExtraCircles->isChecked();
931 return chkSaveSessionOnQuit->isChecked();
936 return chkShowRootLayer->isChecked();
942 return m_autosaveCheckBox->isChecked() ? m_autosaveSpinBox->value() * 60 : 0;
947 return m_undoStackSize->value();
952 return m_showOutlinePainting->isChecked();
957 return m_showEraserOutlinePainting->isChecked();
962 return m_cmbMDIType->currentIndex();
967 return m_chkCanvasMessages->isChecked();
972 return m_chkCompressKra->isChecked();
977 return m_chkTrimKra->isChecked();
982 return m_chkTrimFramesImport->isChecked();
987 return cmbDefaultExportFileType->currentData().toString();
992 return chkZip64->isChecked();
997 return m_radioToolOptionsInDocker->isChecked();
1002 return spnZoomSteps->value();
1007 return chkEnableLongPress->isChecked();
1012 return m_groupBoxKineticScrollingSettings->isChecked();
1017 return m_cmbKineticScrollingGesture->currentIndex();
1022 return m_kineticScrollingSensitivitySlider->value();
1027 return m_chkKineticScrollingHideScrollbars->isChecked();
1032 return intZoomMarginSize->value();
1037 return m_chkSwitchSelectionCtrlAlt->isChecked();
1042 return m_chkConvertOnImport->isChecked();
1047 return m_chkAutoPin->isChecked();
1052 return m_chkAdaptivePlaybackRange->isChecked();
1057 return m_chkAutoZoom->isChecked();
1062 return chkForcedFontDPI->isChecked() ? intForcedFontDPI->value() : -1;
1069 i18nc(
"Preview option for no color sampler",
"None"),
1070 i18nc(
"Preview option for a circular/ring-shaped color sampler",
"Circle"),
1071 i18nc(
"Preview option for a rectangular color sampler left of the cursor",
"Rectangle Left"),
1072 i18nc(
"Preview option for a rectangular color sampler right of the cursor",
"Rectangle Right"),
1073 i18nc(
"Preview option for a rectangular color sampler above the cursor",
"Rectangle Above"),
1079 cmb->setCurrentIndex(
int(style));
1089 return chkRenameMergedLayers->isChecked();
1094 return chkRenamePastedLayers->isChecked();
1099 return chkRenameDuplicatedLayers->isChecked();
1105 dialog.setCaption(i18n(
"Select a Background Image"));
1106 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation));
1107 dialog.setImageFilters();
1109 QString fn = dialog.filename();
1116 if (image.isNull()) {
1117 QMessageBox::warning(
this, i18nc(
"@title:window",
"Krita"), i18n(
"%1 is not a valid image file!", fn));
1120 m_backgroundimage->setText(fn);
1127 m_backgroundimage->setText(
"");
1132 const QFileInfo fi(m_urlResourceFolder->fileName());
1133 if (!fi.isWritable()) {
1134 grpNonWritableLocation->setPixmap(
1135 grpNonWritableLocation->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
1136 grpNonWritableLocation->setText(
1137 i18nc(
"@info resource folder",
"<b>Warning:</b> this location is not writable."));
1138 grpNonWritableLocation->setVisible(
true);
1140 grpNonWritableLocation->setVisible(
false);
1146 group_subWinMode->setEnabled(mdi_mode == QMdiArea::SubWindowView);
1161 setObjectName(name);
1163 QGridLayout * l =
new QGridLayout(
this);
1164 l->setContentsMargins(0, 0, 0, 0);
1166 l->addWidget(
m_page, 0, 0);
1174 Q_FOREACH (QAction *action, collection->
actions()) {
1178 QMap<QString, KisKActionCollection*> sortedCollections =
1181 for (
auto it = sortedCollections.constBegin(); it != sortedCollections.constEnd(); ++it) {
1210 setObjectName(name);
1215 QGridLayout * l =
new QGridLayout(
this);
1216 l->setContentsMargins(0, 0, 0, 0);
1218 l->addWidget(
m_page, 0, 0);
1235 id = colorSpaces.erase(
id);
1240 m_page->cmbWorkingColorSpace->setIDList(colorSpaces);
1245 m_page->bnAddColorProfile->setIcon(
koIcon(
"document-import-16"));
1252 QMap<QString, const KoColorProfile *> profileList;
1254 profileList[profile->
name()] = profile;
1255 profiles.append(profile->
name());
1258 std::sort(profiles.begin(), profiles.end());
1259 Q_FOREACH (
const QString profile, profiles) {
1260 m_page->cmbColorProfileForEXR->addSqueezedItem(profile);
1265 const QString userProfile = cfg.
readEntry(
"ExrDefaultColorProfile", defaultProfile);
1267 m_page->cmbColorProfileForEXR->setCurrent(profiles.contains(userProfile) ? userProfile : defaultProfile);
1272 QFormLayout *monitorProfileGrid =
new QFormLayout(
m_page->monitorprofileholder);
1273 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1274 for(
int i = 0; i < QGuiApplication::screens().count(); ++i) {
1275 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)));
1276 lbl->setWordWrap(
true);
1279 cmb->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
1280 monitorProfileGrid->addRow(lbl, cmb);
1286 m_page->chkUseSystemMonitorProfile->setChecked(
false);
1287 m_page->chkUseSystemMonitorProfile->setDisabled(
true);
1288 m_page->chkUseSystemMonitorProfile->setHidden(
true);
1293 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1299 QVBoxLayout *vboxLayout =
new QVBoxLayout(
m_page->monitorprofileholder);
1300 vboxLayout->setContentsMargins(0, 0, 0, 0);
1301 vboxLayout->addItem(
new QSpacerItem(20,20));
1303 QGroupBox *groupBox =
new QGroupBox(i18n(
"Display's color space is managed by the operating system"));
1304 vboxLayout->addWidget(groupBox);
1306 QFormLayout *monitorProfileGrid =
new QFormLayout(groupBox);
1307 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1310 new QCheckBox(i18n(
"Enable canvas color management"),
this);
1313 i18n(
"<p>Enabling canvas color management automatically creates "
1314 "a separate native surface for the canvas. It might cause "
1315 "performance issues on some systems.</p>"
1317 "<p>If color management is disabled, Krita will render "
1318 "the canvas into the surface of the main window, which "
1319 "is considered sRGB. It will cause two limitations:"
1322 " <li>the color gamut will be limited to sRGB</li>"
1323 " <li>color proofing mode will be limited to \"use global display settings\", "
1324 " i.e. paper white proofing will become impossible</li>"
1333 QLabel *canvasSurfaceColorSpaceLbl =
new QLabel(i18n(
"Canvas surface color space:"),
this);
1336 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Preferred by operating system"), QVariant::fromValue(CanvasSurfaceMode::Preferred));
1337 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Rec 709 Gamma 2.2"), QVariant::fromValue(CanvasSurfaceMode::Rec709g22));
1340 m_canvasSurfaceColorSpace->addSqueezedItem(i18n(
"Unmanaged (testing only)"), QVariant::fromValue(CanvasSurfaceMode::Unmanaged));
1343 i18n(
"<p>Color space of the pixels that are transferred to the "
1344 "window compositor. Use \"preferred\" space unless you know "
1345 "what you are doing</p>"));
1350 QLabel *canvasSurfaceBitDepthLbl =
new QLabel(i18n(
"Canvas surface bit depth (needs restart):"),
this);
1353 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"Auto"), QVariant::fromValue(CanvasSurfaceBitDepthMode::DepthAuto));
1354 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"8-bit"), QVariant::fromValue(CanvasSurfaceBitDepthMode::Depth8Bit));
1355 m_canvasSurfaceBitDepth->addSqueezedItem(i18n(
"10-bit"), QVariant::fromValue(CanvasSurfaceBitDepthMode::Depth10Bit));
1358 i18n(
"<p>The bit depth of the color that is passed to the window "
1359 "compositor. You should switch into 10-bit mode if you want to use "
1360 "HDR capabilities of your display</p>"));
1362 const QString currentBitBepthString = QSurfaceFormat::defaultFormat().redBufferSize() == 10 ? i18n(
"10-bit") : i18n(
"8-bit");
1363 QLabel *currentCanvasSurfaceBitDepthLbl =
new QLabel(i18n(
"Current canvas surface bit depth:"),
this);
1364 QLabel *currentCanvasSurfaceBitDepth =
new QLabel(currentBitBepthString,
this);
1365 monitorProfileGrid->addRow(currentCanvasSurfaceBitDepthLbl, currentCanvasSurfaceBitDepth);
1367 vboxLayout->addItem(
new QSpacerItem(20,20));
1371 vboxLayout->addWidget(preferredLbl);
1417 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1433 button->setChecked(
true);
1446 dialog.setCaption(i18n(
"Install Color Profiles"));
1447 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
1448 dialog.setMimeTypeFilters(
QStringList() <<
"application/vnd.iccprofile",
"application/vnd.iccprofile");
1452 Q_ASSERT(iccEngine);
1456 Q_FOREACH (
const QString &profileName, profileNames) {
1457 if (!QFile::copy(profileName, saveLocation + QFileInfo(profileName).fileName())) {
1458 qWarning() <<
"Could not install profile!" << saveLocation + QFileInfo(profileName).fileName();
1461 iccEngine->
addProfile(saveLocation + QFileInfo(profileName).fileName());
1467 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1481 if (useSystemProfile) {
1483 if (devices.size() == QApplication::screens().count()) {
1484 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1487 Q_FOREACH (
const QString &device, devices) {
1490 if (devices[i] == monitorForScreen) {
1500 for(
int i = 0; i < QApplication::screens().count(); ++i) {
1510 m_page->cmbWorkingColorSpace->setEnabled(useDefColorSpace);
1515 m_page->cmbWorkingColorSpace->setCurrent(
"RGBA");
1519 m_page->cmbColorProfileForEXR->setCurrent(defaultProfile);
1549 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1561 button->setChecked(
true);
1570 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1574 QMap<QString, const KoColorProfile *> profileList;
1576 profileList[profile->
name()] = profile;
1579 Q_FOREACH (
const KoColorProfile *profile, profileList.values()) {
1582 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1588 for (
int i = 0; i < QApplication::screens().count(); ++i) {
1599 m_page->wdgProofingOptions->setDisplayConfigOptions(options);
1608 m_page->pressureCurve->setCurve(curve);
1610 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1611 KisConfig(
true).useRightMiddleTabletButtonWorkaround(
true));
1613#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1617 m_page->grpTabletApi->setVisible(
false);
1620#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1621 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1622 cfg.usePageUpDownMouseButtonEmulationWorkaround(
true));
1625#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1626 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1627 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround(
true));
1630#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1631 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround(
true));
1634 m_page->chkUseTimestampsForBrushSpeed->setChecked(
false);
1635 m_page->intMaxAllowedBrushSpeed->setValue(30);
1636 m_page->intBrushSpeedSmoothing->setValue(3);
1637 m_page->tiltDirectionOffsetAngle->setAngle(0);
1642 setObjectName(name);
1644 QGridLayout * l =
new QGridLayout(
this);
1645 l->setContentsMargins(0, 0, 0, 0);
1647 l->addWidget(
m_page, 0, 0);
1651 m_page->pressureCurve->setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
1652 m_page->pressureCurve->setCurve(curve);
1654 m_page->chkUseRightMiddleClickWorkaround->setChecked(
1657#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
1658# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1659 QString actualTabletProtocol =
"<unknown>";
1660 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
1661 if (
auto nativeWindowsApp =
dynamic_cast<QWindowsApplication *
>(QGuiApplicationPrivate::platformIntegration())) {
1662 actualTabletProtocol = nativeWindowsApp->isWinTabEnabled() ?
"WinTab" :
"Windows Ink";
1664 m_page->grpTabletApi->setTitle(i18n(
"Tablet Input API (currently active API: \"%1\")", actualTabletProtocol));
1670 connect(
m_page->radioWintab, SIGNAL(toggled(
bool)),
m_page->btnResolutionSettings, SLOT(setEnabled(
bool)));
1671 m_page->btnResolutionSettings->setEnabled(
m_page->radioWintab->isChecked());
1673 m_page->grpTabletApi->setVisible(
false);
1678 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed (may cause severe artifacts when using WinTab tablet API)"));
1680 m_page->chkUseTimestampsForBrushSpeed->setText(i18n(
"Use tablet driver timestamps for brush speed"));
1682 m_page->chkUseTimestampsForBrushSpeed->setChecked(cfg.
readEntry(
"useTimestampsForBrushSpeed",
false));
1684#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
1685 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->setChecked(
1686 cfg.usePageUpDownMouseButtonEmulationWorkaround());
1688 m_page->chkUsePageUpDownMouseButtonEmulationWorkaround->hide();
1691#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
1692 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->setChecked(
1693 cfg.useHighFunctionKeyMouseButtonEmulationWorkaround());
1695 m_page->chkUseHighFunctionKeyMouseButtonEmulationWorkaround->hide();
1698#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
1699 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->setChecked(cfg.useIgnoreHistoricTabletEventsWorkaround());
1701 m_page->chkUseIgnoreHistoricTabletEventsWorkaround->hide();
1704 m_page->intMaxAllowedBrushSpeed->setRange(1, 100);
1705 m_page->intMaxAllowedBrushSpeed->setValue(cfg.
readEntry(
"maxAllowedSpeedValue", 30));
1710 return i18np(
"Maximum brush speed: {n} px/ms",
"Maximum brush speed: {n} px/ms", value);
1713 m_page->intBrushSpeedSmoothing->setRange(3, 100);
1714 m_page->intBrushSpeedSmoothing->setValue(cfg.
readEntry(
"speedValueSmoothing", 3));
1719 return i18np(
"Brush speed smoothing: {n} sample",
"Brush speed smoothing: {n} samples", value);
1722 m_page->tiltDirectionOffsetAngle->setDecimals(0);
1723 m_page->tiltDirectionOffsetAngle->setRange(-180, 180);
1725 m_page->tiltDirectionOffsetAngle->setAngle(-cfg.
readEntry(
"tiltDirectionOffset", 0.0));
1726 m_page->tiltDirectionOffsetAngle->setPrefix(i18n(
"Pen tilt direction offset: "));
1733 tabletTestDialog.exec();
1759 return intMemoryLimit->value() - intPoolLimit->value();
1767 const double totalRAM = cfg.
totalRAM();
1768 lblTotalMemory->setText(KFormat().formatByteSize(totalRAM * 1024 * 1024, 0, KFormat::IECBinaryDialect, KFormat::UnitMegaByte));
1771 sliderMemoryLimit->setRange(1, 100, 2);
1772 sliderMemoryLimit->setSingleStep(0.01);
1775 sliderPoolLimit->setRange(0, 20, 2);
1776 sliderPoolLimit->setSingleStep(0.01);
1779 sliderUndoLimit->setRange(0, 50, 2);
1780 sliderUndoLimit->setSingleStep(0.01);
1782 intMemoryLimit->setMinimumWidth(80);
1783 intPoolLimit->setMinimumWidth(80);
1784 intUndoLimit->setMinimumWidth(80);
1787 formLayout->takeRow(2);
1788 label_5->setVisible(
false);
1789 intPoolLimit->setVisible(
false);
1790 sliderPoolLimit->setVisible(
false);
1804 std::bind(&KisIntParseSpinBox::value,
1808 connect(intMemoryLimit, SIGNAL(valueChanged(
int)), sync2, SLOT(slotParentValueChanged()));
1819 connect(intPoolLimit, SIGNAL(valueChanged(
int)), sync3, SLOT(slotParentValueChanged()));
1820 connect(intMemoryLimit, SIGNAL(valueChanged(
int)), sync3, SLOT(slotParentValueChanged()));
1824 sliderSwapSize->setSuffix(i18n(
" GiB"));
1825 sliderSwapSize->setRange(1, 64);
1826 intSwapSize->setRange(1, 64);
1832 intSwapSize, SLOT(setValue(
int)));
1835 sliderSwapSize, SLOT(setValue(
int)));
1838 swapFileLocation->setConfigurationName(
"swapfile_location");
1839 swapFileLocation->setFileName(cfg.
swapDir());
1841 sliderThreadsLimit->setRange(1, QThread::idealThreadCount());
1842 sliderFrameClonesLimit->setRange(1, QThread::idealThreadCount());
1844 sliderFrameTimeout->setRange(5, 600);
1845 sliderFrameTimeout->setSuffix(i18nc(
"suffix for \"seconds\"",
" sec"));
1848 sliderFpsLimit->setSuffix(i18n(
" fps"));
1856 intCachedFramesSizeLimit->setRange(256, 10000);
1857 intCachedFramesSizeLimit->setSuffix(i18n(
" px"));
1858 intCachedFramesSizeLimit->setSingleStep(1);
1859 intCachedFramesSizeLimit->setPageStep(1000);
1861 intRegionOfInterestMargin->setRange(1, 100);
1863 i18nc(
"{n} is the number value, % is the percent sign",
"{n}%"));
1864 intRegionOfInterestMargin->setSingleStep(1);
1865 intRegionOfInterestMargin->setPageStep(10);
1867 connect(chkCachedFramesSizeLimit, SIGNAL(toggled(
bool)), intCachedFramesSizeLimit, SLOT(setEnabled(
bool)));
1868 connect(chkUseRegionOfInterest, SIGNAL(toggled(
bool)), intRegionOfInterestMargin, SLOT(setEnabled(
bool)));
1870 connect(chkTransformToolUseInStackPreview, SIGNAL(toggled(
bool)), chkTransformToolForceLodMode, SLOT(setEnabled(
bool)));
1874 chkDisableAVXOptimizations->setVisible(
false);
1893 chkPerformanceLogging->setChecked(cfg.
enablePerfLog(requestDefault));
1896 sliderSwapSize->setValue(cfg.
maxSwapSize(requestDefault) / 1024);
1897 swapFileLocation->setFileName(cfg.
swapDir(requestDefault));
1905#if KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
1909 chkDetectFps->setVisible(
false);
1923 optOnDisk->setChecked(
true);
1925 optInMemory->setChecked(
true);
1930 intCachedFramesSizeLimit->setEnabled(chkCachedFramesSizeLimit->isChecked());
1934 intRegionOfInterestMargin->setEnabled(chkUseRegionOfInterest->isChecked());
1937 KConfigGroup group = KSharedConfig::openConfig()->group(
"KisToolTransform");
1938 chkTransformToolUseInStackPreview->setChecked(!group.readEntry(
"useOverlayPreviewStyle",
false));
1939 chkTransformToolForceLodMode->setChecked(group.readEntry(
"forceLodMode",
true));
1940 chkTransformToolForceLodMode->setEnabled(chkTransformToolUseInStackPreview->isChecked());
1944 KConfigGroup group = KSharedConfig::openConfig()->group(
"KritaTransform/KisToolMove");
1945 chkMoveToolForceLodMode->setChecked(group.readEntry(
"forceLodMode",
false));
1949 KConfigGroup group( KSharedConfig::openConfig(),
"filterdialog");
1950 chkFiltersForceLodMode->setChecked(group.readEntry(
"forceLodMode",
true));
1967 cfg.
setSwapDir(swapFileLocation->fileName());
1973#if KRITA_QT_HAS_UPDATE_COMPRESSION_PATCH
1997 KConfigGroup group = KSharedConfig::openConfig()->group(
"KisToolTransform");
1998 group.writeEntry(
"useOverlayPreviewStyle", !chkTransformToolUseInStackPreview->isChecked());
1999 group.writeEntry(
"forceLodMode", chkTransformToolForceLodMode->isChecked());
2003 KConfigGroup group = KSharedConfig::openConfig()->group(
"KritaTransform/KisToolMove");
2004 group.writeEntry(
"forceLodMode", chkMoveToolForceLodMode->isChecked());
2008 KConfigGroup group( KSharedConfig::openConfig(),
"filterdialog");
2009 group.writeEntry(
"forceLodMode", chkFiltersForceLodMode->isChecked());
2033#include <QOpenGLContext>
2040 const QString csString =
2047 "Unknown Color Space";
2049 return QString(
"%1 (%2 bit)").arg(csString).arg(depth);
2087 const QString rendererOpenGLText = i18nc(
"canvas renderer",
"OpenGL");
2088 const QString rendererSoftwareText = i18nc(
"canvas renderer",
"Software Renderer (very slow)");
2090 const QString rendererOpenGLESText =
2091 qEnvironmentVariable(
"QT_ANGLE_PLATFORM") !=
"opengl"
2092 ? i18nc(
"canvas renderer",
"Direct3D 11 via ANGLE")
2093 : i18nc(
"canvas renderer",
"OpenGL via ANGLE");
2095 const QString rendererOpenGLESText = i18nc(
"canvas renderer",
"OpenGL ES");
2102 i18nc(
"canvas renderer",
"Unknown"));
2104 cmbPreferredRenderer->clear();
2107 const bool onlyOneRendererSupported =
2113 if (!onlyOneRendererSupported) {
2114 QString qtPreferredRendererText;
2116 qtPreferredRendererText = rendererOpenGLESText;
2118 qtPreferredRendererText = rendererSoftwareText;
2120 qtPreferredRendererText = rendererOpenGLText;
2122 cmbPreferredRenderer->addItem(i18nc(
"canvas renderer",
"Auto (%1)", qtPreferredRendererText),
KisOpenGL::RendererAuto);
2123 cmbPreferredRenderer->setCurrentIndex(0);
2125 cmbPreferredRenderer->setEnabled(
false);
2131 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2138 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2145 cmbPreferredRenderer->setCurrentIndex(cmbPreferredRenderer->count() - 1);
2149 if (!(supportedRenderers &
2154 grpOpenGL->setEnabled(
false);
2155 grpOpenGL->setChecked(
false);
2156 chkUseTextureBuffer->setEnabled(
false);
2157 cmbAssistantsDrawMode->setEnabled(
false);
2158 cmbFilterMode->setEnabled(
false);
2160 grpOpenGL->setEnabled(
true);
2162 chkUseTextureBuffer->setEnabled(cfg.
useOpenGL());
2164 cmbAssistantsDrawMode->setEnabled(cfg.
useOpenGL());
2165 cmbAssistantsDrawMode->setCurrentIndex(assistantDrawModeToIndex(cfg.
assistantsDrawMode()));
2166 cmbFilterMode->setEnabled(cfg.
useOpenGL());
2170 cmbFilterMode->removeItem(3);
2177 lblPreferredXcbGlApi->setVisible(currentXcbGlProvider.has_value());
2178 cmbPreferredXcbGlApi->setVisible(currentXcbGlProvider.has_value());
2180 if (currentXcbGlProvider.has_value()) {
2181 const QString glxCurrent = i18nc(
"@item:inlistbox",
"GLX (current)");
2182 const QString glxNotCurrent = i18nc(
"@item:inlistbox",
"GLX");
2183 const QString eglCurrent = i18nc(
"@item:inlistbox",
"EGL (current)");
2184 const QString eglNotCurrent = i18nc(
"@item:inlistbox",
"EGL");
2189 cmbPreferredXcbGlApi->setToolTip(i18nc(
"@info:tooltip",
2190 "<p>If you are using Krita on X11 or XWayland and experience slowness, "
2191 "try switching between EGL and GLX</p>"));
2196 int index = cmbPreferredXcbGlApi->findData(preferredValue);
2201 cmbPreferredXcbGlApi->setCurrentIndex(index);
2205 lblCurrentDisplayFormat->setText(
"");
2206 lblCurrentRootSurfaceFormat->setText(
"");
2207 grpHDRWarning->setVisible(
false);
2216 QOpenGLContext *context = QOpenGLContext::currentContext();
2219 context = QOpenGLContext::globalShareContext();
2225 if (screen && adapter.
isValid()) {
2230 toolTip << i18n(
"Display Id: %1", info.
screen->name());
2231 toolTip << i18n(
"Display Name: %1 %2", info.
screen->manufacturer(), info.
screen->model());
2232 toolTip << i18n(
"Min Luminance: %1", info.
minLuminance);
2233 toolTip << i18n(
"Max Luminance: %1", info.
maxLuminance);
2240 lblCurrentDisplayFormat->setToolTip(toolTip.join(
'\n'));
2243 lblCurrentDisplayFormat->setToolTip(
"");
2244 lblCurrentDisplayFormat->setText(i18n(
"Unknown"));
2247 lblCurrentDisplayFormat->setToolTip(
"");
2248 lblCurrentDisplayFormat->setText(i18n(
"Unknown"));
2249 qWarning() <<
"Failed to fetch display info:" << adapter.
errorString();
2254 lblCurrentRootSurfaceFormat->setText(colorSpaceString(colorSpace, currentFormat.redBufferSize()));
2255 cmbPreferedRootSurfaceFormat->setCurrentIndex(formatToIndex(cfg.
rootSurfaceFormat()));
2261 tabHDR->setEnabled(
false);
2269 const int hdrTabIndex = tabWidget->indexOf(tabHDR);
2271 if (hdrTabIndex >= 0) {
2272 tabWidget->setTabVisible(hdrTabIndex,
false);
2278 if (openglWarnings.isEmpty()) {
2279 grpOpenGLWarnings->setVisible(
false);
2281 QString text = QString(
"<p><b>%1</b>").arg(i18n(
"Warning(s):"));
2282 text.append(
"<ul>");
2283 Q_FOREACH (
const QString &warning, openglWarnings) {
2284 text.append(
"<li>");
2285 text.append(warning.toHtmlEscaped());
2286 text.append(
"</li>");
2288 text.append(
"</ul></p>");
2289 grpOpenGLWarnings->setText(text);
2290 grpOpenGLWarnings->setPixmap(
2291 grpOpenGLWarnings->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
2292 grpOpenGLWarnings->setVisible(
true);
2300 btnSelectionOverlayColor->setColor(c);
2301 sldSelectionOverlayOpacity->setRange(0.0, 1.0, 2);
2302 sldSelectionOverlayOpacity->setSingleStep(0.05);
2305 sldSelectionOutlineOpacity->setRange(0.0, 1.0, 2);
2306 sldSelectionOutlineOpacity->setSingleStep(0.05);
2309 intCheckSize->setValue(cfg.
checkSize());
2313 colorChecks1->setColor(ck1);
2316 colorChecks2->setColor(ck2);
2319 canvasBorder->setColor(cb);
2330 pixelGridColorButton->setColor(gridColor);
2338 cmbPreferredRenderer->setCurrentIndex(0);
2341 grpOpenGL->setEnabled(
false);
2342 grpOpenGL->setChecked(
false);
2343 chkUseTextureBuffer->setEnabled(
false);
2344 cmbAssistantsDrawMode->setEnabled(
false);
2345 cmbFilterMode->setEnabled(
false);
2348 grpOpenGL->setEnabled(
true);
2349 grpOpenGL->setChecked(cfg.
useOpenGL(
true));
2351 chkUseTextureBuffer->setEnabled(
true);
2352 cmbAssistantsDrawMode->setEnabled(
true);
2353 cmbAssistantsDrawMode->setCurrentIndex(assistantDrawModeToIndex(cfg.
assistantsDrawMode(
true)));
2354 cmbFilterMode->setEnabled(
true);
2365 btnSelectionOverlayColor->setColor(c);
2370 intCheckSize->setValue(cfg.
checkSize(
true));
2373 colorChecks1->setColor(ck1);
2376 colorChecks2->setColor(ck2);
2379 canvasBorder->setColor(cvb);
2384 chkHidePopups->setChecked(cfg.
hidePopups(
true));
2388 pixelGridColorButton->setColor(gridColor);
2398 chkUseTextureBuffer->setEnabled(isChecked);
2399 cmbFilterMode->setEnabled(isChecked);
2400 cmbAssistantsDrawMode->setEnabled(isChecked);
2407 QOpenGLContext *context = QOpenGLContext::currentContext();
2416 grpHDRWarning->setVisible(
true);
2417 grpHDRWarning->setPixmap(
2418 grpHDRWarning->style()->standardIcon(QStyle::SP_MessageBoxWarning).pixmap(QSize(32, 32)));
2419 grpHDRWarning->setText(i18n(
"<b>Warning:</b> current display doesn't support HDR rendering"));
2421 grpHDRWarning->setVisible(
false);
2467 connect(chkShowColorHistory, SIGNAL(toggled(
bool)), cmbColorHistorySorting, SLOT(setEnabled(
bool)));
2468 connect(chkShowColorHistory, SIGNAL(toggled(
bool)), lblColorHistorySorting, SLOT(setEnabled(
bool)));
2479 sbPaletteSize->setValue(config.
readEntry(
"popuppalette/size", 385));
2480 sbSelectorSize->setValue(config.
readEntry(
"popuppalette/selectorSize", 140));
2481 cmbSelectorType->setCurrentIndex(config.
readEntry<
bool>(
"popuppalette/usevisualcolorselector",
false) ? 1 : 0);
2482 chkShowColorHistory->setChecked(config.
readEntry(
"popuppalette/showColorHistory",
true));
2483 chkShowRotationTrack->setChecked(config.
readEntry(
"popuppalette/showRotationTrack",
true));
2484 chkUseDynamicSlotCount->setChecked(config.
readEntry(
"popuppalette/useDynamicSlotCount",
true));
2485 grpFixTriangleRotation->setChecked(config.
readEntry(
"popuppalette/fixTriangleRotation",
false));
2486 sbTriangleRotationAngle->setValue(config.
readEntry(
"popuppalette/triangleRotationAngle", 0));
2488 QString currentSorting = config.
readEntry(
"popuppalette/colorHistorySorting", QString(
"hsv"));
2489 if (!allowedColorHistorySortingValues.contains(currentSorting)) {
2490 currentSorting =
"hsv";
2492 cmbColorHistorySorting->setCurrentIndex(allowedColorHistorySortingValues.indexOf(currentSorting));
2493 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2494 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2495 grpFixTriangleRotation->setEnabled(!cmbSelectorType->currentIndex());
2504 config.
writeEntry(
"popuppalette/size", sbPaletteSize->value());
2505 config.
writeEntry(
"popuppalette/selectorSize", sbSelectorSize->value());
2506 config.
writeEntry<
bool>(
"popuppalette/usevisualcolorselector", cmbSelectorType->currentIndex() > 0);
2507 config.
writeEntry<
bool>(
"popuppalette/showColorHistory", chkShowColorHistory->isChecked());
2508 config.
writeEntry<
bool>(
"popuppalette/showRotationTrack", chkShowRotationTrack->isChecked());
2509 config.
writeEntry<
bool>(
"popuppalette/useDynamicSlotCount", chkUseDynamicSlotCount->isChecked());
2510 config.
writeEntry(
"popuppalette/colorHistorySorting",
2511 allowedColorHistorySortingValues[cmbColorHistorySorting->currentIndex()]);
2512 config.
writeEntry<
bool>(
"popuppalette/fixTriangleRotation", grpFixTriangleRotation->isChecked());
2513 config.
writeEntry(
"popuppalette/triangleRotationAngle", sbTriangleRotationAngle->value());
2520 sbPaletteSize->setValue(385);
2521 sbSelectorSize->setValue(140);
2522 cmbSelectorType->setCurrentIndex(0);
2523 chkShowColorHistory->setChecked(
true);
2524 chkShowRotationTrack->setChecked(
true);
2525 chkUseDynamicSlotCount->setChecked(
true);
2526 cmbColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2527 lblColorHistorySorting->setEnabled(chkShowColorHistory->isChecked());
2528 grpFixTriangleRotation->setChecked(
false);
2529 sbTriangleRotationAngle->setValue(0);
2533 grpFixTriangleRotation->setEnabled(!index);
2539 : KPageDialog(parent)
2542 setWindowTitle(i18n(
"Configure Krita"));
2543 setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::RestoreDefaults);
2545 setFaceType(KPageDialog::List);
2549 KPageWidgetItem *page =
new KPageWidgetItem(vbox, i18n(
"General"));
2550 page->setObjectName(
"general");
2551 page->setHeader(i18n(
"General"));
2559 page =
new KPageWidgetItem(vbox, i18n(
"Keyboard Shortcuts"));
2560 page->setObjectName(
"shortcuts");
2561 page->setHeader(i18n(
"Shortcuts"));
2572 page->setHeader(i18n(
"Canvas Input"));
2573 page->setObjectName(
"canvasinput");
2579 page =
new KPageWidgetItem(vbox, i18n(
"Display"));
2580 page->setObjectName(
"display");
2581 page->setHeader(i18n(
"Display"));
2589 page =
new KPageWidgetItem(vbox, i18n(
"Color Management"));
2590 page->setObjectName(
"colormanagement");
2591 page->setHeader(i18nc(
"Label of color as in Color Management",
"Color"));
2599 page =
new KPageWidgetItem(vbox, i18n(
"Performance"));
2600 page->setObjectName(
"performance");
2601 page->setHeader(i18n(
"Performance"));
2609 page =
new KPageWidgetItem(vbox, i18n(
"Tablet settings"));
2610 page->setObjectName(
"tablet");
2611 page->setHeader(i18n(
"Tablet"));
2619 page =
new KPageWidgetItem(vbox, i18n(
"Canvas-only settings"));
2620 page->setObjectName(
"canvasonly");
2621 page->setHeader(i18n(
"Canvas-only"));
2629 page =
new KPageWidgetItem(vbox, i18n(
"Pop-up Palette"));
2630 page->setObjectName(
"popuppalette");
2631 page->setHeader(i18n(
"Pop-up Palette"));
2639 page = addPage(
m_authorPage, i18nc(
"@title:tab Author page",
"Author" ));
2640 page->setObjectName(
"author");
2641 page->setHeader(i18n(
"Author"));
2645 KGuiItem::assign(
button(QDialogButtonBox::Ok), KStandardGuiItem::ok());
2646 KGuiItem::assign(
button(QDialogButtonBox::Cancel), KStandardGuiItem::cancel());
2647 QPushButton *restoreDefaultsButton =
button(QDialogButtonBox::RestoreDefaults);
2648 restoreDefaultsButton->setText(i18nc(
"@action:button",
"Restore Defaults"));
2656 Q_FOREACH(
const QString &key, keys) {
2660 page =
new KPageWidgetItem(vbox, preferenceSet->
name());
2661 page->setHeader(preferenceSet->
header());
2662 page->setIcon(preferenceSet->
icon());
2664 preferenceSet->setParent(vbox);
2667 connect(restoreDefaultsButton, SIGNAL(clicked(
bool)), preferenceSet, SLOT(loadDefaultPreferences()), Qt::UniqueConnection);
2668 connect(
this, SIGNAL(accepted()), preferenceSet, SLOT(savePreferences()), Qt::UniqueConnection);
2671 connect(restoreDefaultsButton, SIGNAL(clicked(
bool)),
this, SLOT(
slotDefault()));
2674 QString currentPageName = cfg.
readEntry<QString>(
"KisDlgPreferences/CurrentPage");
2675 Q_FOREACH(KPageWidgetItem *page,
m_pages) {
2676 if (page->objectName() == currentPageName) {
2677 setCurrentPage(page);
2683#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
2687 const auto *titleWidget = findChild<KTitleWidget*>();
2689 QLayoutItem *titleFrame = titleWidget->layout()->itemAt(0);
2691 titleFrame->widget()->setBackgroundRole(QPalette::Window);
2701 cfg.
writeEntry<QString>(
"KisDlgPreferences/CurrentPage", currentPage()->objectName());
2705 KPageDialog::showEvent(event);
2706 button(QDialogButtonBox::Cancel)->setAutoDefault(
false);
2707 button(QDialogButtonBox::Ok)->setAutoDefault(
false);
2708 button(QDialogButtonBox::RestoreDefaults)->setAutoDefault(
false);
2709 button(QDialogButtonBox::Cancel)->setDefault(
false);
2710 button(QDialogButtonBox::Ok)->setDefault(
false);
2711 button(QDialogButtonBox::RestoreDefaults)->setDefault(
false);
2716 if (buttonBox()->buttonRole(
button) == QDialogButtonBox::RejectRole) {
2723 if (currentPage()->objectName() ==
"general") {
2726 else if (currentPage()->objectName() ==
"shortcuts") {
2729 else if (currentPage()->objectName() ==
"display") {
2732 else if (currentPage()->objectName() ==
"colormanagement") {
2735 else if (currentPage()->objectName() ==
"performance") {
2738 else if (currentPage()->objectName() ==
"tablet") {
2741 else if (currentPage()->objectName() ==
"canvasonly") {
2744 else if (currentPage()->objectName() ==
"canvasinput") {
2747 else if (currentPage()->objectName() ==
"popuppalette") {
2754 connect(this->buttonBox(), SIGNAL(clicked(QAbstractButton*)),
this, SLOT(
slotButtonClicked(QAbstractButton*)));
2756 int retval = exec();
2783 KConfigGroup group = KSharedConfig::openConfig()->group(
"File Dialogs");
2784 group.writeEntry(
"DontUseNativeFileDialog", !
m_general->m_chkNativeFileDialog->isChecked());
2790 if (
m_general->chkUseCustomFont->isChecked()) {
2791 cfg.
writeEntry<QString>(
"custom_system_font",
m_general->cmbCustomFont->currentFont().family());
2795 cfg.
writeEntry<QString>(
"custom_system_font",
"");
2820 const QString configPath = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
2821 QSettings kritarc(configPath + QStringLiteral(
"/kritadisplayrc"), QSettings::IniFormat);
2822 kritarc.setValue(
"EnableHiDPI",
m_general->m_chkHiDPI->isChecked());
2823#if defined(Q_OS_WIN) && defined(HAVE_HIGH_DPI_SCALE_FACTOR_ROUNDING_POLICY)
2824 kritarc.setValue(
"EnableHiDPIFractionalScaling",
m_general->m_chkHiDPIFractionalScaling->isChecked());
2826 kritarc.setValue(
"LogUsage",
m_general->chkUsageLogging->isChecked());
2830 cfg.
writeEntry<
bool>(
"useCreamyAlphaDarken", (bool)!
m_general->cmbFlowMode->currentIndex());
2831 cfg.
writeEntry<
bool>(
"useSubtractiveBlendingForCmykColorSpaces", (bool)!
m_general->cmbCmykBlendingMode->currentIndex());
2844 cfg.
writeEntry(
"useTouchPressureSensitivity",
m_general->chkTouchPressureSensitivity->isChecked());
2859 QFileInfo fi(
m_general->m_resourceFolderSelector->currentData(Qt::UserRole).value<QString>());
2861 QFileInfo fi(
m_general->m_urlResourceFolder->fileName());
2863 if (fi.isWritable()) {
2874 for (
int i = 0; i < QApplication::screens().count(); ++i) {
2913#if defined Q_OS_WIN && (defined QT5_HAS_WINTAB_SWITCH || QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
2916# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
2918 using QWindowsApplication = QNativeInterface::Private::QWindowsApplication;
2919 if (
auto nativeWindowsApp =
dynamic_cast<QWindowsApplication *
>(QGuiApplicationPrivate::platformIntegration())) {
2926#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_PAGE_UP_DOWN
2927 cfg.setUsePageUpDownMouseButtonEmulationWorkaround(
2931#if KRITA_QT_HAS_ANDROID_EMULATE_MOUSE_BUTTONS_FOR_HIGH_FUNCTION_KEYS
2932 cfg.setUseHighFunctionKeyMouseButtonEmulationWorkaround(
2936#if KRITA_QT_HAS_ANDROID_IGNORE_HISTORIC_TABLET_EVENTS
2937 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 toggleUseDefaultColorSpace(bool useDefColorSpace)
QList< QLabel * > m_monitorProfileLabels
void toggleAllowMonitorProfileSelection(bool useSystemProfile)
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()
ColorSettingsTab(QWidget *parent=0, const char *name=0)
WdgColorSettings * m_page
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()
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
KisInputConfigurationPage * m_inputConfiguration
~KisDlgPreferences() override
FullscreenSettingsTab * m_fullscreenSettings
ShortcutSettingsTab * m_shortcutSettings
TabletSettingsTab * m_tabletSettings
QList< KPageWidgetItem * > m_pages
DisplaySettingsTab * m_displaySettings
void slotButtonClicked(QAbstractButton *button)
KisDlgPreferences(QWidget *parent=0, const char *name=0)
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
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)