[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/calligra/2.9] krita/plugins/extensions/dockers/specificcolorselector: Calculate the
From:       Moritz Molch <kde () moritzmolch ! de>
Date:       2015-04-30 21:10:15
Message-ID: E1Ynvip-0005lM-81 () scm ! kde ! org
[Download RAW message or body]

Git commit 9d111c3d9719bc93534dcef83368e8a55f2f0059 by Moritz Molch.
Committed on 30/04/2015 at 21:10.
Pushed by mmolch into branch 'calligra/2.9'.

Calculate the label's width in the specific color selector dock instead
of using a fixed value

M  +0    -1    krita/plugins/extensions/dockers/specificcolorselector/kis_color_input.cc
 M  +15   -0    krita/plugins/extensions/dockers/specificcolorselector/kis_specific_color_selector_widget.cc


http://commits.kde.org/calligra/9d111c3d9719bc93534dcef83368e8a55f2f0059

diff --git a/krita/plugins/extensions/dockers/specificcolorselector/kis_color_input.cc \
b/krita/plugins/extensions/dockers/specificcolorselector/kis_color_input.cc index \
                3dbf3da..43cb428 100644
--- a/krita/plugins/extensions/dockers/specificcolorselector/kis_color_input.cc
+++ b/krita/plugins/extensions/dockers/specificcolorselector/kis_color_input.cc
@@ -51,7 +51,6 @@ void KisColorInput::init()
     m_layout->setSpacing(1);
 
     QLabel* m_label = new QLabel(i18n("%1:", m_channelInfo->name()), this);
-    m_label->setMinimumWidth(50);
     m_layout->addWidget(m_label);
 
     m_colorSlider = new KoColorSlider(Qt::Horizontal, this, m_displayRenderer);
diff --git a/krita/plugins/extensions/dockers/specificcolorselector/kis_specific_color_selector_widget.cc \
b/krita/plugins/extensions/dockers/specificcolorselector/kis_specific_color_selector_widget.cc
 index 81a97d4..ea89c00 100644
--- a/krita/plugins/extensions/dockers/specificcolorselector/kis_specific_color_selector_widget.cc
                
+++ b/krita/plugins/extensions/dockers/specificcolorselector/kis_specific_color_selector_widget.cc
 @@ -141,6 +141,21 @@ void KisSpecificColorSelectorWidget::setColorSpace(const \
KoColorSpace* cs)  }
         }
     }
+
+    QList<QLabel*> labels;
+    int labelWidth = 0;
+
+    Q_FOREACH (KisColorInput* input, m_inputs) {
+        Q_FOREACH (QLabel* label, input->findChildren<QLabel*>()) {
+            labels.append(label);
+            labelWidth = qMax(labelWidth, label->sizeHint().width());
+        }
+    }
+
+    Q_FOREACH (QLabel *label, labels) {
+        label->setMinimumWidth(labelWidth);
+    }
+
     bool allChannels8Bit = true;
     foreach (KoChannelInfo* channel, channels) {
         if (channel->channelType() == KoChannelInfo::COLOR && \
channel->channelValueType() != KoChannelInfo::UINT8) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic