Commit 525da2ea authored by Boudewijn Rempt's avatar Boudewijn Rempt

Fix displaying the levels histogram

There were some weird things wrong with the layout of the dialog,
and for some reason, some hard-coded sizes coupled with hard-coded
cutting off from the histogram pixmap.

BUG:376048
parent 07eb5507
......@@ -141,10 +141,10 @@ KisLevelConfigWidget::KisLevelConfigWidget(QWidget * parent, KisPaintDeviceSP de
KoHistogramProducer *producer = new KoGenericLabHistogramProducer();
m_histogram.reset( new KisHistogram(dev, dev->exactBounds(), producer, LINEAR) );
m_histlog = false;
m_page.histview->resize(288,100);
m_isLogarithmic = false;
//m_page.histview->resize(288,100);
m_inverted = false;
slotDrawHistogram();
slotDrawHistogram(m_page.chkLogarithmic->isChecked());
}
......@@ -152,23 +152,23 @@ KisLevelConfigWidget::~KisLevelConfigWidget()
{
}
void KisLevelConfigWidget::slotDrawHistogram(bool logarithmic)
void KisLevelConfigWidget::slotDrawHistogram(bool isLogarithmic)
{
int wHeight = m_page.histview->height();
int wHeightMinusOne = wHeight - 1;
int wWidth = m_page.histview->width();
if (m_histlog != logarithmic) {
if (m_isLogarithmic != isLogarithmic) {
// Update the m_histogram
if (logarithmic)
if (isLogarithmic)
m_histogram->setHistogramType(LOGARITHMIC);
else
m_histogram->setHistogramType(LINEAR);
m_histlog = logarithmic;
m_isLogarithmic = isLogarithmic;
}
QPalette appPalette = QApplication::palette();
QPixmap pix(wWidth-100, wHeight);
QPixmap pix(wWidth, wHeight);
pix.fill(QColor(appPalette.color(QPalette::Base)));
QPainter p(&pix);
......
......@@ -67,7 +67,7 @@ public:
Ui::WdgLevel m_page;
protected Q_SLOTS:
void slotDrawHistogram(bool logarithmic = false);
void slotDrawHistogram(bool isLogarithmic);
void slotModifyInBlackLimit(int);
void slotModifyInWhiteLimit(int);
......@@ -81,7 +81,7 @@ protected Q_SLOTS:
protected:
QScopedPointer<KisHistogram> m_histogram;
bool m_histlog;
bool m_isLogarithmic;
bool m_inverted;
};
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>263</width>
<height>344</height>
<width>274</width>
<height>350</height>
</rect>
</property>
<property name="sizePolicy">
......@@ -31,7 +31,7 @@
<property name="windowTitle">
<string>Levels</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
......@@ -44,7 +44,7 @@
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="textLabel2">
......@@ -68,7 +68,7 @@
</item>
</layout>
</item>
<item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
......@@ -115,7 +115,7 @@
</item>
</layout>
</item>
<item>
<item row="2" column="0">
<widget class="KisGradientSlider" name="ingradient" native="true">
<property name="minimumSize">
<size>
......@@ -125,7 +125,7 @@
</property>
</widget>
</item>
<item>
<item row="3" column="0">
<layout class="QHBoxLayout">
<item>
<widget class="KisIntParseSpinBox" name="blackspin">
......@@ -203,7 +203,7 @@
</item>
</layout>
</item>
<item>
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -219,7 +219,7 @@
</property>
</spacer>
</item>
<item>
<item row="5" column="0">
<widget class="QLabel" name="textLabel3">
<property name="text">
<string>&lt;b&gt;Output Levels&lt;/b&gt;</string>
......@@ -229,7 +229,7 @@
</property>
</widget>
</item>
<item>
<item row="6" column="0">
<widget class="KisGradientSlider" name="outgradient" native="true">
<property name="minimumSize">
<size>
......@@ -239,7 +239,7 @@
</property>
</widget>
</item>
<item>
<item row="7" column="0">
<layout class="QHBoxLayout">
<item>
<widget class="KisIntParseSpinBox" name="outblackspin">
......@@ -279,7 +279,7 @@
</item>
</layout>
</item>
<item>
<item row="8" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QPushButton" name="butauto">
......@@ -310,7 +310,7 @@
</item>
</layout>
</item>
<item>
<item row="9" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
......
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