9 color: main.useSyspal? syspal.window :parent.color
11 signal foregroundColorChanged(variant color)
12 property variant foregroundColor: "#ff0000"
13 property variant backgroundColor: "#ffffff"
15 property variant pickerComponent : Qt.createComponent("ColorPicker/ColorPickerPopup.qml");
16 property variant popup: undefined;
19 console.log("II [BoardToolbar.qml]: "+msg);
22 console.log("EE [BoardToolbar.qml]: "+msg);
25 console.log("WW [BoardToolbar.qml]: "+msg);
28 Component.onCompleted:{
29 foregroundColorChanged.connect(function(color){toolbar.foregroundColor = color;});
32 SystemPalette{ id: syspal }
35 id: foregroundColorSelector
36 anchors{margins: 4; left: parent.left; right: parent.right; top: parent.top; }
43 color: toolbar.foregroundColor
50 border{ color: "white"; width: 1 }
59 //log("clicked on statusIndicator ");
61 if(pickerComponent.status != Component.Ready){
62 error("Component "+pickerComponent.url+" is not ready!");
63 error(pickerComponent.errorString());
67 if (popup !== undefined && popup !== null && popup.state != "hide"){
71 popup = pickerComponent.createObject(main);
73 error("error creating popup");
74 error(pickerComponent.errorString());
77 var pos = foregroundColorSelector.mapToItem(main,0, 0);
78 popup.popupFromX = pos.x;
79 popup.popupFromY = pos.y;
80 popup.color = foregroundColor;
82 popup.colorChanged.connect(foregroundColorChanged)
84 popup.state = "visible"
85 //log("visible popup "+JSON.stringify(parent));