Commit d635b53e authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Make the UI layout of the internal color selector a little nicer.

Ref T2438
parent cf7c567a
......@@ -108,10 +108,8 @@ KisInternalColorSelector::KisInternalColorSelector(QWidget *parent, KoColor colo
if (config.prevNextButtons) {
m_ui->currentColor->setColor(m_d->currentColor);
m_ui->currentColor->setDisplayRenderer(displayRenderer);
m_ui->currentColor->setFrameStyle(QFrame::StyledPanel);
m_ui->previousColor->setColor(m_d->currentColor);
m_ui->previousColor->setDisplayRenderer(displayRenderer);
m_ui->previousColor->setFrameStyle(QFrame::StyledPanel);
connect(this, SIGNAL(accepted()), this, SLOT(setPreviousColor()));
connect(m_ui->previousColor, SIGNAL(triggered(KoColorPatch*)), SLOT(slotSetColorFromPatch(KoColorPatch*)));
} else {
......@@ -124,7 +122,7 @@ KisInternalColorSelector::KisInternalColorSelector(QWidget *parent, KoColor colo
m_d->hexColorInput = new KisHexColorInput(this, &m_d->sRGB);
m_d->hexColorInput->update();
connect(m_d->hexColorInput, SIGNAL(updated()), SLOT(slotSetColorFromHex()));
m_ui->leftPane->addWidget(m_d->hexColorInput);
m_ui->rightPane->addWidget(m_d->hexColorInput);
m_d->hexColorInput->setToolTip(i18n("This is a hexcode input, for webcolors. It can only get colors in the sRGB space."));
}
......@@ -256,9 +254,9 @@ void KisInternalColorSelector::endUpdateWithNewColor()
m_d->allowUpdates = true;
}
void KisInternalColorSelector::focusInEvent(QFocusEvent *e)
void KisInternalColorSelector::focusInEvent(QFocusEvent *)
{
setPreviousColor();
//setPreviousColor();
}
void KisInternalColorSelector::slotSetColorFromPatch(KoColorPatch* patch)
......
......@@ -165,7 +165,7 @@ private:
*/
void updateAllElements(QObject *source);
virtual void focusInEvent(QFocusEvent *e);
virtual void focusInEvent(QFocusEvent *);
};
#endif // KISINTERNALCOLORSELECTOR_H
......@@ -28,8 +28,8 @@
</property>
<property name="minimumSize">
<size>
<width>55</width>
<height>50</height>
<width>90</width>
<height>90</height>
</size>
</property>
</widget>
......@@ -37,19 +37,39 @@
<item>
<widget class="KisSpinboxColorSelector" name="spinboxselector" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="rightPane">
<widget class="QFrame" name="">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="midLineWidth">
<number>2</number>
</property>
<layout class="QHBoxLayout" name="nextprevlayout">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="KoColorSetWidget" name="paletteBox">
<widget class="KoColorPatch" name="currentColor" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
......@@ -58,50 +78,55 @@
</property>
<property name="minimumSize">
<size>
<width>225</width>
<height>50</height>
<width>50</width>
<height>70</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="KisScreenColorPicker" name="screenColorPicker" native="true">
<widget class="KoColorPatch" name="previousColor" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
<width>25</width>
<height>25</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="nextprevlayout">
<layout class="QVBoxLayout" name="rightPane">
<item>
<widget class="KoColorPatch" name="currentColor" native="true">
<widget class="KoColorSetWidget" name="paletteBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<width>225</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="KoColorPatch" name="previousColor" native="true">
<widget class="KisScreenColorPicker" name="screenColorPicker" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -116,21 +141,6 @@
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
......
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