Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Leander Schulten
Lichtsteuerung
Commits
3c9c71a3
Commit
3c9c71a3
authored
Oct 07, 2019
by
Leander Schulten
Browse files
UI: All Icons have now the right color in the dark mode. Fix all black text in the ControlPane.
#55
parent
a867e0d0
Pipeline
#191362
passed with stage
in 4 minutes and 55 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/qml/ControlPane/ControlItem.qml
View file @
3c9c71a3
import
QtQuick
2.7
import
QtQuick
.
Controls
2.0
import
QtQuick
.
Layouts
1.0
import
QtQuick
2.12
import
QtQuick
.
Controls
2.12
import
QtQuick
.
Controls
.
Material
2.12
import
QtQuick
.
Layouts
1.12
import
QtGraphicalEffects
1.0
import
custom
.
licht
.
template
1.0
import
custom
.
licht
1.0
...
...
@@ -41,14 +42,16 @@ ControlItemTemplate{
}
onSettingVisibleChange
:
settings
.
opacity
=
visible
Image
{
opacity
:
0
Button
{
id
:
settings
width
:
18
height
:
18
padding
:
1
width
:
20
height
:
20
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
source
:
"
/icons/ic_settings_black_24px.svg
"
icon.source
:
"
/icons/ic_settings_black_24px.svg
"
background
:
null
opacity
:
0
visible
:
popup
!==
null
Behavior
on
rotation
{
...
...
@@ -59,27 +62,23 @@ ControlItemTemplate{
NumberAnimation
{
}
}
MouseArea
{
anchors.fill
:
paren
t
hoverEnabled
:
true
onEntered
:
settings
.
rotation
=
90
onExited
:
settings
.
rotation
=
0
onClicked
:
{
var
pos
=
mapToItem
(
item
.
parent
,
mouse
.
x
,
mouse
.
y
);
// do not move the popup out of the viewport
pos
.
x
=
Math
.
min
(
pos
.
x
,
item
.
parent
.
width
-
popup
.
width
-
5
);
pos
=
item
.
mapFromItem
(
item
.
parent
,
pos
.
x
,
pos
.
y
);
popup
.
x
=
pos
.
x
;
popup
.
y
=
pos
.
y
;
popup
.
open
()
;
onClicked
:
{
let
pos
=
mapToItem
(
item
.
parent
,
pressX
,
pressY
);
// do not move the popup out of the viewpor
t
pos
.
x
=
Math
.
min
(
pos
.
x
,
item
.
parent
.
width
-
popup
.
width
-
5
);
pos
=
item
.
mapFromItem
(
item
.
parent
,
pos
.
x
,
pos
.
y
);
popup
.
x
=
pos
.
x
;
popup
.
y
=
pos
.
y
;
popup
.
open
(
);
}
onHoveredChanged
:
{
if
(
hovered
){
settings
.
rotation
=
90
;
}
else
{
settings
.
rotation
=
0
;
}
}
}
Item
{
x
:
0
;
y
:
0
;
}
Behavior
on
x
{
NumberAnimation
{
...
...
src/qml/ControlPane/DimmerGroupControl.qml
View file @
3c9c71a3
...
...
@@ -92,6 +92,7 @@ ControlItem{
stepSize
:
1
Text
{
text
:
parent
.
value
.
toFixed
(
0
)
color
:
Material
.
foreground
anchors.top
:
parent
.
bottom
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
...
@@ -109,7 +110,7 @@ ControlItem{
text
:
"
Name :
"
horizontalAlignment
:
TextInput
.
AlignRight
}
TextInput
{
TextInput
Field
{
enabled
:
UserManagment
.
currentUser
.
havePermission
(
Permission
.
CHANGE_GROUP_NAME
);
Layout.fillWidth
:
true
text
:
controlData
?
controlData
.
name
:
"
null
"
;
...
...
@@ -119,7 +120,7 @@ ControlItem{
Rectangle
{
Layout.fillWidth
:
true
height
:
1
color
:
"
black
"
color
:
Material
.
iconDisabledColor
}
RowLayout
{
enabled
:
UserManagment
.
currentUser
.
havePermission
(
Permission
.
CHANGE_MIN_MAX_MAPPING
);
...
...
@@ -127,6 +128,7 @@ ControlItem{
spacing
:
2
Text
{
text
:
qsTr
(
"
Min
"
)
color
:
Material
.
foreground
font.underline
:
true
Layout.alignment
:
Qt
.
AlignHCenter
}
...
...
@@ -150,6 +152,7 @@ ControlItem{
spacing
:
2
Text
{
text
:
qsTr
(
"
Max
"
)
color
:
Material
.
foreground
font.underline
:
true
Layout.alignment
:
Qt
.
AlignHCenter
}
...
...
@@ -207,6 +210,7 @@ ControlItem{
font.family
:
"
Courier New
"
font.bold
:
true
text
:
parent
.
position
color
:
Material
.
foreground
anchors.bottom
:
parent
.
top
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
...
...
@@ -261,12 +265,14 @@ ControlItem{
second.onValueChanged
:
if
(
controlData
)
controlData
.
maxValue
=
second
.
value
Text
{
text
:
rangeSlider
.
first
.
value
.
toFixed
(
0
)
color
:
Material
.
foreground
anchors.bottom
:
rangeSlider
.
first
.
handle
.
top
anchors.horizontalCenter
:
rangeSlider
.
first
.
handle
.
horizontalCenter
anchors.bottomMargin
:
2
}
Text
{
text
:
rangeSlider
.
second
.
value
.
toFixed
(
0
)
color
:
Material
.
foreground
anchors.bottom
:
rangeSlider
.
second
.
handle
.
top
anchors.horizontalCenter
:
rangeSlider
.
second
.
handle
.
horizontalCenter
anchors.bottomMargin
:
2
...
...
src/qml/ControlPane/ProgramBlockControl.qml
View file @
3c9c71a3
...
...
@@ -21,50 +21,50 @@ ControlItem{
anchors.fill
:
parent
spacing
:
0
Image
{
Button
{
padding
:
3
Layout.fillHeight
:
true
Layout.fillWidth
:
true
fillMode
:
Image
.
PreserveAspectFit
implicitWidth
:
50
id
:
startStop
source
:
controlData
.
programBlock
.
status
===
1
?
"
qrc:icons/stop.svg
"
:
controlData
.
programBlock
.
status
===
0
?
"
qrc:icons/play.svg
"
:
"
qrc:icons/replay.svg
"
MouseArea
{
anchors.fill
:
parent
hoverEnabled
:
true
onClicked
:
{
if
(
controlData
.
programBlock
.
status
===
0
){
controlData
.
programBlock
.
start
();
}
else
if
(
controlData
.
programBlock
.
status
===
1
){
controlData
.
programBlock
.
stop
();
}
else
if
(
controlData
.
programBlock
.
status
===
2
){
controlData
.
programBlock
.
restart
();
}
icon.source
:
controlData
.
programBlock
.
status
===
1
?
"
qrc:icons/stop.svg
"
:
controlData
.
programBlock
.
status
===
0
?
"
qrc:icons/play.svg
"
:
"
qrc:icons/replay.svg
"
icon.width
:
width
icon.height
:
width
background
:
null
onClicked
:
{
if
(
controlData
.
programBlock
.
status
===
0
){
controlData
.
programBlock
.
start
();
}
else
if
(
controlData
.
programBlock
.
status
===
1
){
controlData
.
programBlock
.
stop
();
}
else
if
(
controlData
.
programBlock
.
status
===
2
){
controlData
.
programBlock
.
restart
();
}
ToolTip.visible
:
containsMouse
ToolTip.delay
:
1000
ToolTip.text
:
controlData
.
programBlock
.
status
===
1
?
"
Stop
"
:
controlData
.
programBlock
.
status
===
0
?
"
Play
"
:
"
Replay
"
}
ToolTip.visible
:
hovered
ToolTip.delay
:
1000
ToolTip.text
:
controlData
.
programBlock
.
status
===
1
?
"
Stop
"
:
controlData
.
programBlock
.
status
===
0
?
"
Play
"
:
"
Replay
"
}
Image
{
Button
{
padding
:
1
implicitWidth
:
50
Layout.fillHeight
:
true
Layout.fillWidth
:
true
fillMode
:
Image
.
PreserveAspectFit
id
:
pauseResume
source
:
controlData
.
programBlock
.
status
===
1
?
"
qrc:icons/pause.svg
"
:
"
qrc:icons/resume.png
"
icon.source
:
controlData
.
programBlock
.
status
===
1
?
"
qrc:icons/pause.svg
"
:
"
qrc:icons/resume.png
"
icon.width
:
width
icon.height
:
width
background
:
null
visible
:
controlData
.
programBlock
.
status
!==
0
;
MouseArea
{
anchors.fill
:
parent
hoverEnabled
:
true
onClicked
:
{
if
(
controlData
.
programBlock
.
status
===
1
){
controlData
.
programBlock
.
pause
();
}
else
if
(
controlData
.
programBlock
.
status
===
2
){
controlData
.
programBlock
.
resume
();
}
onClicked
:
{
if
(
controlData
.
programBlock
.
status
===
1
){
controlData
.
programBlock
.
pause
();
}
else
if
(
controlData
.
programBlock
.
status
===
2
){
controlData
.
programBlock
.
resume
();
}
ToolTip.visible
:
containsMouse
ToolTip.delay
:
1000
ToolTip.text
:
controlData
.
programBlock
.
status
===
1
?
"
Pause
"
:
"
Resume
"
}
ToolTip.visible
:
hovered
ToolTip.delay
:
1000
ToolTip.text
:
controlData
.
programBlock
.
status
===
1
?
"
Pause
"
:
"
Resume
"
}
}
}
...
...
src/qml/ControlPane/ProgrammControl.qml
View file @
3c9c71a3
import
QtQuick
2.7
import
QtQuick
.
Controls
2.0
import
QtQuick
.
Layouts
1.0
import
QtGraphicalEffects
1.0
import
QtQuick
2.12
import
QtQuick
.
Controls
2.12
import
QtQuick
.
Controls
.
Material
2.12
import
QtQuick
.
Layouts
1.12
import
QtGraphicalEffects
1.12
import
custom
.
licht
1.0
ControlItem
{
...
...
@@ -9,33 +10,36 @@ ControlItem{
blockWidth
:
3
blockHeight
:
1
ControlItemBlock
{
Image
{
anchors.margins
:
1
anchors.fill
:
parent
Button
{
padding
:
1
implicitWidth
:
50
anchors.fill
:
parent
id
:
play
source
:
"
/icons/play.svg
"
icon.source
:
"
/icons/play.svg
"
icon.width
:
width
-
4
icon.height
:
height
-
4
background
:
null
Behavior
on
opacity
{
NumberAnimation
{
duration
:
100
}
}
}
Image
{
anchors.margins
:
1
Button
{
padding
:
1
implicitWidth
:
50
anchors.fill
:
parent
id
:
pause
source
:
"
/icons/pause.svg
"
icon.source
:
"
/icons/pause.svg
"
icon.width
:
width
-
4
icon.height
:
height
-
4
background
:
null
opacity
:
1
-
play
.
opacity
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
controlData
.
programm
.
running
=
!
controlData
.
programm
.
running
;
item
.
pressed
=
controlData
.
programm
.
running
;
play
.
opacity
=
!
controlData
.
programm
.
running
;
}
}
}
...
...
@@ -63,6 +67,7 @@ ControlItem{
onValueChanged
:
if
(
controlData
)
controlData
.
programm
.
speed
=
value
;
Text
{
id
:
sliderSpeed
color
:
Material
.
foreground
text
:
speedSlider
.
value
.
toFixed
(
1
)
anchors.bottom
:
speedSlider
.
handle
.
top
anchors.horizontalCenter
:
parent
.
handle
.
horizontalCenter
...
...
src/qml/ControlPane/SwitchGroupControl.qml
View file @
3c9c71a3
import
QtQuick
2.7
import
QtQuick
.
Controls
2.0
import
QtQuick
.
Layouts
1.0
import
QtGraphicalEffects
1.0
import
QtQuick
2.12
import
QtQuick
.
Controls
2.12
import
QtQuick
.
Layouts
1.12
import
QtGraphicalEffects
1.12
import
QtQuick
.
Controls
.
Material
2.12
import
custom
.
licht
1.0
import
"
..
"
import
"
../components
"
...
...
@@ -19,27 +20,44 @@ ControlItem{
}
}
ControlItemBlock
{
Image
{
anchors.margins
:
1
anchors.fill
:
parent
Button
{
padding
:
1
implicitWidth
:
50
anchors.fill
:
parent
id
:
play
source
:
"
/icons/play.svg
"
icon.source
:
"
/icons/play.svg
"
icon.width
:
width
-
4
icon.height
:
height
-
4
background
:
null
Behavior
on
opacity
{
NumberAnimation
{
duration
:
100
}
}
}
Image
{
anchors.margins
:
1
Button
{
padding
:
1
implicitWidth
:
50
anchors.fill
:
parent
id
:
pause
source
:
"
/icons/pause.svg
"
icon.source
:
"
/icons/pause.svg
"
icon.width
:
width
-
4
icon.height
:
height
-
4
background
:
null
opacity
:
1
-
play
.
opacity
onClicked
:
{
controlData
.
activated
=!
controlData
.
activated
;
if
(
controlData
.
activated
){
disabledRectAni
.
duration
=
controlData
.
activateCooldown
}
else
{
disabledRectAni
.
duration
=
controlData
.
deactivateCooldown
}
disabledRectAni
.
start
()
}
}
Rectangle
{
id
:
disabledRect
color
:
"
black
"
color
:
Material
.
foreground
opacity
:
0.3
anchors.left
:
play
.
left
anchors.right
:
play
.
right
...
...
@@ -53,22 +71,8 @@ ControlItem{
easing.type
:
Easing
.
Linear
from
:
play
.
height
to
:
0
;
onStarted
:
mouseArea
.
enabled
=
false
;
onStopped
:
mouseArea
.
enabled
=
true
;
}
MouseArea
{
id
:
mouseArea
anchors.fill
:
parent
onClicked
:
{
controlData
.
activated
=!
controlData
.
activated
;
if
(
controlData
.
activated
){
disabledRectAni
.
duration
=
controlData
.
activateCooldown
}
else
{
disabledRectAni
.
duration
=
controlData
.
deactivateCooldown
}
disabledRectAni
.
start
()
}
onStarted
:
pause
.
enabled
=
play
.
enabled
=
false
;
onStopped
:
pause
.
enabled
=
play
.
enabled
=
true
;
}
}
...
...
@@ -111,6 +115,7 @@ ControlItem{
onTextChanged
:
if
(
controlData
)
controlData
.
activateCooldown
=
text
Text
{
text
:
"
ms
"
color
:
Material
.
foreground
x
:
parent
.
contentWidth
anchors.verticalCenter
:
parent
.
verticalCenter
}
...
...
@@ -130,6 +135,7 @@ ControlItem{
onTextChanged
:
if
(
controlData
)
controlData
.
deactivateCooldown
=
text
Text
{
text
:
"
ms
"
color
:
Material
.
foreground
x
:
parent
.
contentWidth
anchors.verticalCenter
:
parent
.
verticalCenter
}
...
...
src/qml/ModelView.qml
View file @
3c9c71a3
...
...
@@ -81,7 +81,6 @@ GridLayout{
}
Button
{
icon.source
:
sortedView
.
sortOrder
===
Qt
.
DescendingOrder
?
"
../icons/sort_order/sort-reverse-alphabetical-order.svg
"
:
"
../icons/sort_order/sort-by-alphabet.svg
"
icon.color
:
Qt
.
rgba
(.
25
,.
25
,.
25
,
1
)
onClicked
:
sortedView
.
sortOrder
=
sortedView
.
sortOrder
===
Qt
.
DescendingOrder
?
Qt
.
AscendingOrder
:
Qt
.
DescendingOrder
;
}
}
...
...
src/qml/ModuleView.qml
View file @
3c9c71a3
...
...
@@ -125,7 +125,6 @@ Item{
}
Button
{
icon.source
:
sortedView
.
sortOrder
===
Qt
.
DescendingOrder
?
"
../icons/sort_order/sort-reverse-alphabetical-order.svg
"
:
"
../icons/sort_order/sort-by-alphabet.svg
"
icon.color
:
Qt
.
rgba
(.
25
,.
25
,.
25
,
1
)
onClicked
:
sortedView
.
sortOrder
=
sortedView
.
sortOrder
===
Qt
.
DescendingOrder
?
Qt
.
AscendingOrder
:
Qt
.
DescendingOrder
;
Layout.preferredWidth
:
40
}
...
...
@@ -280,16 +279,13 @@ Item{
anchors.right
:
addProp
.
left
anchors.topMargin
:
-
4
anchors.bottomMargin
:
-
4
Material.elevation
:
0
flat
:
true
width
:
height
onClicked
:
listView
.
currentModelData
.
removeProperty
(
delegate
.
modelEntry
)
Image
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
height
:
24
width
:
24
source
:
"
/icons/remove.svg
"
}
icon.source
:
"
/icons/remove.svg
"
icon.width
:
24
icon.height
:
24
padding
:
1
}
Button
{
id
:
addProp
...
...
@@ -299,18 +295,15 @@ Item{
anchors.topMargin
:
-
4
anchors.bottomMargin
:
-
4
width
:
height
Material.elevation
:
0
flat
:
true
onClicked
:
{
dialog
.
prop
=
listView
.
currentModelData
.
createNewProperty
();
dialog
.
visible
=
true
;
}
Image
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
height
:
24
width
:
24
source
:
"
/icons/add.svg
"
}
icon.source
:
"
/icons/add.svg
"
icon.width
:
24
icon.height
:
24
padding
:
1
}
}
Button
{
...
...
@@ -319,18 +312,15 @@ Item{
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
width
:
height
Material.elevation
:
0
flat
:
true
onClicked
:
{
dialog
.
prop
=
listView
.
currentModelData
.
createNewProperty
();
dialog
.
visible
=
true
;
}
Image
{
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.verticalCenter
:
parent
.
verticalCenter
height
:
24
width
:
24
source
:
"
/icons/add.svg
"
}
icon.source
:
"
/icons/add.svg
"
icon.width
:
24
icon.height
:
24
padding
:
1
}
}
Label
{
...
...
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