Commit f9bebf12 authored by Ronan's avatar Ronan
Browse files

Unstable!!!

parent 06ecb0b2
......@@ -47,6 +47,7 @@ lupdate_only{
ui/modules/Linphone/Styles/Form/*.qml \
ui/modules/Linphone/View/*.qml \
ui/views/*.qml \
ui/views/Calls/*.qml \
ui/views/MainWindow/*.qml \
}
......@@ -55,6 +55,7 @@
<file>ui/modules/Linphone/Image/Icon.qml</file>
<file>ui/modules/Linphone/InvertedMouseArea.qml</file>
<file>ui/modules/Linphone/Menu.qml</file>
<file>ui/modules/Linphone/Paned.qml</file>
<file>ui/modules/Linphone/Popup/DropDownMenu.qml</file>
<file>ui/modules/Linphone/Popup/PopupShadow.qml</file>
<file>ui/modules/Linphone/qmldir</file>
......@@ -84,6 +85,7 @@
<file>ui/modules/Linphone/View/ScrollableListView.qml</file>
<file>ui/scripts/Utils/qmldir</file>
<file>ui/scripts/Utils/utils.js</file>
<file>ui/views/Calls/Calls.qml</file>
<file>ui/views/MainWindow/Contact.qml</file>
<file>ui/views/MainWindow/Contacts.qml</file>
<file>ui/views/MainWindow/Conversation.qml</file>
......
......@@ -6,7 +6,7 @@
// ===================================================================
class Notification : public QObject {
Q_OBJECT
Q_OBJECT;
public:
Notification (QObject *parent = Q_NULLPTR);
......
......@@ -6,7 +6,7 @@
#include <QQuickView>
#include <QSystemTrayIcon>
#include <QtDebug>
#include <QQmlComponent>
#include "app.hpp"
#include "components/contacts/ContactsListProxyModel.hpp"
#include "components/notification/Notification.hpp"
......@@ -57,8 +57,10 @@ void registerTypes () {
void addContextProperties (QQmlApplicationEngine &engine) {
QQmlContext *context = engine.rootContext();
QQmlComponent component(&engine, QUrl("qrc:/ui/views/Calls/Calls.qml"));
context->setContextProperty("Notification", new Notification());
context->setContextProperty("CallsWindow", component.create());
}
int main (int argc, char *argv[]) {
......@@ -77,8 +79,10 @@ int main (int argc, char *argv[]) {
engine.addImportPath(":/ui/scripts");
engine.load(QUrl("qrc:/ui/views/MainWindow/MainWindow.qml"));
if (engine.rootObjects().isEmpty())
if (engine.rootObjects().isEmpty()) {
qWarning() << "Unable to open main window.";
return EXIT_FAILURE;
}
// Enable TrayIconSystem.
if (!QSystemTrayIcon::isSystemTrayAvailable())
......
import QtQuick 2.7
Item {
id: container
property int handleLimitLeft: 0
property int handleLimitRight: 0
property alias childA: contentA.data
property alias childB: contentB.data
onWidthChanged: {
console.log('RESIZE', width, handleLimitRight)
if (contentB.width < handleLimitRight) {
console.log('lala', width, handleLimitRight, width - handle.width - handleLimitRight)
contentA.width = width - handle.width - handleLimitRight
} else if (contentA.width < handleLimitLeft) {
console.log('zaza', width, handleLimitLeft)
contentA.width = handleLimitLeft
} else if (contentA.width >= width - handleLimitRight - 20) {
console.log('FUCK', contentA.width , width - handleLimitRight - 20)
contentA.width - handle.width - handleLimitRight
}
}
Rectangle {
id: contentA
color: '#FFFFFF'
height: parent.height
}
MouseArea {
id: handle
property int _mouseStart
anchors.left: contentA.right
cursorShape: Qt.SplitHCursor
height: parent.height
hoverEnabled: true
width: 8
onMouseXChanged: {
// Necessary because `hoverEnabled` is used.
if (!pressed) {
return
}
var offset = mouseX - _mouseStart
if (container.width - offset - contentA.width - width < handleLimitRight) {
contentA.width = container.width - width - handleLimitRight
} else if (contentA.width + offset < handleLimitLeft) {
contentA.width = handleLimitLeft
} else {
contentA.width = contentA.width + offset
}
}
onPressed: _mouseStart = mouseX
Rectangle {
anchors.fill: parent
color: parent.pressed
? '#5E5E5E'
: (parent.containsMouse
? '#707070'
: '#C5C5C5'
)
}
}
Rectangle {
id: contentB
anchors.left: handle.right
color: '#EAEAEA'
height: parent.height
width: {
console.log('toto', container.width, contentA.width, container.width - contentA.width - handle.width)
return container.width - contentA.width - handle.width
}
}
}
......@@ -52,6 +52,9 @@ InvertedMouseArea 1.0 InvertedMouseArea.qml
# Menu
Menu 1.0 Menu.qml
# Paned
Paned 1.0 Paned.qml
# Popup
DropDownMenu 1.0 Popup/DropDownMenu.qml
PopupShadow 1.0 Popup/PopupShadow.qml
......
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
import QtQuick.Controls 2.0
import Linphone 1.0
Window {
minimumHeight: 480
minimumWidth: 640
id: window
Paned {
anchors.fill: parent
handleLimitLeft: parent.width *0.66
handleLimitRight: 50
childA: Text {
text: 'hello'
}
childB: Text {
text: 'hello2'
}
}
}
......@@ -98,7 +98,8 @@ ApplicationWindow {
actions: [
ActionButton {
icon: 'call'
onClicked: console.log('clicked')
onClicked: CallsWindow.show()
},
ActionButton {
......
......@@ -4,22 +4,22 @@ import QtQuick.Controls 2.0
import Linphone 1.0
DialogPlus {
centeredButtons: true
minimumHeight: 300
minimumWidth: 420
title: qsTr('newCallTitle')
centeredButtons: true
minimumHeight: 300
minimumWidth: 420
title: qsTr('newCallTitle')
buttons: TextButtonA {
text: qsTr('cancel')
}
buttons: TextButtonA {
text: qsTr('cancel')
}
Item {
anchors.fill: parent
anchors.leftMargin: 25
anchors.rightMargin: 25
Item {
anchors.fill: parent
anchors.leftMargin: 25
anchors.rightMargin: 25
SelectContact {
anchors.fill: parent
}
SelectContact {
anchors.fill: parent
}
}
}
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