Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Move the color volume presets around and use explicit apply preset button.

Wolthera van Hövell tot Westerflier810aa8628915
diff --git a/libs/ui/dialogs/kis_dlg_image_properties.cc b/libs/ui/dialogs/kis_dlg_image_properties.cc
index 3d2e2e5f05..6757fb8c61 100644
--- a/libs/ui/dialogs/kis_dlg_image_properties.cc
+++ b/libs/ui/dialogs/kis_dlg_image_properties.cc
@@ -7,6 +7,7 @@
#include "kis_dlg_image_properties.h"
#include <QLabel>
+#include <QPushButton>
#include <klocalizedstring.h>
@@ -161,7 +162,7 @@ KisDlgImageProperties::KisDlgImageProperties(KisImageWSP image, KisDisplayColorC
KisWidgetConnectionUtils::connectControlState( m_page->spnBlueY, &d->hdrMetadataModel, "cviBlueYState", "cviBlueY");
KisWidgetConnectionUtils::connectControlState( m_page->spnMinLuminance, &d->hdrMetadataModel, "cviMinLuminanceState", "cviMinLuminance");
KisWidgetConnectionUtils::connectControlState( m_page->spnMaxLuminance, &d->hdrMetadataModel, "cviMaxLuminanceState", "cviMaxLuminance");
- connect(m_page->cmbColorVolumePresets, SIGNAL(activated(int)), this, SLOT(changeColorVolumePreset()));
+ connect(m_page->btnApplyColorVolumePreset, &QPushButton::clicked, this, &KisDlgImageProperties::changeColorVolumePreset);
const bool hdr = (d->image->colorSpace()->hasHighDynamicRange()
|| d->image->colorSpace()->profile()->getTransferCharacteristics() == TRC_ITU_R_BT_2100_0_PQ);
diff --git a/libs/ui/forms/wdgimageproperties.ui b/libs/ui/forms/wdgimageproperties.ui
index 37e52cb8ea..9a2f8140f0 100644
--- a/libs/ui/forms/wdgimageproperties.ui
+++ b/libs/ui/forms/wdgimageproperties.ui
@@ -410,15 +410,19 @@
<bool>false</bool>
</property>
<layout class="QFormLayout" name="formLayout_2">
- <item row="0" column="0">
- <widget class="QLabel" name="label_5">
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_12">
<property name="text">
- <string>Preset:</string>
+ <string>Maximum Luminance:</string>
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QComboBox" name="cmbColorVolumePresets"/>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_13">
+ <property name="text">
+ <string>Minimum Luminance:</string>
+ </property>
+ </widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spnMaxLuminance">
@@ -436,7 +440,7 @@
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="4" column="1">
<widget class="QDoubleSpinBox" name="spnMinLuminance">
<property name="suffix">
<string>cd/m²</string>
@@ -449,10 +453,38 @@
</property>
</widget>
</item>
- <item row="1" column="0" colspan="2">
+ <item row="5" column="0" colspan="2">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Preset:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="cmbColorVolumePresets">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="btnApplyColorVolumePreset">
+ <property name="text">
+ <string>Apply Preset</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="0" colspan="2">
<layout class="QGridLayout" name="gridLayout_2">
- <item row="3" column="1">
- <widget class="QDoubleSpinBox" name="spnGreenX">
+ <item row="4" column="2">
+ <widget class="QDoubleSpinBox" name="spnBlueY">
<property name="decimals">
<number>6</number>
</property>
@@ -464,8 +496,8 @@
</property>
</widget>
</item>
- <item row="4" column="2">
- <widget class="QDoubleSpinBox" name="spnBlueY">
+ <item row="2" column="2">
+ <widget class="QDoubleSpinBox" name="spnRedY">
<property name="decimals">
<number>6</number>
</property>
@@ -477,8 +509,15 @@
</property>
</widget>
</item>
- <item row="1" column="1">
- <widget class="QDoubleSpinBox" name="spnWhiteX">
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_10">
+ <property name="text">
+ <string>Green:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QDoubleSpinBox" name="spnGreenX">
<property name="decimals">
<number>6</number>
</property>
@@ -490,8 +529,8 @@
</property>
</widget>
</item>
- <item row="1" column="2">
- <widget class="QDoubleSpinBox" name="spnWhiteY">
+ <item row="1" column="1">
+ <widget class="QDoubleSpinBox" name="spnWhiteX">
<property name="decimals">
<number>6</number>
</property>
@@ -503,8 +542,8 @@
</property>
</widget>
</item>
- <item row="2" column="2">
- <widget class="QDoubleSpinBox" name="spnRedY">
+ <item row="4" column="1">
+ <widget class="QDoubleSpinBox" name="spnBlueX">
<property name="decimals">
<number>6</number>
</property>
@@ -516,6 +555,13 @@
</property>
</widget>
</item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_11">
+ <property name="text">
+ <string>Blue:</string>
+ </property>
+ </widget>
+ </item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="spnRedX">
<property name="decimals">
@@ -536,6 +582,13 @@
</property>
</widget>
</item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>Red:</string>
+ </property>
+ </widget>
+ </item>
<item row="0" column="2">
<widget class="QLabel" name="label_7">
<property name="text">
@@ -543,8 +596,8 @@
</property>
</widget>
</item>
- <item row="4" column="1">
- <widget class="QDoubleSpinBox" name="spnBlueX">
+ <item row="3" column="2">
+ <widget class="QDoubleSpinBox" name="spnGreenY">
<property name="decimals">
<number>6</number>
</property>
@@ -556,8 +609,8 @@
</property>
</widget>
</item>
- <item row="3" column="2">
- <widget class="QDoubleSpinBox" name="spnGreenY">
+ <item row="1" column="2">
+ <widget class="QDoubleSpinBox" name="spnWhiteY">
<property name="decimals">
<number>6</number>
</property>
@@ -576,43 +629,8 @@
</property>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string>Red:</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_10">
- <property name="text">
- <string>Green:</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_11">
- <property name="text">
- <string>Blue:</string>
- </property>
- </widget>
- </item>
</layout>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="label_12">
- <property name="text">
- <string>Maximum Luminance:</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0">
- <widget class="QLabel" name="label_13">
- <property name="text">
- <string>Minimum Luminance:</string>
- </property>
- </widget>
- </item>
</layout>
</widget>
</item>