Krita Source Code Documentation
Loading...
Searching...
No Matches
ColorSettingsTab Class Reference

#include <kis_dlg_preferences.h>

+ Inheritance diagram for ColorSettingsTab:

Public Types

using CanvasSurfaceBitDepthMode = KisConfig::CanvasSurfaceBitDepthMode
 
using CanvasSurfaceMode = KisConfig::CanvasSurfaceMode
 

Public Member Functions

 ColorSettingsTab (QWidget *parent=0, const char *name=0)
 
void setDefault ()
 

Public Attributes

QPointer< KisSqueezedComboBoxm_canvasSurfaceBitDepth
 
QPointer< KisSqueezedComboBoxm_canvasSurfaceColorSpace
 
QPointer< QCheckBox > m_chkEnableCanvasColorSpaceManagement
 
bool m_colorManagedByOS {false}
 
QList< QLabel * > m_monitorProfileLabels
 
QList< KisSqueezedComboBox * > m_monitorProfileWidgets
 
WdgColorSettingsm_page
 
QButtonGroup m_pasteBehaviourGroup
 
QScopedPointer< KisProofingConfigModelm_proofModel
 

Private Slots

void installProfile ()
 
void refillMonitorProfiles (const KoID &s)
 
void toggleAllowMonitorProfileSelection (bool useSystemProfile)
 
void toggleUseDefaultColorSpace (bool useDefColorSpace)
 
void updateProofingDisplayInfo ()
 

Detailed Description

Definition at line 188 of file kis_dlg_preferences.h.

Member Typedef Documentation

◆ CanvasSurfaceBitDepthMode

◆ CanvasSurfaceMode

Constructor & Destructor Documentation

◆ ColorSettingsTab()

ColorSettingsTab::ColorSettingsTab ( QWidget * parent = 0,
const char * name = 0 )

Default proofing config

Definition at line 1206 of file kis_dlg_preferences.cc.

