Commit f9bebf12 authored by Ronan Abhamon's avatar Ronan Abhamon

Unstable!!!

parent 06ecb0b2
...@@ -47,6 +47,7 @@ lupdate_only{ ...@@ -47,6 +47,7 @@ lupdate_only{
ui/modules/Linphone/Styles/Form/*.qml \ ui/modules/Linphone/Styles/Form/*.qml \
ui/modules/Linphone/View/*.qml \ ui/modules/Linphone/View/*.qml \
ui/views/*.qml \ ui/views/*.qml \
ui/views/Calls/*.qml \
ui/views/MainWindow/*.qml \ ui/views/MainWindow/*.qml \
} }
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
<file>ui/modules/Linphone/Image/Icon.qml</file> <file>ui/modules/Linphone/Image/Icon.qml</file>
<file>ui/modules/Linphone/InvertedMouseArea.qml</file> <file>ui/modules/Linphone/InvertedMouseArea.qml</file>
<file>ui/modules/Linphone/Menu.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/DropDownMenu.qml</file>
<file>ui/modules/Linphone/Popup/PopupShadow.qml</file> <file>ui/modules/Linphone/Popup/PopupShadow.qml</file>
<file>ui/modules/Linphone/qmldir</file> <file>ui/modules/Linphone/qmldir</file>
...@@ -84,6 +85,7 @@ ...@@ -84,6 +85,7 @@
<file>ui/modules/Linphone/View/ScrollableListView.qml</file> <file>ui/modules/Linphone/View/ScrollableListView.qml</file>
<file>ui/scripts/Utils/qmldir</file> <file>ui/scripts/Utils/qmldir</file>
<file>ui/scripts/Utils/utils.js</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/Contact.qml</file>
<file>ui/views/MainWindow/Contacts.qml</file> <file>ui/views/MainWindow/Contacts.qml</file>
<file>ui/views/MainWindow/Conversation.qml</file> <file>ui/views/MainWindow/Conversation.qml</file>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// =================================================================== // ===================================================================
class Notification : public QObject { class Notification : public QObject {
Q_OBJECT Q_OBJECT;
public: public:
Notification (QObject *parent = Q_NULLPTR); Notification (QObject *parent = Q_NULLPTR);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <QQuickView> #include <QQuickView>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include <QtDebug> #include <QtDebug>
#include <QQmlComponent>
#include "app.hpp" #include "app.hpp"
#include "components/contacts/ContactsListProxyModel.hpp" #include "components/contacts/ContactsListProxyModel.hpp"
#include "components/notification/Notification.hpp" #include "components/notification/Notification.hpp"
...@@ -57,8 +57,10 @@ void registerTypes () { ...@@ -57,8 +57,10 @@ void registerTypes () {
void addContextProperties (QQmlApplicationEngine &engine) { void addContextProperties (QQmlApplicationEngine &engine) {
QQmlContext *context = engine.rootContext(); QQmlContext *context = engine.rootContext();
QQmlComponent component(&engine, QUrl("qrc:/ui/views/Calls/Calls.qml"));
context->setContextProperty("Notification", new Notification()); context->setContextProperty("Notification", new Notification());
context->setContextProperty("CallsWindow", component.create());
} }
int main (int argc, char *argv[]) { int main (int argc, char *argv[]) {
...@@ -77,8 +79,10 @@ int main (int argc, char *argv[]) { ...@@ -77,8 +79,10 @@ int main (int argc, char *argv[]) {
engine.addImportPath(":/ui/scripts"); engine.addImportPath(":/ui/scripts");
engine.load(QUrl("qrc:/ui/views/MainWindow/MainWindow.qml")); 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; return EXIT_FAILURE;
}
// Enable TrayIconSystem. // Enable TrayIconSystem.
if (!QSystemTrayIcon::isSystemTrayAvailable()) 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 ...@@ -52,6 +52,9 @@ InvertedMouseArea 1.0 InvertedMouseArea.qml
# Menu # Menu
Menu 1.0 Menu.qml Menu 1.0 Menu.qml
# Paned
Paned 1.0 Paned.qml
# Popup # Popup
DropDownMenu 1.0 Popup/DropDownMenu.qml DropDownMenu 1.0 Popup/DropDownMenu.qml
PopupShadow 1.0 Popup/PopupShadow.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 { ...@@ -98,7 +98,8 @@ ApplicationWindow {
actions: [ actions: [
ActionButton { ActionButton {
icon: 'call' icon: 'call'
onClicked: console.log('clicked') onClicked: CallsWindow.show()
}, },
ActionButton { ActionButton {
......
...@@ -4,22 +4,22 @@ import QtQuick.Controls 2.0 ...@@ -4,22 +4,22 @@ import QtQuick.Controls 2.0
import Linphone 1.0 import Linphone 1.0
DialogPlus { DialogPlus {
centeredButtons: true centeredButtons: true
minimumHeight: 300 minimumHeight: 300
minimumWidth: 420 minimumWidth: 420
title: qsTr('newCallTitle') title: qsTr('newCallTitle')
buttons: TextButtonA { buttons: TextButtonA {
text: qsTr('cancel') text: qsTr('cancel')
} }
Item { Item {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 25 anchors.leftMargin: 25
anchors.rightMargin: 25 anchors.rightMargin: 25
SelectContact { SelectContact {
anchors.fill: parent 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