Commit 9ca78c50 authored by Halla Rempt's avatar Halla Rempt
Browse files

Give guidance about the scaling filters to be selected

BUG:135902
parent dff1cb27
......@@ -61,7 +61,7 @@ DlgImageSize::DlgImageSize(QWidget *parent, int width, int height, double resolu
m_page->cmbFilterType->setIDList(KisFilterStrategyRegistry::instance()->listKeys());
m_page->cmbFilterType->setCurrent("Bicubic");
slotUpdateInterpolationGuidance(KoID("Bicubic"));
m_page->cmbWidthUnit->addItems(KoUnit::listOfUnitNameForUi(KoUnit::HidePixel));
m_page->cmbHeightUnit->addItems(KoUnit::listOfUnitNameForUi(KoUnit::HidePixel));
......@@ -134,6 +134,8 @@ DlgImageSize::DlgImageSize(QWidget *parent, int width, int height, double resolu
connect(m_page->doubleResolution, SIGNAL(valueChanged(double)),
this, SLOT(slotResolutionChanged(double)));
connect(m_page->cmbFilterType, SIGNAL(activated(KoID)), SLOT(slotUpdateInterpolationGuidance(KoID)));
slotProtectChanged();
#ifdef __GNUC__
......@@ -397,6 +399,26 @@ void DlgImageSize::slotResolutionChanged(double r)
unblockAll();
}
void DlgImageSize::slotUpdateInterpolationGuidance(const KoID &id)
{
if (id.id() == "Mitchell") {
m_page->lblInterpolationGuidance->setText(i18n("Mitchell: No guidance available"));
} else if (id.id() == "Lanczos3") {
m_page->lblInterpolationGuidance->setText(i18n("Lanczos: No guidance available"));
} else if (id.id() == "BSpline") {
m_page->lblInterpolationGuidance->setText(i18n("BSpline: No guidance available"));
} else if (id.id() == "Bell") {
m_page->lblInterpolationGuidance->setText(i18n("Bell: No guidance available"));
} else if (id.id() == "Box") {
m_page->lblInterpolationGuidance->setText(i18n("Box: replicate pixels exactly. Only useful for upscaling when doubling the size."));
} else if (id.id() == "Bicubic") {
m_page->lblInterpolationGuidance->setText(i18n("Bicubic: slow and slightly fuzzy. Best for natural images."));
} else if (id.id() == "Bilinear") {
m_page->lblInterpolationGuidance->setText(i18n("Bilinear: good for up and downscaling, but only between 50% to 200%."));
}
}
void DlgImageSize::slotProtectChanged()
{
m_page->labelWidth->setEnabled(!m_page->lock_pixel->isLocked());
......
......@@ -74,7 +74,7 @@ private slots:
void slotProtectChanged();
void slotAspectChanged(bool keep);
void slotResolutionChanged(double r);
void slotUpdateInterpolationGuidance(const KoID &id);
private:
void blockAll();
......
......@@ -17,6 +17,90 @@
<item row="0" column="0">
<widget class="MultiLockButton" name="lock_pixel" native="true"/>
</item>
<item row="4" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Resolution</string>
</property>
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<spacer name="spacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="3">
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>181</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelResolution">
<property name="text">
<string>Resolution:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="doubleResolution">
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximum">
<double>100000000.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="labelResolutionUnit">
<property name="text">
<string>pixels/inch</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QGroupBox" name="groupPixelSize">
<property name="title">
......@@ -200,10 +284,10 @@
</layout>
</widget>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="MultiLockButton" name="lock_print" native="true"/>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QGroupBox" name="groupPhysicalsize">
<property name="title">
<string>Print Size</string>
......@@ -322,93 +406,16 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="MultiLockButton" name="lock_resolution" native="true"/>
</item>
<item row="2" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Resolution</string>
</property>
<property name="flat">
<bool>true</bool>
<item row="1" column="1">
<widget class="QLabel" name="lblInterpolationGuidance">
<property name="text">
<string>TextLabel</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<spacer name="spacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="3">
<spacer name="spacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>181</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelResolution">
<property name="text">
<string>Resolution:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="doubleResolution">
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximum">
<double>100000000.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="labelResolutionUnit">
<property name="text">
<string>pixels/inch</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
......
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