1207 : QWidget(parent)
1209{
1210 setObjectName(name);
1211
1212 // XXX: Make sure only profiles that fit the specified color model
1213 // are shown in the profile combos
1214
1215 QGridLayout * l = new QGridLayout(this);
1216 l->setContentsMargins(0, 0, 0, 0);
1217 m_page = new WdgColorSettings(this);
1218 l->addWidget(m_page, 0, 0);
1219
1220 KisConfig cfg(true);
1221
1223
1224 if (!m_colorManagedByOS) {
1225 m_page->chkUseSystemMonitorProfile->setChecked(cfg.useSystemMonitorProfile());
1226 connect(m_page->chkUseSystemMonitorProfile, SIGNAL(toggled(bool)), this, SLOT(toggleAllowMonitorProfileSelection(bool)));
1227 }
1228 m_page->chkUseSystemMonitorProfile->setVisible(!m_colorManagedByOS);
1229
1230 m_page->useDefColorSpace->setChecked(cfg.useDefaultColorSpace());
1231 connect(m_page->useDefColorSpace, SIGNAL(toggled(bool)), this, SLOT(toggleUseDefaultColorSpace(bool)));
1233 for (QList<KoID>::iterator id = colorSpaces.begin(); id != colorSpaces.end(); /* nop */) {
1235 id = colorSpaces.erase(id);
1236 } else {
1237 ++id;
1238 }
1239 }
1240 m_page->cmbWorkingColorSpace->setIDList(colorSpaces);
1241 m_page->cmbWorkingColorSpace->setCurrent(cfg.workingColorSpace());
1242 m_page->cmbWorkingColorSpace->setEnabled(cfg.useDefaultColorSpace());
1243
1244 if (!m_colorManagedByOS) {
1245 m_page->bnAddColorProfile->setIcon(koIcon("document-import-16"));
1246 connect(m_page->bnAddColorProfile, SIGNAL(clicked()), SLOT(installProfile()));
1247 }
1248 m_page->bnAddColorProfile->setVisible(!m_colorManagedByOS);
1249
1250 {
1251 QStringList profiles;
1252 QMap<QString, const KoColorProfile *> profileList;
1253 Q_FOREACH(const KoColorProfile *profile, KoColorSpaceRegistry::instance()->profilesFor(RGBAColorModelID.id())) {
1254 profileList[profile->name()] = profile;
1255 profiles.append(profile->name());
1256 }
1257
1258 std::sort(profiles.begin(), profiles.end());
1259 Q_FOREACH (const QString profile, profiles) {
1260 m_page->cmbColorProfileForEXR->addSqueezedItem(profile);
1261 }
1262
1264 const QString defaultProfile = KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(colorSpaceId);
1265 const QString userProfile = cfg.readEntry("ExrDefaultColorProfile", defaultProfile);
1266
1267 m_page->cmbColorProfileForEXR->setCurrent(profiles.contains(userProfile) ? userProfile : defaultProfile);
1268 }
1269
1270
1271 if (!m_colorManagedByOS) {
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);
1282 }
1283
1284 // disable if not Linux as KisColorManager is not yet implemented outside Linux
1285#ifndef Q_OS_LINUX
1286 m_page->chkUseSystemMonitorProfile->setChecked(false);
1287 m_page->chkUseSystemMonitorProfile->setDisabled(true);
1288 m_page->chkUseSystemMonitorProfile->setHidden(true);
1289#endif
1290
1291 refillMonitorProfiles(KoID("RGBA"));
1292
1293 for(int i = 0; i < QApplication::screens().count(); ++i) {
1294 if (m_monitorProfileWidgets[i]->contains(cfg.monitorProfile(i))) {
1295 m_monitorProfileWidgets[i]->setCurrent(cfg.monitorProfile(i));
1296 }
1297 }
1298 } else {
1299 QVBoxLayout *vboxLayout = new QVBoxLayout(m_page->monitorprofileholder);
1300 vboxLayout->setContentsMargins(0, 0, 0, 0);
1301 vboxLayout->addItem(new QSpacerItem(20,20));
1302
1303 QGroupBox *groupBox = new QGroupBox(i18n("Display's color space is managed by the operating system"));
1304 vboxLayout->addWidget(groupBox);
1305
1306 QFormLayout *monitorProfileGrid = new QFormLayout(groupBox);
1307 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1308
1310 new QCheckBox(i18n("Enable canvas color management"), this);
1311
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>"
1316 ""
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:"
1320 ""
1321 "<ol>"
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>"
1325 "</ol>"
1326 "</p>"));
1327
1328 monitorProfileGrid->addRow(m_chkEnableCanvasColorSpaceManagement);
1329
1330 // surface color space
1332 m_canvasSurfaceColorSpace->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
1333 QLabel *canvasSurfaceColorSpaceLbl = new QLabel(i18n("Canvas surface color space:"), this);
1334 monitorProfileGrid->addRow(canvasSurfaceColorSpaceLbl, m_canvasSurfaceColorSpace);
1335
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));
1338 m_canvasSurfaceColorSpace->addSqueezedItem(i18n("Rec 709 Linear"), QVariant::fromValue(CanvasSurfaceMode::Rec709g10));
1339 m_canvasSurfaceColorSpace->addSqueezedItem(i18n("Rec 2020 PQ"), QVariant::fromValue(CanvasSurfaceMode::Rec2020pq));
1340 m_canvasSurfaceColorSpace->addSqueezedItem(i18n("Unmanaged (testing only)"), QVariant::fromValue(CanvasSurfaceMode::Unmanaged));
1341
1342 m_canvasSurfaceColorSpace->setToolTip(
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>"));
1346
1347 // surface bit depth
1349 m_canvasSurfaceBitDepth->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
1350 QLabel *canvasSurfaceBitDepthLbl = new QLabel(i18n("Canvas surface bit depth (needs restart):"), this);
1351 monitorProfileGrid->addRow(canvasSurfaceBitDepthLbl, m_canvasSurfaceBitDepth);
1352
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));
1356
1357 m_canvasSurfaceBitDepth->setToolTip(
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>"));
1361
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);
1366
1367 vboxLayout->addItem(new QSpacerItem(20,20));
1368
1370 QLabel *preferredLbl = new QLabel(i18n("Color space preferred by the operating system:\n%1", KisPlatformPluginInterfaceFactory::instance()->osPreferredColorSpaceReport(mainWindow)), this);
1371 vboxLayout->addWidget(preferredLbl);
1372
1373 m_chkEnableCanvasColorSpaceManagement->setChecked(cfg.enableCanvasSurfaceColorSpaceManagement());
1374
1375 {
1376 auto mode = cfg.canvasSurfaceColorSpaceManagementMode();
1377 int index = m_canvasSurfaceColorSpace->findData(QVariant::fromValue(mode));
1378 KIS_SAFE_ASSERT_RECOVER(index >= 0) {
1379 index = 0;
1380 }
1381 m_canvasSurfaceColorSpace->setCurrentIndex(index);
1382 }
1383
1384 {
1385 auto mode = cfg.canvasSurfaceBitDepthMode();
1386 int index = m_canvasSurfaceBitDepth->findData(QVariant::fromValue(mode));
1387 KIS_SAFE_ASSERT_RECOVER(index >= 0) {
1388 index = 0;
1389 }
1390 m_canvasSurfaceBitDepth->setCurrentIndex(index);
1391 }
1392
1393 connect(m_chkEnableCanvasColorSpaceManagement, &QCheckBox::toggled, m_canvasSurfaceColorSpace, &QWidget::setEnabled);
1395
1396 connect(m_chkEnableCanvasColorSpaceManagement, &QCheckBox::toggled, canvasSurfaceColorSpaceLbl, &QWidget::setEnabled);
1397 canvasSurfaceColorSpaceLbl->setEnabled(m_chkEnableCanvasColorSpaceManagement->isChecked());
1398
1399 connect(m_chkEnableCanvasColorSpaceManagement, &QCheckBox::toggled, m_canvasSurfaceBitDepth, &QWidget::setEnabled);
1401
1402 connect(m_chkEnableCanvasColorSpaceManagement, &QCheckBox::toggled, canvasSurfaceBitDepthLbl, &QWidget::setEnabled);
1403 canvasSurfaceBitDepthLbl->setEnabled(m_chkEnableCanvasColorSpaceManagement->isChecked());
1404 }
1405
1406 m_page->chkBlackpoint->setChecked(cfg.useBlackPointCompensation());
1407 m_page->chkAllowLCMSOptimization->setChecked(cfg.allowLCMSOptimization());
1408 m_page->chkForcePaletteColor->setChecked(cfg.forcePaletteColors());
1409 m_page->cmbMonitorIntent->setCurrentIndex(cfg.monitorRenderIntent());
1410 KisImageConfig cfgImage(true);
1411
1415 KisProofingConfigurationSP proofingConfig = cfgImage.defaultProofingconfiguration();
1416
1417 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1418
1419 m_proofModel->data.set(*proofingConfig.data());
1420
1421 connect(m_page->chkBlackpoint, SIGNAL(toggled(bool)), this, SLOT(updateProofingDisplayInfo()));
1422 connect(m_page->cmbMonitorIntent, SIGNAL(currentIndexChanged(int)), this, SLOT(updateProofingDisplayInfo()));
1424
1427 m_pasteBehaviourGroup.addButton(m_page->radioPasteAsk, KisClipboard::PASTE_ASK);
1428
1429 QAbstractButton *button = m_pasteBehaviourGroup.button(cfg.pasteBehaviour());
1430 Q_ASSERT(button);
1431
1432 if (button) {
1433 button->setChecked(true);
1434 }
1435
1436 if (!m_colorManagedByOS) {
1437 toggleAllowMonitorProfileSelection(cfg.useSystemMonitorProfile());
1438 }
1439}
const KoID AlphaColorModelID("A", ki18n("Alpha mask"))
const KoID Float16BitsColorDepthID("F16", ki18n("16-bit float/channel"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
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)
WdgColorSettings * m_page
Main window for Krita.
static KisPart * instance()
Definition KisPart.cpp:131
KisMainWindow * currentMainwindow() const
Definition KisPart.cpp:459
static KisPlatformPluginInterfaceFactory * instance()
The KisProofingConfigModel class.
Definition KoID.h:30
QString id() const
Definition KoID.cpp:63
#define KIS_SAFE_ASSERT_RECOVER(cond)
Definition kis_assert.h:126
QString shortNameOfDisplay(int index)
#define koIcon(name)
Use these macros for icons without any issues.
Definition kis_icon.h:25
QString button(const QWheelEvent &ev)
QString colorSpaceId(const QString &colorModelId, const QString &colorDepthId) const
static KoColorSpaceRegistry * instance()
QString defaultProfileForColorSpace(const QString &colorSpaceId) const
KoID colorSpaceColorModelId(const QString &_colorSpaceId) const
QList< KoID > listKeys() const

References KisConfig::allowLCMSOptimization(), AlphaColorModelID, button(), KisConfig::canvasSurfaceBitDepthMode(), KisConfig::canvasSurfaceColorSpaceManagementMode(), KoColorSpaceRegistry::colorSpaceColorModelId(), KoColorSpaceRegistry::colorSpaceId(), KisPart::currentMainwindow(), KoColorSpaceRegistry::defaultProfileForColorSpace(), KisImageConfig::defaultProofingconfiguration(), KisConfig::enableCanvasSurfaceColorSpaceManagement(), Float16BitsColorDepthID, KisConfig::forcePaletteColors(), KoID::id(), installProfile(), KoColorSpaceRegistry::instance(), KisPart::instance(), KisPlatformPluginInterfaceFactory::instance(), KIS_SAFE_ASSERT_RECOVER, koIcon, KoColorSpaceRegistry::listKeys(), m_canvasSurfaceBitDepth, m_canvasSurfaceColorSpace, m_chkEnableCanvasColorSpaceManagement, m_colorManagedByOS, m_monitorProfileLabels, m_monitorProfileWidgets, m_page, m_pasteBehaviourGroup, m_proofModel, KisConfig::monitorProfile(), KisConfig::monitorRenderIntent(), KoColorProfile::name, KisClipboard::PASTE_ASK, KisClipboard::PASTE_ASSUME_MONITOR, KisClipboard::PASTE_ASSUME_WEB, KisConfig::pasteBehaviour(), KisConfig::readEntry(), refillMonitorProfiles(), RGBAColorModelID, shortNameOfDisplay(), KisPlatformPluginInterfaceFactory::surfaceColorManagedByOS(), toggleAllowMonitorProfileSelection(), toggleUseDefaultColorSpace(), updateProofingDisplayInfo(), KisConfig::useBlackPointCompensation(), KisConfig::useDefaultColorSpace(), KisConfig::useSystemMonitorProfile(), and KisConfig::workingColorSpace().

Member Function Documentation

◆ installProfile

void ColorSettingsTab::installProfile ( )
privateslot

Definition at line 1441 of file kis_dlg_preferences.cc.

1442{
1444
1445 KoFileDialog dialog(this, KoFileDialog::OpenFiles, "OpenDocumentICC");
1446 dialog.setCaption(i18n("Install Color Profiles"));
1447 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
1448 dialog.setMimeTypeFilters(QStringList() << "application/vnd.iccprofile", "application/vnd.iccprofile");
1449 QStringList profileNames = dialog.filenames();
1450
1452 Q_ASSERT(iccEngine);
1453
1454 QString saveLocation = KoResourcePaths::saveLocation("icc_profiles");
1455
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();
1459 continue;
1460 }
1461 iccEngine->addProfile(saveLocation + QFileInfo(profileName).fileName());
1462 }
1463
1464 KisConfig cfg(true);
1465 refillMonitorProfiles(KoID("RGBA"));
1466
1467 for(int i = 0; i < QApplication::screens().count(); ++i) {
1468 if (m_monitorProfileWidgets[i]->contains(cfg.monitorProfile(i))) {
1469 m_monitorProfileWidgets[i]->setCurrent(cfg.monitorProfile(i));
1470 }
1471 }
1472
1473}
QList< QString > QStringList
static KoColorSpaceEngineRegistry * instance()
T get(const QString &id) const
static QString saveLocation(const QString &type, const QString &suffix=QString(), bool create=true)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
virtual const KoColorProfile * addProfile(const QString &filename)=0

References KoColorSpaceEngine::addProfile(), KoGenericRegistry< T >::get(), KoColorSpaceEngineRegistry::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_colorManagedByOS, m_monitorProfileWidgets, KisConfig::monitorProfile(), KoFileDialog::OpenFiles, refillMonitorProfiles(), and KoResourcePaths::saveLocation().

◆ refillMonitorProfiles

void ColorSettingsTab::refillMonitorProfiles ( const KoID & s)
privateslot

Definition at line 1566 of file kis_dlg_preferences.cc.

1567{
1569
1570 for (int i = 0; i < QApplication::screens().count(); ++i) {
1571 m_monitorProfileWidgets[i]->clear();
1572 }
1573
1574 QMap<QString, const KoColorProfile *> profileList;
1575 Q_FOREACH(const KoColorProfile *profile, KoColorSpaceRegistry::instance()->profilesFor(colorSpaceId.id())) {
1576 profileList[profile->name()] = profile;
1577 }
1578
1579 Q_FOREACH (const KoColorProfile *profile, profileList.values()) {
1580 //qDebug() << "Profile" << profile->name() << profile->isSuitableForDisplay() << csf->defaultProfile();
1581 if (profile->isSuitableForDisplay()) {
1582 for (int i = 0; i < QApplication::screens().count(); ++i) {
1583 m_monitorProfileWidgets[i]->addSqueezedItem(profile->name());
1584 }
1585 }
1586 }
1587
1588 for (int i = 0; i < QApplication::screens().count(); ++i) {
1589 m_monitorProfileLabels[i]->setText(i18nc("The number of the screen (ordinal) and shortened 'name' of the screen (model + resolution)", "Screen %1 (%2):", i + 1, shortNameOfDisplay(i)));
1591 }
1592}
virtual bool isSuitableForDisplay() const =0

References KoColorSpaceRegistry::defaultProfileForColorSpace(), KoID::id(), KoColorSpaceRegistry::instance(), KoColorProfile::isSuitableForDisplay(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_colorManagedByOS, m_monitorProfileLabels, m_monitorProfileWidgets, KoColorProfile::name, and shortNameOfDisplay().

◆ setDefault()

void ColorSettingsTab::setDefault ( )

Definition at line 1513 of file kis_dlg_preferences.cc.

1514{
1515 m_page->cmbWorkingColorSpace->setCurrent("RGBA");
1516
1518 const QString defaultProfile = KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(colorSpaceId);
1519 m_page->cmbColorProfileForEXR->setCurrent(defaultProfile);
1520
1521 KisConfig cfg(true);
1522
1523 if (!m_colorManagedByOS) {
1524 refillMonitorProfiles(KoID("RGBA"));
1525 } else {
1526 m_chkEnableCanvasColorSpaceManagement->setChecked(cfg.enableCanvasSurfaceColorSpaceManagement(true));
1527
1528 {
1529 auto mode = cfg.canvasSurfaceColorSpaceManagementMode(true);
1530 int index = m_canvasSurfaceColorSpace->findData(QVariant::fromValue(mode));
1531 KIS_SAFE_ASSERT_RECOVER(index >= 0) {
1532 index = 0;
1533 }
1534 m_canvasSurfaceColorSpace->setCurrentIndex(index);
1535 }
1536
1537 {
1538 auto mode = cfg.canvasSurfaceBitDepthMode(true);
1539 int index = m_canvasSurfaceBitDepth->findData(QVariant::fromValue(mode));
1540 KIS_SAFE_ASSERT_RECOVER(index >= 0) {
1541 index = 0;
1542 }
1543 m_canvasSurfaceBitDepth->setCurrentIndex(index);
1544 }
1545 }
1546
1547 KisImageConfig cfgImage(true);
1548 KisProofingConfigurationSP proofingConfig = cfgImage.defaultProofingconfiguration(true);
1549 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1550
1551 m_page->chkBlackpoint->setChecked(cfg.useBlackPointCompensation(true));
1552 m_page->chkAllowLCMSOptimization->setChecked(cfg.allowLCMSOptimization(true));
1553 m_page->chkForcePaletteColor->setChecked(cfg.forcePaletteColors(true));
1554 m_page->cmbMonitorIntent->setCurrentIndex(cfg.monitorRenderIntent(true));
1555 if (!m_colorManagedByOS) {
1556 m_page->chkUseSystemMonitorProfile->setChecked(cfg.useSystemMonitorProfile(true));
1557 }
1558 QAbstractButton *button = m_pasteBehaviourGroup.button(cfg.pasteBehaviour(true));
1559 Q_ASSERT(button);
1560 if (button) {
1561 button->setChecked(true);
1562 }
1563}

References KisConfig::allowLCMSOptimization(), button(), KisConfig::canvasSurfaceBitDepthMode(), KisConfig::canvasSurfaceColorSpaceManagementMode(), KoColorSpaceRegistry::colorSpaceId(), KoColorSpaceRegistry::defaultProfileForColorSpace(), KisImageConfig::defaultProofingconfiguration(), KisConfig::enableCanvasSurfaceColorSpaceManagement(), Float16BitsColorDepthID, KisConfig::forcePaletteColors(), KoID::id(), KoColorSpaceRegistry::instance(), KIS_SAFE_ASSERT_RECOVER, m_canvasSurfaceBitDepth, m_canvasSurfaceColorSpace, m_chkEnableCanvasColorSpaceManagement, m_colorManagedByOS, m_page, m_pasteBehaviourGroup, KisConfig::monitorRenderIntent(), KisConfig::pasteBehaviour(), refillMonitorProfiles(), RGBAColorModelID, KisConfig::useBlackPointCompensation(), and KisConfig::useSystemMonitorProfile().

◆ toggleAllowMonitorProfileSelection

void ColorSettingsTab::toggleAllowMonitorProfileSelection ( bool useSystemProfile)
privateslot

Definition at line 1475 of file kis_dlg_preferences.cc.

1476{
1478
1479 KisConfig cfg(true);
1480
1481 if (useSystemProfile) {
1483 if (devices.size() == QApplication::screens().count()) {
1484 for(int i = 0; i < QApplication::screens().count(); ++i) {
1485 m_monitorProfileWidgets[i]->clear();
1486 QString monitorForScreen = cfg.monitorForScreen(i, devices[i]);
1487 Q_FOREACH (const QString &device, devices) {
1488 m_monitorProfileLabels[i]->setText(i18nc("The number of the screen (ordinal) and shortened 'name' of the screen (model + resolution)", "Screen %1 (%2):", i + 1, shortNameOfDisplay(i)));
1489 m_monitorProfileWidgets[i]->addSqueezedItem(KisColorManager::instance()->deviceName(device), device);
1490 if (devices[i] == monitorForScreen) {
1491 m_monitorProfileWidgets[i]->setCurrentIndex(i);
1492 }
1493 }
1494 }
1495 }
1496 }
1497 else {
1498 refillMonitorProfiles(KoID("RGBA"));
1499
1500 for(int i = 0; i < QApplication::screens().count(); ++i) {
1501 if (m_monitorProfileWidgets[i]->contains(cfg.monitorProfile(i))) {
1502 m_monitorProfileWidgets[i]->setCurrent(cfg.monitorProfile(i));
1503 }
1504 }
1505 }
1506}
QStringList devices(DeviceType type=screen) const
Return a list of device id's for the specified type.
static KisColorManager * instance()

References KisColorManager::devices(), KisColorManager::instance(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_colorManagedByOS, m_monitorProfileLabels, m_monitorProfileWidgets, KisConfig::monitorForScreen(), KisConfig::monitorProfile(), refillMonitorProfiles(), and shortNameOfDisplay().

◆ toggleUseDefaultColorSpace

void ColorSettingsTab::toggleUseDefaultColorSpace ( bool useDefColorSpace)
privateslot

Definition at line 1508 of file kis_dlg_preferences.cc.

1509{
1510 m_page->cmbWorkingColorSpace->setEnabled(useDefColorSpace);
1511}

References m_page.

◆ updateProofingDisplayInfo

void ColorSettingsTab::updateProofingDisplayInfo ( )
privateslot

Definition at line 1594 of file kis_dlg_preferences.cc.

1594 {
1596 options.first = KoColorConversionTransformation::Intent(m_page->cmbMonitorIntent->currentIndex());
1598 options.second.setFlag(KoColorConversionTransformation::BlackpointCompensation, m_page->chkBlackpoint->isChecked());
1599 m_page->wdgProofingOptions->setDisplayConfigOptions(options);
1600}
std::pair< KoColorConversionTransformation::Intent, KoColorConversionTransformation::ConversionFlags > Options

References KoColorConversionTransformation::BlackpointCompensation, KoColorConversionTransformation::internalConversionFlags(), and m_page.

Member Data Documentation

◆ m_canvasSurfaceBitDepth

QPointer<KisSqueezedComboBox> ColorSettingsTab::m_canvasSurfaceBitDepth

Definition at line 219 of file kis_dlg_preferences.h.

◆ m_canvasSurfaceColorSpace

QPointer<KisSqueezedComboBox> ColorSettingsTab::m_canvasSurfaceColorSpace

Definition at line 218 of file kis_dlg_preferences.h.

◆ m_chkEnableCanvasColorSpaceManagement

QPointer<QCheckBox> ColorSettingsTab::m_chkEnableCanvasColorSpaceManagement

Definition at line 217 of file kis_dlg_preferences.h.

◆ m_colorManagedByOS

bool ColorSettingsTab::m_colorManagedByOS {false}

Definition at line 216 of file kis_dlg_preferences.h.

216{false};

◆ m_monitorProfileLabels

QList<QLabel*> ColorSettingsTab::m_monitorProfileLabels

Definition at line 209 of file kis_dlg_preferences.h.

◆ m_monitorProfileWidgets

QList<KisSqueezedComboBox*> ColorSettingsTab::m_monitorProfileWidgets

Definition at line 210 of file kis_dlg_preferences.h.

◆ m_page

WdgColorSettings* ColorSettingsTab::m_page

Definition at line 207 of file kis_dlg_preferences.h.

◆ m_pasteBehaviourGroup

QButtonGroup ColorSettingsTab::m_pasteBehaviourGroup

Definition at line 208 of file kis_dlg_preferences.h.

◆ m_proofModel

QScopedPointer<KisProofingConfigModel> ColorSettingsTab::m_proofModel

Definition at line 211 of file kis_dlg_preferences.h.


The documentation for this class was generated from the following files: