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 175 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 1096 of file kis_dlg_preferences.cc.

1097 : QWidget(parent)
1099{
1100 setObjectName(name);
1101
1102 // XXX: Make sure only profiles that fit the specified color model
1103 // are shown in the profile combos
1104
1105 QGridLayout * l = new QGridLayout(this);
1106 l->setContentsMargins(0, 0, 0, 0);
1107 m_page = new WdgColorSettings(this);
1108 l->addWidget(m_page, 0, 0);
1109
1110 KisConfig cfg(true);
1111
1113
1114 if (!m_colorManagedByOS) {
1115 m_page->chkUseSystemMonitorProfile->setChecked(cfg.useSystemMonitorProfile());
1116 connect(m_page->chkUseSystemMonitorProfile, SIGNAL(toggled(bool)), this, SLOT(toggleAllowMonitorProfileSelection(bool)));
1117 }
1118 m_page->chkUseSystemMonitorProfile->setVisible(!m_colorManagedByOS);
1119
1120 m_page->useDefColorSpace->setChecked(cfg.useDefaultColorSpace());
1121 connect(m_page->useDefColorSpace, SIGNAL(toggled(bool)), this, SLOT(toggleUseDefaultColorSpace(bool)));
1123 for (QList<KoID>::iterator id = colorSpaces.begin(); id != colorSpaces.end(); /* nop */) {
1125 id = colorSpaces.erase(id);
1126 } else {
1127 ++id;
1128 }
1129 }
1130 m_page->cmbWorkingColorSpace->setIDList(colorSpaces);
1131 m_page->cmbWorkingColorSpace->setCurrent(cfg.workingColorSpace());
1132 m_page->cmbWorkingColorSpace->setEnabled(cfg.useDefaultColorSpace());
1133
1134 if (!m_colorManagedByOS) {
1135 m_page->bnAddColorProfile->setIcon(koIcon("document-import-16"));
1136 connect(m_page->bnAddColorProfile, SIGNAL(clicked()), SLOT(installProfile()));
1137 }
1138 m_page->bnAddColorProfile->setVisible(!m_colorManagedByOS);
1139
1140 {
1141 QStringList profiles;
1142 QMap<QString, const KoColorProfile *> profileList;
1143 Q_FOREACH(const KoColorProfile *profile, KoColorSpaceRegistry::instance()->profilesFor(RGBAColorModelID.id())) {
1144 profileList[profile->name()] = profile;
1145 profiles.append(profile->name());
1146 }
1147
1148 std::sort(profiles.begin(), profiles.end());
1149 Q_FOREACH (const QString profile, profiles) {
1150 m_page->cmbColorProfileForEXR->addSqueezedItem(profile);
1151 }
1152
1154 const QString defaultProfile = KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(colorSpaceId);
1155 const QString userProfile = cfg.readEntry("ExrDefaultColorProfile", defaultProfile);
1156
1157 m_page->cmbColorProfileForEXR->setCurrent(profiles.contains(userProfile) ? userProfile : defaultProfile);
1158 }
1159
1160
1161 if (!m_colorManagedByOS) {
1162 QFormLayout *monitorProfileGrid = new QFormLayout(m_page->monitorprofileholder);
1163 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1164 for(int i = 0; i < QGuiApplication::screens().count(); ++i) {
1165 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)));
1166 lbl->setWordWrap(true);
1169 cmb->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
1170 monitorProfileGrid->addRow(lbl, cmb);
1172 }
1173
1174 // disable if not Linux as KisColorManager is not yet implemented outside Linux
1175#ifndef Q_OS_LINUX
1176 m_page->chkUseSystemMonitorProfile->setChecked(false);
1177 m_page->chkUseSystemMonitorProfile->setDisabled(true);
1178 m_page->chkUseSystemMonitorProfile->setHidden(true);
1179#endif
1180
1181 refillMonitorProfiles(KoID("RGBA"));
1182
1183 for(int i = 0; i < QApplication::screens().count(); ++i) {
1184 if (m_monitorProfileWidgets[i]->contains(cfg.monitorProfile(i))) {
1185 m_monitorProfileWidgets[i]->setCurrent(cfg.monitorProfile(i));
1186 }
1187 }
1188 } else {
1189 QVBoxLayout *vboxLayout = new QVBoxLayout(m_page->monitorprofileholder);
1190 vboxLayout->setContentsMargins(0, 0, 0, 0);
1191 vboxLayout->addItem(new QSpacerItem(20,20));
1192
1193 QGroupBox *groupBox = new QGroupBox(i18n("Display's color space is managed by the operating system"));
1194 vboxLayout->addWidget(groupBox);
1195
1196 QFormLayout *monitorProfileGrid = new QFormLayout(groupBox);
1197 monitorProfileGrid->setContentsMargins(0, 0, 0, 0);
1198
1200 new QCheckBox(i18n("Enable canvas color management"), this);
1201
1203 i18n("<p>Enabling canvas color management automatically creates "
1204 "a separate native surface for the canvas. It might cause "
1205 "performance issues on some systems.</p>"
1206 ""
1207 "<p>If color management is disabled, Krita will render "
1208 "the canvas into the surface of the main window, which "
1209 "is considered sRGB. It will cause two limitations:"
1210 ""
1211 "<ol>"
1212 " <li>the color gamut will be limited to sRGB</li>"
1213 " <li>color proofing mode will be limited to \"use global display settings\", "
1214 " i.e. paper white proofing will become impossible</li>"
1215 "</ol>"
1216 "</p>"));
1217
1218 monitorProfileGrid->addRow(m_chkEnableCanvasColorSpaceManagement);
1219
1220 // surface color space
1222 m_canvasSurfaceColorSpace->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
1223 QLabel *canvasSurfaceColorSpaceLbl = new QLabel(i18n("Canvas surface color space:"), this);
1224 monitorProfileGrid->addRow(canvasSurfaceColorSpaceLbl, m_canvasSurfaceColorSpace);
1225
1226 m_canvasSurfaceColorSpace->addSqueezedItem(i18n("Preferred by operating system"), QVariant::fromValue(CanvasSurfaceMode::Preferred));
1227 m_canvasSurfaceColorSpace->addSqueezedItem(i18n("Rec 709 Gamma 2.2"), QVariant::fromValue(CanvasSurfaceMode::Rec709g22));
1228 m_canvasSurfaceColorSpace->addSqueezedItem(i18n("Rec 709 Linear"), QVariant::fromValue(CanvasSurfaceMode::Rec709g10));
1229 m_canvasSurfaceColorSpace->addSqueezedItem(i18n("Unmanaged (testing only)"), QVariant::fromValue(CanvasSurfaceMode::Unmanaged));
1230
1231 m_canvasSurfaceColorSpace->setToolTip(
1232 i18n("<p>Color space of the pixels that are transferred to the "
1233 "window compositor. Use \"preferred\" space unless you know "
1234 "what you are doing</p>"));
1235
1236 // surface bit depth
1238 m_canvasSurfaceBitDepth->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
1239 QLabel *canvasSurfaceBitDepthLbl = new QLabel(i18n("Canvas surface bit depth (needs restart):"), this);
1240 monitorProfileGrid->addRow(canvasSurfaceBitDepthLbl, m_canvasSurfaceBitDepth);
1241
1242 m_canvasSurfaceBitDepth->addSqueezedItem(i18n("Auto"), QVariant::fromValue(CanvasSurfaceBitDepthMode::DepthAuto));
1243 m_canvasSurfaceBitDepth->addSqueezedItem(i18n("8-bit"), QVariant::fromValue(CanvasSurfaceBitDepthMode::Depth8Bit));
1244 m_canvasSurfaceBitDepth->addSqueezedItem(i18n("10-bit"), QVariant::fromValue(CanvasSurfaceBitDepthMode::Depth10Bit));
1245
1246 m_canvasSurfaceBitDepth->setToolTip(
1247 i18n("<p>The bit depth of the color that is passed to the window "
1248 "compositor. You should switch into 10-bit mode if you want to use "
1249 "HDR capabilities of your display</p>"));
1250
1251 const QString currentBitBepthString = QSurfaceFormat::defaultFormat().redBufferSize() == 10 ? i18n("10-bit") : i18n("8-bit");
1252 QLabel *currentCanvasSurfaceBitDepthLbl = new QLabel(i18n("Current canvas surface bit depth:"), this);
1253 QLabel *currentCanvasSurfaceBitDepth = new QLabel(currentBitBepthString, this);
1254 monitorProfileGrid->addRow(currentCanvasSurfaceBitDepthLbl, currentCanvasSurfaceBitDepth);
1255
1256 vboxLayout->addItem(new QSpacerItem(20,20));
1257
1259 QLabel *preferredLbl = new QLabel(i18n("Color space preferred by the operating system:\n%1", KisPlatformPluginInterfaceFactory::instance()->osPreferredColorSpaceReport(mainWindow)), this);
1260 vboxLayout->addWidget(preferredLbl);
1261
1262 m_chkEnableCanvasColorSpaceManagement->setChecked(cfg.enableCanvasSurfaceColorSpaceManagement());
1263
1264 {
1265 auto mode = cfg.canvasSurfaceColorSpaceManagementMode();
1266 int index = m_canvasSurfaceColorSpace->findData(QVariant::fromValue(mode));
1267 KIS_SAFE_ASSERT_RECOVER(index >= 0) {
1268 index = 0;
1269 }
1270 m_canvasSurfaceColorSpace->setCurrentIndex(index);
1271 }
1272
1273 {
1274 auto mode = cfg.canvasSurfaceBitDepthMode();
1275 int index = m_canvasSurfaceBitDepth->findData(QVariant::fromValue(mode));
1276 KIS_SAFE_ASSERT_RECOVER(index >= 0) {
1277 index = 0;
1278 }
1279 m_canvasSurfaceBitDepth->setCurrentIndex(index);
1280 }
1281
1282 connect(m_chkEnableCanvasColorSpaceManagement, &QCheckBox::toggled, m_canvasSurfaceColorSpace, &QWidget::setEnabled);
1284
1285 connect(m_chkEnableCanvasColorSpaceManagement, &QCheckBox::toggled, canvasSurfaceColorSpaceLbl, &QWidget::setEnabled);
1286 canvasSurfaceColorSpaceLbl->setEnabled(m_chkEnableCanvasColorSpaceManagement->isChecked());
1287
1288 connect(m_chkEnableCanvasColorSpaceManagement, &QCheckBox::toggled, m_canvasSurfaceBitDepth, &QWidget::setEnabled);
1290
1291 connect(m_chkEnableCanvasColorSpaceManagement, &QCheckBox::toggled, canvasSurfaceBitDepthLbl, &QWidget::setEnabled);
1292 canvasSurfaceBitDepthLbl->setEnabled(m_chkEnableCanvasColorSpaceManagement->isChecked());
1293 }
1294
1295 m_page->chkBlackpoint->setChecked(cfg.useBlackPointCompensation());
1296 m_page->chkAllowLCMSOptimization->setChecked(cfg.allowLCMSOptimization());
1297 m_page->chkForcePaletteColor->setChecked(cfg.forcePaletteColors());
1298 m_page->cmbMonitorIntent->setCurrentIndex(cfg.monitorRenderIntent());
1299 KisImageConfig cfgImage(true);
1300
1304 KisProofingConfigurationSP proofingConfig = cfgImage.defaultProofingconfiguration();
1305
1306 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1307
1308 m_proofModel->data.set(*proofingConfig.data());
1309
1310 connect(m_page->chkBlackpoint, SIGNAL(toggled(bool)), this, SLOT(updateProofingDisplayInfo()));
1311 connect(m_page->cmbMonitorIntent, SIGNAL(currentIndexChanged(int)), this, SLOT(updateProofingDisplayInfo()));
1313
1316 m_pasteBehaviourGroup.addButton(m_page->radioPasteAsk, KisClipboard::PASTE_ASK);
1317
1318 QAbstractButton *button = m_pasteBehaviourGroup.button(cfg.pasteBehaviour());
1319 Q_ASSERT(button);
1320
1321 if (button) {
1322 button->setChecked(true);
1323 }
1324
1325 if (!m_colorManagedByOS) {
1326 toggleAllowMonitorProfileSelection(cfg.useSystemMonitorProfile());
1327 }
1328}
const KoID AlphaColorModelID("A", ki18n("Alpha mask"))
const KoID Float16BitsColorDepthID("F16", ki18n("16-bit float/channel"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
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:483
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(), connect(), 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 1330 of file kis_dlg_preferences.cc.

1331{
1333
1334 KoFileDialog dialog(this, KoFileDialog::OpenFiles, "OpenDocumentICC");
1335 dialog.setCaption(i18n("Install Color Profiles"));
1336 dialog.setDefaultDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
1337 dialog.setMimeTypeFilters(QStringList() << "application/vnd.iccprofile", "application/vnd.iccprofile");
1338 QStringList profileNames = dialog.filenames();
1339
1341 Q_ASSERT(iccEngine);
1342
1343 QString saveLocation = KoResourcePaths::saveLocation("icc_profiles");
1344
1345 Q_FOREACH (const QString &profileName, profileNames) {
1346 if (!QFile::copy(profileName, saveLocation + QFileInfo(profileName).fileName())) {
1347 qWarning() << "Could not install profile!" << saveLocation + QFileInfo(profileName).fileName();
1348 continue;
1349 }
1350 iccEngine->addProfile(saveLocation + QFileInfo(profileName).fileName());
1351 }
1352
1353 KisConfig cfg(true);
1354 refillMonitorProfiles(KoID("RGBA"));
1355
1356 for(int i = 0; i < QApplication::screens().count(); ++i) {
1357 if (m_monitorProfileWidgets[i]->contains(cfg.monitorProfile(i))) {
1358 m_monitorProfileWidgets[i]->setCurrent(cfg.monitorProfile(i));
1359 }
1360 }
1361
1362}
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 1455 of file kis_dlg_preferences.cc.

1456{
1458
1459 for (int i = 0; i < QApplication::screens().count(); ++i) {
1460 m_monitorProfileWidgets[i]->clear();
1461 }
1462
1463 QMap<QString, const KoColorProfile *> profileList;
1464 Q_FOREACH(const KoColorProfile *profile, KoColorSpaceRegistry::instance()->profilesFor(colorSpaceId.id())) {
1465 profileList[profile->name()] = profile;
1466 }
1467
1468 Q_FOREACH (const KoColorProfile *profile, profileList.values()) {
1469 //qDebug() << "Profile" << profile->name() << profile->isSuitableForDisplay() << csf->defaultProfile();
1470 if (profile->isSuitableForDisplay()) {
1471 for (int i = 0; i < QApplication::screens().count(); ++i) {
1472 m_monitorProfileWidgets[i]->addSqueezedItem(profile->name());
1473 }
1474 }
1475 }
1476
1477 for (int i = 0; i < QApplication::screens().count(); ++i) {
1478 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)));
1480 }
1481}
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 1402 of file kis_dlg_preferences.cc.

1403{
1404 m_page->cmbWorkingColorSpace->setCurrent("RGBA");
1405
1407 const QString defaultProfile = KoColorSpaceRegistry::instance()->defaultProfileForColorSpace(colorSpaceId);
1408 m_page->cmbColorProfileForEXR->setCurrent(defaultProfile);
1409
1410 KisConfig cfg(true);
1411
1412 if (!m_colorManagedByOS) {
1413 refillMonitorProfiles(KoID("RGBA"));
1414 } else {
1415 m_chkEnableCanvasColorSpaceManagement->setChecked(cfg.enableCanvasSurfaceColorSpaceManagement(true));
1416
1417 {
1418 auto mode = cfg.canvasSurfaceColorSpaceManagementMode(true);
1419 int index = m_canvasSurfaceColorSpace->findData(QVariant::fromValue(mode));
1420 KIS_SAFE_ASSERT_RECOVER(index >= 0) {
1421 index = 0;
1422 }
1423 m_canvasSurfaceColorSpace->setCurrentIndex(index);
1424 }
1425
1426 {
1427 auto mode = cfg.canvasSurfaceBitDepthMode(true);
1428 int index = m_canvasSurfaceBitDepth->findData(QVariant::fromValue(mode));
1429 KIS_SAFE_ASSERT_RECOVER(index >= 0) {
1430 index = 0;
1431 }
1432 m_canvasSurfaceBitDepth->setCurrentIndex(index);
1433 }
1434 }
1435
1436 KisImageConfig cfgImage(true);
1437 KisProofingConfigurationSP proofingConfig = cfgImage.defaultProofingconfiguration(true);
1438 m_page->wdgProofingOptions->setProofingConfig(proofingConfig);
1439
1440 m_page->chkBlackpoint->setChecked(cfg.useBlackPointCompensation(true));
1441 m_page->chkAllowLCMSOptimization->setChecked(cfg.allowLCMSOptimization(true));
1442 m_page->chkForcePaletteColor->setChecked(cfg.forcePaletteColors(true));
1443 m_page->cmbMonitorIntent->setCurrentIndex(cfg.monitorRenderIntent(true));
1444 if (!m_colorManagedByOS) {
1445 m_page->chkUseSystemMonitorProfile->setChecked(cfg.useSystemMonitorProfile(true));
1446 }
1447 QAbstractButton *button = m_pasteBehaviourGroup.button(cfg.pasteBehaviour(true));
1448 Q_ASSERT(button);
1449 if (button) {
1450 button->setChecked(true);
1451 }
1452}

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 1364 of file kis_dlg_preferences.cc.

1365{
1367
1368 KisConfig cfg(true);
1369
1370 if (useSystemProfile) {
1372 if (devices.size() == QApplication::screens().count()) {
1373 for(int i = 0; i < QApplication::screens().count(); ++i) {
1374 m_monitorProfileWidgets[i]->clear();
1375 QString monitorForScreen = cfg.monitorForScreen(i, devices[i]);
1376 Q_FOREACH (const QString &device, devices) {
1377 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)));
1378 m_monitorProfileWidgets[i]->addSqueezedItem(KisColorManager::instance()->deviceName(device), device);
1379 if (devices[i] == monitorForScreen) {
1380 m_monitorProfileWidgets[i]->setCurrentIndex(i);
1381 }
1382 }
1383 }
1384 }
1385 }
1386 else {
1387 refillMonitorProfiles(KoID("RGBA"));
1388
1389 for(int i = 0; i < QApplication::screens().count(); ++i) {
1390 if (m_monitorProfileWidgets[i]->contains(cfg.monitorProfile(i))) {
1391 m_monitorProfileWidgets[i]->setCurrent(cfg.monitorProfile(i));
1392 }
1393 }
1394 }
1395}
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 1397 of file kis_dlg_preferences.cc.

1398{
1399 m_page->cmbWorkingColorSpace->setEnabled(useDefColorSpace);
1400}

References m_page.

◆ updateProofingDisplayInfo

void ColorSettingsTab::updateProofingDisplayInfo ( )
privateslot

Definition at line 1483 of file kis_dlg_preferences.cc.

1483 {
1485 options.first = KoColorConversionTransformation::Intent(m_page->cmbMonitorIntent->currentIndex());
1487 options.second.setFlag(KoColorConversionTransformation::BlackpointCompensation, m_page->chkBlackpoint->isChecked());
1488 m_page->wdgProofingOptions->setDisplayConfigOptions(options);
1489}
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 206 of file kis_dlg_preferences.h.

◆ m_canvasSurfaceColorSpace

QPointer<KisSqueezedComboBox> ColorSettingsTab::m_canvasSurfaceColorSpace

Definition at line 205 of file kis_dlg_preferences.h.

◆ m_chkEnableCanvasColorSpaceManagement

QPointer<QCheckBox> ColorSettingsTab::m_chkEnableCanvasColorSpaceManagement

Definition at line 204 of file kis_dlg_preferences.h.

◆ m_colorManagedByOS

bool ColorSettingsTab::m_colorManagedByOS {false}

Definition at line 203 of file kis_dlg_preferences.h.

203{false};

◆ m_monitorProfileLabels

QList<QLabel*> ColorSettingsTab::m_monitorProfileLabels

Definition at line 196 of file kis_dlg_preferences.h.

◆ m_monitorProfileWidgets

QList<KisSqueezedComboBox*> ColorSettingsTab::m_monitorProfileWidgets

Definition at line 197 of file kis_dlg_preferences.h.

◆ m_page

WdgColorSettings* ColorSettingsTab::m_page

Definition at line 194 of file kis_dlg_preferences.h.

◆ m_pasteBehaviourGroup

QButtonGroup ColorSettingsTab::m_pasteBehaviourGroup

Definition at line 195 of file kis_dlg_preferences.h.

◆ m_proofModel

QScopedPointer<KisProofingConfigModel> ColorSettingsTab::m_proofModel

Definition at line 198 of file kis_dlg_preferences.h.


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