Commit b76047f5 authored by Karol Bieńkowski's avatar Karol Bieńkowski Committed by Nate Graham
Browse files

Make using monitor color profile optional

Summary: BUG: 401154

Reviewers: #gwenview, #vdg, ngraham

Reviewed By: #gwenview, #vdg, ngraham

Subscribers: ngraham

Tags: #gwenview

Differential Revision: https://phabricator.kde.org/D28918
parent cf01301b
......@@ -6,21 +6,20 @@
<rect>
<x>0</x>
<y>0</y>
<width>482</width>
<height>300</height>
<width>451</width>
<height>439</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Thumbnails:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0,0,0,0,0,0,0,0">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
......@@ -45,16 +44,98 @@
</item>
</layout>
</item>
<item row="7" column="0" colspan="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="cacheHelpLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Enable this option if you do not have a lot of disk space. This will avoid storing thumbnails on disk and will prefer embedded thumbnails of lower quality that are faster to load, if available.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Thumbnails:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLabel" name="relativeHelpLabel">
<property name="text">
<string>Enable this option if you do not have a lot of disk space. This will avoid storing thumbnails on disk and will prefer embedded thumbnails of lower quality that are faster to load, if available.</string>
<string>Squash colors that don't fit within the active color profile's color gamut, leaving other colors untouched</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>History:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QRadioButton" name="relativeRenderingIntentRadioButton">
<property name="text">
<string comment="@option:Relative Colorimetric rendering intent">Relative Colorimetric</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="10" column="0" colspan="2">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<spacer name="verticalSpacer_1">
<property name="orientation">
......@@ -71,14 +152,41 @@
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QRadioButton" name="perceptualRenderingIntentRadioButton">
<property name="text">
<string comment="@option:Perceptual rendering intent">Perceptual</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="1">
<widget class="QLabel" name="perceptualHelpLabel">
<property name="text">
<string>History:</string>
<string>Scale all colors equally to fit them within the active color profile's color gamut</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="colorRenderingLabel">
<property name="text">
<string>Rendering intent:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>relativeRenderingIntentRadioButton</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
......@@ -121,95 +229,55 @@
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QLabel" name="colorRenderingLabel">
<property name="text">
<string>Rendering intent:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>relativeRenderingIntentRadioButton</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item row="11" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QRadioButton" name="perceptualRenderingIntentRadioButton">
<widget class="QCheckBox" name="kcfg_NoMonitorICC">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string comment="@option:Perceptual rendering intent">Perceptual</string>
<string>Apply only the profile embedded in the image file</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="6" column="1">
<widget class="QLabel" name="perceptualHelpLabel">
<property name="text">
<string>Scale all colors equally to fit them within the active color profile's color gamut</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QRadioButton" name="relativeRenderingIntentRadioButton">
<property name="text">
<string comment="@option:Relative Colorimetric rendering intent">Relative Colorimetric</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="9" column="1">
<widget class="QLabel" name="relativeHelpLabel">
<property name="text">
<string>Squash colors that don't fit within the active color profile's color gamut, leaving other colors untouched</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="10" column="1">
<spacer name="verticalSpacer_7">
<property name="orientation">
<enum>Qt::Vertical</enum>
</item>
<item row="12" column="1">
<widget class="QLabel" name="colorProfileHelpLabel">
<property name="text">
<string>Assume that system-wide color correction already applies monitor profile.</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
<property name="wordWrap">
<bool>true</bool>
</property>
</spacer>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="colorProfileLabel">
<property name="text">
<string>Color profile:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
......
......@@ -115,6 +115,8 @@ ConfigDialog::ConfigDialog(QWidget* parent)
mAdvancedConfigPage.cacheHelpLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
mAdvancedConfigPage.perceptualHelpLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
mAdvancedConfigPage.relativeHelpLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
mAdvancedConfigPage.colorProfileHelpLabel->setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
updateViewBackgroundFrame();
}
......
......@@ -53,6 +53,9 @@ extern "C" {
#include <QtX11Extras/QX11Info>
#endif
// local
#include <lib/gwenviewconfig.h>
namespace Gwenview
{
......@@ -215,7 +218,7 @@ Profile::Ptr Profile::getMonitorProfile()
// Get the profile from you config file if the user has set it.
// if the user allows override through the atom, do this:
#ifdef HAVE_X11
if (QX11Info::isPlatformX11()) {
if (QX11Info::isPlatformX11() && !GwenviewConfig::noMonitorICC()) {
// get the current screen...
int screen = -1;
......
......@@ -246,6 +246,12 @@ void RasterImageView::setRenderingIntent(const RenderingIntent::Enum& renderingI
}
}
void RasterImageView::resetMonitorICC()
{
d->mApplyDisplayTransform = true;
updateBuffer();
}
void RasterImageView::loadFromDocument()
{
Document::Ptr doc = document();
......
......@@ -52,6 +52,7 @@ public:
void setAlphaBackgroundMode(AlphaBackgroundMode mode) override;
void setAlphaBackgroundColor(const QColor& color) override;
void setRenderingIntent(const RenderingIntent::Enum& renderingIntent);
void resetMonitorICC();
Q_SIGNALS:
void currentToolChanged(AbstractRasterImageViewTool*);
......
......@@ -140,6 +140,7 @@ void RasterImageViewAdapter::loadConfig()
d->mView->setAlphaBackgroundColor(GwenviewConfig::alphaBackgroundColor());
d->mView->setRenderingIntent(GwenviewConfig::renderingIntent());
d->mView->setEnlargeSmallerImages(GwenviewConfig::enlargeSmallerImages());
d->mView->resetMonitorICC();
}
RasterImageView* RasterImageViewAdapter::rasterImageView() const
......
......@@ -199,6 +199,10 @@
display's capabilities. "Relative" will squash only the colors
that cannot be displayed, and leave the other colors alone.</whatsthis>
</entry>
<entry name="NoMonitorICC" type="Bool">
<default>true</default>
</entry>
</group>
<group name="ThumbnailView">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment