Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
a263c89e
Commit
a263c89e
authored
Feb 22, 2010
by
Christiaan Janssen
Browse files
QmlDesigner.PropertyEditor: Fixed color widget for black
parent
afa830ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp
View file @
a263c89e
...
...
@@ -134,7 +134,7 @@ namespace QmlDesigner {
if
(
x
>
120
)
x
=
120
;
if
(
y
<
0
)
y
=
0
;
if
(
y
>
120
)
y
=
120
;
newColor
.
setHsv
(
m_
saturatedColor
.
hsv
Hue
()
,
(
x
*
255
)
/
120
,
255
-
(
y
*
255
)
/
120
);
newColor
.
setHsv
(
m_
last
Hue
,
(
x
*
255
)
/
120
,
255
-
(
y
*
255
)
/
120
);
setColor
(
newColor
);
}
...
...
@@ -149,6 +149,9 @@ namespace QmlDesigner {
if
((
m_saturatedColor
.
hsvHue
()
!=
m_lastHue
)
||
(
m_cache
.
isNull
()))
{
m_lastHue
=
m_saturatedColor
.
hsvHue
();
if
(
m_lastHue
<
0
)
m_lastHue
=
0
;
if
(
m_lastHue
>
359
)
m_lastHue
=
359
;
m_cache
=
QPixmap
(
120
,
120
);
int
height
=
120
;
...
...
@@ -160,7 +163,7 @@ namespace QmlDesigner {
for
(
int
x
=
0
;
x
<
width
;
x
++
)
{
QColor
c
;
c
.
setHsv
(
m_
saturatedColor
.
hsv
Hue
()
,
(
x
*
255
)
/
120
,
255
-
(
y
*
255
)
/
120
);
c
.
setHsv
(
m_
last
Hue
,
(
x
*
255
)
/
120
,
255
-
(
y
*
255
)
/
120
);
chacheP
.
setPen
(
c
);
chacheP
.
drawPoint
(
x
,
y
);
}
...
...
@@ -171,6 +174,11 @@ namespace QmlDesigner {
int
x
=
m_color
.
hsvSaturationF
()
*
120
+
5
;
int
y
=
120
-
m_color
.
valueF
()
*
120
+
5
;
if
(
x
<
5
)
x
=
5
;
if
(
x
>
125
)
x
=
125
;
if
(
y
<
5
)
y
=
5
;
if
(
y
>
125
)
y
=
125
;
p
.
setPen
(
Qt
::
white
);
p
.
drawEllipse
(
x
-
2
,
y
-
2
,
4
,
4
);
}
...
...
src/plugins/qmldesigner/components/propertyeditor/colorwidget.h
View file @
a263c89e
...
...
@@ -112,7 +112,10 @@ void setHue(int newHue)
int
hue
()
const
{
return
m_color
.
hue
();
int
retval
=
m_color
.
hsvHue
();
if
(
retval
<
0
)
retval
=
0
;
if
(
retval
>
359
)
retval
=
359
;
return
retval
;
}
void
setColor
(
const
QString
&
colorStr
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment