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 ...@@ -108,10 +108,8 @@ KisInternalColorSelector::KisInternalColorSelector(QWidget *parent, KoColor colo
if (config.prevNextButtons) { if (config.prevNextButtons) {
m_ui->currentColor->setColor(m_d->currentColor); m_ui->currentColor->setColor(m_d->currentColor);
m_ui->currentColor->setDisplayRenderer(displayRenderer); m_ui->currentColor->setDisplayRenderer(displayRenderer);
m_ui->currentColor->setFrameStyle(QFrame::StyledPanel);
m_ui->previousColor->setColor(m_d->currentColor); m_ui->previousColor->setColor(m_d->currentColor);
m_ui->previousColor->setDisplayRenderer(displayRenderer); m_ui->previousColor->setDisplayRenderer(displayRenderer);
m_ui->previousColor->setFrameStyle(QFrame::StyledPanel);
connect(this, SIGNAL(accepted()), this, SLOT(setPreviousColor())); connect(this, SIGNAL(accepted()), this, SLOT(setPreviousColor()));
connect(m_ui->previousColor, SIGNAL(triggered(KoColorPatch*)), SLOT(slotSetColorFromPatch(KoColorPatch*))); connect(m_ui->previousColor, SIGNAL(triggered(KoColorPatch*)), SLOT(slotSetColorFromPatch(KoColorPatch*)));
} else { } else {
...@@ -124,7 +122,7 @@ KisInternalColorSelector::KisInternalColorSelector(QWidget *parent, KoColor colo ...@@ -124,7 +122,7 @@ KisInternalColorSelector::KisInternalColorSelector(QWidget *parent, KoColor colo
m_d->hexColorInput = new KisHexColorInput(this, &m_d->sRGB); m_d->hexColorInput = new KisHexColorInput(this, &m_d->sRGB);
m_d->hexColorInput->update(); m_d->hexColorInput->update();
connect(m_d->hexColorInput, SIGNAL(updated()), SLOT(slotSetColorFromHex())); 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.")); 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() ...@@ -256,9 +254,9 @@ void KisInternalColorSelector::endUpdateWithNewColor()
m_d->allowUpdates = true; m_d->allowUpdates = true;
} }
void KisInternalColorSelector::focusInEvent(QFocusEvent *e) void KisInternalColorSelector::focusInEvent(QFocusEvent *)
{ {
setPreviousColor(); //setPreviousColor();
} }
void KisInternalColorSelector::slotSetColorFromPatch(KoColorPatch* patch) void KisInternalColorSelector::slotSetColorFromPatch(KoColorPatch* patch)
......
...@@ -165,7 +165,7 @@ private: ...@@ -165,7 +165,7 @@ private:
*/ */
void updateAllElements(QObject *source); void updateAllElements(QObject *source);
virtual void focusInEvent(QFocusEvent *e); virtual void focusInEvent(QFocusEvent *);
}; };
#endif // KISINTERNALCOLORSELECTOR_H #endif // KISINTERNALCOLORSELECTOR_H
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>55</width> <width>90</width>
<height>50</height> <height>90</height>
</size> </size>
</property> </property>
</widget> </widget>
...@@ -37,11 +37,70 @@ ...@@ -37,11 +37,70 @@
<item> <item>
<widget class="KisSpinboxColorSelector" name="spinboxselector" native="true"> <widget class="KisSpinboxColorSelector" name="spinboxselector" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<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="KoColorPatch" name="currentColor" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>70</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="KoColorPatch" name="previousColor" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>25</width>
<height>25</height>
</size>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
</layout> </layout>
...@@ -80,55 +139,6 @@ ...@@ -80,55 +139,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="nextprevlayout">
<item>
<widget class="KoColorPatch" name="currentColor" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="KoColorPatch" name="previousColor" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</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> </layout>
</item> </item>
</layout> </layout>
......
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