]> git.sesse.net Git - kdenlive/blobdiff - src/choosecolorwidget.cpp
Several small adjustments for monitor switching
[kdenlive] / src / choosecolorwidget.cpp
index e65a8defb292462b99526690d09770d31e6d589e..1b81ca3123536d11f667a43adeaa75d088df1299 100644 (file)
@@ -22,8 +22,7 @@
 #include "colorpickerwidget.h"
 
 #include <QLabel>
-#include <QVBoxLayout>
-#include <QGroupBox>
+#include <QHBoxLayout>
 
 #include <KColorButton>
 #include <KLocalizedString>
 ChooseColorWidget::ChooseColorWidget(QString text, QColor color, QWidget *parent) :
         QWidget(parent)
 {
-    //QGroupBox *box = new QGroupBox(text, this);
-    QVBoxLayout *layout = new QVBoxLayout(this);
+    QHBoxLayout *layout = new QHBoxLayout(this);
+    layout->setContentsMargins(0, 0, 0, 0);
+    layout->setSpacing(0);
 
+    QLabel *label = new QLabel(text, this);
     m_button = new KColorButton(color, this);
+    m_button->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
     ColorPickerWidget *picker = new ColorPickerWidget(this);
 
+    layout->addWidget(label);
     layout->addWidget(m_button);
-    layout->addWidget(picker);
+    layout->addWidget(picker, 0, Qt::AlignRight);
 
     connect(picker, SIGNAL(colorPicked(QColor)), this, SLOT(setColor(QColor)));
-    connect(m_button, SIGNAL(clicked(bool)), this, SIGNAL(modified()));
+    connect(picker, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
+    connect(m_button, SIGNAL(changed(QColor)), this, SIGNAL(modified()));
 }
 
 QColor ChooseColorWidget::getColor()
@@ -53,7 +57,6 @@ QColor ChooseColorWidget::getColor()
 void ChooseColorWidget::setColor(QColor color)
 {
     m_button->setColor(color);
-    emit modified();
 }
 
 #include "choosecolorwidget.moc"