From 312f20ba98e43bac40c688a9b136e03ca2ce3130 Mon Sep 17 00:00:00 2001 From: Lukas Karas Date: Tue, 27 Dec 2011 01:24:22 +0100 Subject: [PATCH] use system palete colors --- src/ui-mobile/declarative/AbstractListViewLine.qml | 6 +- src/ui-mobile/declarative/BoardToolbar.qml | 9 +- src/ui-mobile/declarative/BoardWidget.qml | 6 +- src/ui-mobile/declarative/ChatWidget.qml | 9 +- src/ui-mobile/declarative/ContactDetailPopup.qml | 11 +- src/ui-mobile/declarative/ContactListPanel.qml | 26 +---- src/ui-mobile/declarative/GlobalStatusPopup.qml | 6 +- src/ui-mobile/declarative/LeftPanel.qml | 3 +- src/ui-mobile/declarative/ListViewLine.qml | 7 +- src/ui-mobile/declarative/SessionControlPanel.qml | 125 +++++++++++---------- src/ui-mobile/declarative/SessionController.qml | 4 + src/ui-mobile/declarative/SessionScene.qml | 5 + src/ui-mobile/declarative/TopPanel.qml | 62 ++++++++++ src/ui-mobile/declarative/mainview.qml | 5 +- src/ui-mobile/resources.qrc | 1 + 15 files changed, 183 insertions(+), 102 deletions(-) create mode 100644 src/ui-mobile/declarative/TopPanel.qml diff --git a/src/ui-mobile/declarative/AbstractListViewLine.qml b/src/ui-mobile/declarative/AbstractListViewLine.qml index 03ac630..d99a8ce 100644 --- a/src/ui-mobile/declarative/AbstractListViewLine.qml +++ b/src/ui-mobile/declarative/AbstractListViewLine.qml @@ -33,9 +33,11 @@ Rectangle { color: "transparent" + SystemPalette{ id: syspal } + Rectangle{ id: topBorder - color: "white" + color: main.useSyspal? syspal.light :"white" opacity: first? 0: .03 height: 1 anchors{top: parent.top; left: parent.left; right: parent.right} @@ -43,7 +45,7 @@ Rectangle { Rectangle{ id: bottomBorder - color: "black" + color: main.useSyspal? syspal.shadow :"black" opacity: last? 0 : .2 height: 1 anchors{bottom: parent.bottom; left: parent.left; right: parent.right} diff --git a/src/ui-mobile/declarative/BoardToolbar.qml b/src/ui-mobile/declarative/BoardToolbar.qml index 1af91e7..ad41584 100644 --- a/src/ui-mobile/declarative/BoardToolbar.qml +++ b/src/ui-mobile/declarative/BoardToolbar.qml @@ -1,11 +1,12 @@ import QtQuick 1.0 +import Qt 4.7 import "ColorPicker" Rectangle { id: toolbar width: 100 height: 62 - color: parent.color + color: main.useSyspal? syspal.window :parent.color signal foregroundColorChanged(variant color) property variant foregroundColor: "#ff0000" @@ -28,9 +29,13 @@ Rectangle { foregroundColorChanged.connect(function(color){toolbar.foregroundColor = color;}); } + SystemPalette{ id: syspal } + Rectangle{ id: foregroundColorSelector - anchors{margins: 4; left: parent.left; right: parent.right; top: parent.top} + anchors{margins: 4; left: parent.left; right: parent.right; top: parent.top; } + anchors.topMargin: 44 + height: width Rectangle{ diff --git a/src/ui-mobile/declarative/BoardWidget.qml b/src/ui-mobile/declarative/BoardWidget.qml index 0ef7b51..3c69f10 100644 --- a/src/ui-mobile/declarative/BoardWidget.qml +++ b/src/ui-mobile/declarative/BoardWidget.qml @@ -70,6 +70,10 @@ Rectangle { //log("whiteboard is not initialized... "+JSON.stringify(queue.length)); } + function hideWebView(b){ + wbView.opacity = b? 0:1; + log("HACK: hide wbView? "+b); + } state: "normal" states: [ @@ -502,7 +506,7 @@ Rectangle { } BoardToolbar{ id: toolbar - color: parent.color + //color: parent.color anchors{bottom: parent.bottom; right: parent.right; top: parent.top} BorderImage { source: "img/lineedit.sci"; anchors.fill: parent } width: 60 diff --git a/src/ui-mobile/declarative/ChatWidget.qml b/src/ui-mobile/declarative/ChatWidget.qml index 8381d0b..8ac5ad3 100644 --- a/src/ui-mobile/declarative/ChatWidget.qml +++ b/src/ui-mobile/declarative/ChatWidget.qml @@ -28,7 +28,7 @@ Rectangle { id: chatWidget width: 100 height: 62 - color: "black" + color: main.useSyspal? syspal.window :"black" signal sendMessage(string sessionId, string text) signal changeChatState(string sessionId, int state) @@ -93,6 +93,8 @@ Rectangle { } + SystemPalette{ id: syspal } + Rectangle{ id: historyWrapper BorderImage { source: "img/lineedit.sci"; anchors.fill: parent } @@ -141,7 +143,8 @@ Rectangle { Text { id: statusMessage text: "" - color: "gray" + color: main.useSyspal? syspal.windowText :"gray" + opacity: 0.6 anchors{horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; leftMargin:6} } } @@ -176,7 +179,7 @@ Rectangle { Flipable { id: inputMethod - state: "back" + state: main.useSyspal? syspal.window :"back" property bool flipped: false property int angle: 180 diff --git a/src/ui-mobile/declarative/ContactDetailPopup.qml b/src/ui-mobile/declarative/ContactDetailPopup.qml index 8367d54..dcfd866 100644 --- a/src/ui-mobile/declarative/ContactDetailPopup.qml +++ b/src/ui-mobile/declarative/ContactDetailPopup.qml @@ -36,14 +36,14 @@ AbstractPopup{ id: background anchors.fill: wrapper opacity: wrapper.opacity - color: "#323235" + color: main.useSyspal? syspal.mid :"#323235" radius: (width*0.03) Rectangle{ id: border anchors.fill: parent radius: parent.radius - border{ color: "white"; width: 1 } + border{ color: main.useSyspal? syspal.windowText :"white"; width: 1 } color: "transparent" opacity: 0.25 //opacity: 1.0 @@ -51,7 +51,7 @@ AbstractPopup{ Text{ id: contactName - color: "white" + color: main.useSyspal? syspal.windowText :"white" anchors{ top: parent.top; left: parent.left; @@ -63,7 +63,8 @@ AbstractPopup{ } Text{ id: contactId - color: "gray" + color: main.useSyspal? syspal.windowText :"gray" + opacity: 0.6 anchors{ top: contactName.bottom; left: parent.left; @@ -120,7 +121,7 @@ AbstractPopup{ Text{ id:statusText text: defined? contactLine.statusMessage: "???" - color: "white" + color: main.useSyspal? syspal.windowText :"white" anchors{ top: contactIcon.bottom left: parent.left diff --git a/src/ui-mobile/declarative/ContactListPanel.qml b/src/ui-mobile/declarative/ContactListPanel.qml index 80abfee..befac93 100644 --- a/src/ui-mobile/declarative/ContactListPanel.qml +++ b/src/ui-mobile/declarative/ContactListPanel.qml @@ -19,11 +19,10 @@ import Qt 4.7 import QtQuick 1.0 -//import QtDesktop 0.1 import org.makneto 0.1 as Makneto import "components" -Item { +TopPanel { id: contactListPanel property variant _model: ListModel {} @@ -54,18 +53,13 @@ Item { main.contactsModelChanged.connect(onContactsModelChanged); } + SystemPalette{ id: syspal } Rectangle{ id: topPanel anchors{top: parent.top; left: parent.left; right: parent.right} height: parent.height - color: "red" - - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.rgba(0.086, 0.086, 0.086, 1)} - GradientStop { position: 0.9; color: Qt.rgba(0.086, 0.086, 0.086, 0.9)} - GradientStop { position: 1.0; color: Qt.rgba(0.086, 0.086, 0.086, 0.5)} - } + color: "transparent" GlobalStatus{ id: accountManager @@ -157,20 +151,6 @@ Item { onClicked: showOfflineCheckBox.checked = !showOfflineCheckBox.checked } } - - Rectangle{ - id: topLine - anchors{top: parent.bottom; left: parent.left; right: parent.right} - height: 1 - color: "transparent" - - Image { - id: topLineImage - source: "img/line-horizontal.svg" - anchors.fill: parent - } - } - } } diff --git a/src/ui-mobile/declarative/GlobalStatusPopup.qml b/src/ui-mobile/declarative/GlobalStatusPopup.qml index f6171bd..239ce85 100644 --- a/src/ui-mobile/declarative/GlobalStatusPopup.qml +++ b/src/ui-mobile/declarative/GlobalStatusPopup.qml @@ -43,7 +43,7 @@ AbstractPopup { id: background anchors.fill: wrapper opacity: wrapper.opacity - color: "#323235" + color: main.useSyspal? syspal.mid :"#323235" radius: (width*0.03) Rectangle{ @@ -154,7 +154,7 @@ AbstractPopup { Text{ id: statusTextLabel anchors{ top: statusChoiceList.bottom; right: parent.right; left: separatorLine.right } - color: "white" + color: main.useSyspal? syspal.windowText :"white" anchors{ topMargin: 6; leftMargin: 6; bottomMargin: 0; rightMargin: 6} text: "Status:" } @@ -168,7 +168,7 @@ AbstractPopup { Text{ id: statusMessageLabel anchors{ top: statusText.bottom; right: parent.right; left: separatorLine.right } - color: "white" + color: main.useSyspal? syspal.windowText :"white" anchors{ topMargin: 6; leftMargin: 6; bottomMargin: 0; rightMargin: 6} text: "Status Message:" } diff --git a/src/ui-mobile/declarative/LeftPanel.qml b/src/ui-mobile/declarative/LeftPanel.qml index 45aaf17..6113456 100644 --- a/src/ui-mobile/declarative/LeftPanel.qml +++ b/src/ui-mobile/declarative/LeftPanel.qml @@ -24,7 +24,8 @@ import org.makneto 0.1 as Makneto Rectangle{ id: leftPanel - color: "#262626" + SystemPalette{ id: syspal } + color: main.useSyspal ? syspal.mid : "#262626" property variant expandedWidth : 200 property variant hidedWidth : 0 diff --git a/src/ui-mobile/declarative/ListViewLine.qml b/src/ui-mobile/declarative/ListViewLine.qml index f5cfc4f..ef1a875 100644 --- a/src/ui-mobile/declarative/ListViewLine.qml +++ b/src/ui-mobile/declarative/ListViewLine.qml @@ -30,6 +30,8 @@ AbstractListViewLine { property variant statusText:"" property variant iconOpacity:1 + SystemPalette{ id: syspal } + Rectangle{ id: wrapper anchors.topMargin: topMargin @@ -53,7 +55,7 @@ AbstractListViewLine { Text { id: title text: titleText - color: "white" + color: main.useSyspal? syspal.windowText :"white" anchors.top: iconImage.top anchors.left: iconImage.right anchors.leftMargin: 8 @@ -63,7 +65,8 @@ AbstractListViewLine { Text { id: statusMsg text: statusText - color: "grey" + color: main.useSyspal? syspal.windowText :"grey" + opacity: .6 anchors.left: iconImage.right anchors.top: title.bottom anchors.leftMargin: title.anchors.leftMargin diff --git a/src/ui-mobile/declarative/SessionControlPanel.qml b/src/ui-mobile/declarative/SessionControlPanel.qml index d09f86e..c013c99 100644 --- a/src/ui-mobile/declarative/SessionControlPanel.qml +++ b/src/ui-mobile/declarative/SessionControlPanel.qml @@ -18,15 +18,15 @@ */ import Qt 4.7 - -Rectangle{ +TopPanel{ id: sessionToolbar - BorderImage { source: "img/toolbar.sci"; anchors.fill: parent } - color: "transparent" - y: 10 - width: height * 3 + //BorderImage { source: "img/toolbar.sci"; anchors.fill: parent } + //color: "transparent" + //y: 10 + //width: height * 3 height: 40 - anchors.horizontalCenter: parent.horizontalCenter + //anchors.horizontalCenter: parent.horizontalCenter + anchors{top: parent.top; left: parent.left; right: parent.right} state: "chat" //anchors.right: crossIcon.right @@ -47,68 +47,75 @@ Rectangle{ //micIcon.source = b ? "img/mic-on.svg": "img/mic-off.png"; } - Image { - id: boardIcon - source: "img/table.svg" - height: parent.height * 0.8 - width: height - anchors{ margins: parent.height*0.1; left: parent.left; top: parent.top } - - MouseArea{ - anchors.fill: parent - onClicked: { - sessionToolbar.parent.setBoard(!sessionToolbar.parent.board); + Rectangle{ + width: height * 3 + anchors{top: parent.top; bottom: parent.bottom} + anchors.horizontalCenter: parent.horizontalCenter + color: "transparent" + + Image { + id: boardIcon + source: "img/table.svg" + height: parent.height * 0.8 + width: height + anchors{ margins: parent.height*0.1; left: parent.left; top: parent.top } + + MouseArea{ + anchors.fill: parent + onClicked: { + sessionToolbar.parent.setBoard(!sessionToolbar.parent.board); + } } } - } - Image { - id: callIcon - source: "img/call-start.png" - height: parent.height * 0.8 - width: height - anchors{ margins: parent.height*0.1; left: boardIcon.right; top: parent.top } - MouseArea{ - anchors.fill: parent - onClicked: { - if (sessionToolbar.state == "call"){ - log("request hangup "+sessionToolbar.parent.sessionId); - requestHangup(sessionToolbar.parent.sessionId); - }else{ - log("request audio call "+sessionToolbar.parent.sessionId); - requestCall(sessionToolbar.parent.sessionId, false); + Image { + id: callIcon + source: "img/call-start.png" + height: parent.height * 0.8 + width: height + anchors{ margins: parent.height*0.1; left: boardIcon.right; top: parent.top } + MouseArea{ + anchors.fill: parent + onClicked: { + if (sessionToolbar.state == "call"){ + log("request hangup "+sessionToolbar.parent.sessionId); + requestHangup(sessionToolbar.parent.sessionId); + }else{ + log("request audio call "+sessionToolbar.parent.sessionId); + requestCall(sessionToolbar.parent.sessionId, false); + } } } } - } - Image { - id: camIcon - source: "img/cam.svg" - height: parent.height * 0.8 - width: 0 - //visible: false - anchors{ margins: 0; left: callIcon.right; top: parent.top } - MouseArea{ - anchors.fill: parent - onClicked: { - log("request video call "+sessionToolbar.parent.sessionId); - requestCall(sessionToolbar.parent.sessionId, true); + Image { + id: camIcon + source: "img/cam.svg" + height: parent.height * 0.8 + width: 0 + //visible: false + anchors{ margins: 0; left: callIcon.right; top: parent.top } + MouseArea{ + anchors.fill: parent + onClicked: { + log("request video call "+sessionToolbar.parent.sessionId); + requestCall(sessionToolbar.parent.sessionId, true); + } } } - } - Image { - id: crossIcon - source: "img/cross.svg" - height: parent.height * 0.8 - width: height - anchors{ margins: parent.height*0.1; left: camIcon.right; top: parent.top} - - MouseArea{ - anchors.fill: parent - onClicked: { - sessionToolbar.parent.closeSession(); + Image { + id: crossIcon + source: "img/cross.svg" + height: parent.height * 0.8 + width: height + anchors{ margins: parent.height*0.1; left: camIcon.right; top: parent.top} + + MouseArea{ + anchors.fill: parent + onClicked: { + sessionToolbar.parent.closeSession(); + } } } } diff --git a/src/ui-mobile/declarative/SessionController.qml b/src/ui-mobile/declarative/SessionController.qml index 408498b..ed12404 100644 --- a/src/ui-mobile/declarative/SessionController.qml +++ b/src/ui-mobile/declarative/SessionController.qml @@ -57,16 +57,19 @@ Rectangle { sessionController._model.sessionTypeChanged.connect(sessionTypeChanged); sessionController._model.messageSent.connect(messageSent); + /* sessionController._model.startBeeping.connect(startBeeping); sessionController._model.stopBeeping.connect(stopBeeping); sessionController._model.startRinging.connect(startRinging); sessionController._model.stopRinging.connect(stopRinging); + */ }catch(e){ error("error while connecting to signals "+JSON.stringify(e)); } } + /* function startBeeping(){ log("startBeeping"); //beeper.start(); @@ -86,6 +89,7 @@ Rectangle { log("stopRinging"); //ringer.stop(); } + */ function whiteboardMessageReceived(sessionId, data, contact){ try{ diff --git a/src/ui-mobile/declarative/SessionScene.qml b/src/ui-mobile/declarative/SessionScene.qml index 6284156..74e2d0c 100644 --- a/src/ui-mobile/declarative/SessionScene.qml +++ b/src/ui-mobile/declarative/SessionScene.qml @@ -80,6 +80,7 @@ Scene { SessionControlPanel{ id: sessionToolbar + z: 200 } Component.onCompleted:{ @@ -102,6 +103,10 @@ Scene { onHeightChanged:{ updateLayout(); } + onStateChanged: { + // hack for nonfunctional clip property for WebView + boardComponent.hideWebView( (state !== "center") ); + } function updateLayout(){ // states diff --git a/src/ui-mobile/declarative/TopPanel.qml b/src/ui-mobile/declarative/TopPanel.qml new file mode 100644 index 0000000..4fe3065 --- /dev/null +++ b/src/ui-mobile/declarative/TopPanel.qml @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2011 Lukáš Karas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +import Qt 4.7 +import QtQuick 1.0 +import "components" + +Item { + SystemPalette{ id: syspal } + + Rectangle{ + id: topPanel + anchors{top: parent.top; left: parent.left; right: parent.right} + height: parent.height + color: "transparent" + + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.rgba(0.086, 0.086, 0.086, 1) } + GradientStop { position: 0.9; color: Qt.rgba(0.086, 0.086, 0.086, 0.9)} + GradientStop { position: 1.0; color: Qt.rgba(0.086, 0.086, 0.086, 0.5)} + } + + Component.onCompleted: { + if (main.useSyspal){ + var col = syspal.shadow; + // use system palete to gradient :) + topPanel.gradient.stops[ 0 ].color = "#ff"+(col+"").substring(1); + topPanel.gradient.stops[ 1 ].color = "#e5"+(col+"").substring(1); + topPanel.gradient.stops[ 2 ].color = "#7f"+(col+"").substring(1); + } + } + + Rectangle{ + id: topLine + anchors{top: parent.bottom; left: parent.left; right: parent.right} + height: 1 + color: "transparent" + + Image { + id: topLineImage + source: "img/line-horizontal.svg" + anchors.fill: parent + } + } + } +} diff --git a/src/ui-mobile/declarative/mainview.qml b/src/ui-mobile/declarative/mainview.qml index 8357365..54c43ec 100644 --- a/src/ui-mobile/declarative/mainview.qml +++ b/src/ui-mobile/declarative/mainview.qml @@ -23,10 +23,13 @@ import Gst 1.0 Rectangle{ id: main - color: "#161616" + SystemPalette{ id: syspal } + color: main.useSyspal? syspal.window : "#161616" width: 800 height: 600 + property bool useSyspal: true + function log(msg){ console.log("II [mainview.qml]: "+msg); } diff --git a/src/ui-mobile/resources.qrc b/src/ui-mobile/resources.qrc index de7ba33..2d2fab3 100644 --- a/src/ui-mobile/resources.qrc +++ b/src/ui-mobile/resources.qrc @@ -18,6 +18,7 @@ declarative/InputPopup.qml declarative/MessageItem.qml declarative/AbstractListViewLine.qml + declarative/TopPanel.qml declarative/Scene.qml declarative/SessionController.qml -- 2.11.4.GIT