Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
80e643e8
Commit
80e643e8
authored
Nov 16, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(components/notifier): use a start offset
parent
4d91eb4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
App.cpp
tests/src/app/App.cpp
+6
-2
Notifier.cpp
tests/src/components/notifier/Notifier.cpp
+6
-4
No files found.
tests/src/app/App.cpp
View file @
80e643e8
...
...
@@ -14,6 +14,10 @@
#define LANGUAGES_PATH ":/languages/"
#define WINDOW_ICON_PATH ":/assets/images/linphone.png"
// The two main windows of Linphone desktop.
#define QML_VIEW_MAIN_WINDOW "qrc:/ui/views/App/MainWindow/MainWindow.qml"
#define QML_VIEW_CALL_WINDOW "qrc:/ui/views/App/Calls/Calls.qml"
// ===================================================================
App
*
App
::
m_instance
=
nullptr
;
...
...
@@ -47,7 +51,7 @@ void App::initContentApp () {
addContextProperties
();
// Load main view.
m_engine
.
load
(
QUrl
(
"qrc:/ui/views/App/MainWindow/MainWindow.qml"
));
m_engine
.
load
(
QUrl
(
QML_VIEW_MAIN_WINDOW
));
if
(
m_engine
.
rootObjects
().
isEmpty
())
qFatal
(
"Unable to open main window."
);
...
...
@@ -80,7 +84,7 @@ void App::registerTypes () {
void
App
::
addContextProperties
()
{
QQmlContext
*
context
=
m_engine
.
rootContext
();
QQmlComponent
component
(
&
m_engine
,
QUrl
(
"qrc:/ui/views/App/Calls/Calls.qml"
));
QQmlComponent
component
(
&
m_engine
,
QUrl
(
QML_VIEW_CALL_WINDOW
));
// Windows.
if
(
component
.
isError
())
{
...
...
tests/src/components/notifier/Notifier.cpp
View file @
80e643e8
...
...
@@ -4,14 +4,16 @@
#include "../../app/App.hpp"
#include "Notifier.hpp"
// Notifications QML properties/methods.
#define NOTIFICATION_SHOW_METHOD_NAME "show"
#define NOTIFICATION_EDGE_PROPERTY_NAME "edge"
#define NOTIFICATION_HEIGHT_PROPERTY "popupHeight"
#define NOTIFICATION_OFFSET_PROPERTY_NAME "edgeOffset"
// Arbitrary hardcoded values.
#define NOTIFICATION_SPACING 10
#define NOTIFICATION_START_OFFSET 30
#define N_MAX_NOTIFICATIONS 3
// ===================================================================
...
...
@@ -45,7 +47,7 @@ bool setProperty (QObject &object, const char *property, const T &value) {
// -------------------------------------------------------------------
Notifier
::
Notifier
(
QObject
*
parent
)
:
QObject
(
parent
)
{
QObject
(
parent
)
,
m_offset
(
NOTIFICATION_START_OFFSET
)
{
QQmlEngine
*
engine
=
App
::
getInstance
()
->
getEngine
();
// Build components.
...
...
@@ -101,7 +103,7 @@ void Notifier::showCallMessage (
return
;
}
m_offset
=
(
m_n_instances
==
0
?
offset
:
offset
+
m_offset
)
+
NOTIFICATION_SPACING
;
m_offset
=
(
offset
+
m_offset
)
+
NOTIFICATION_SPACING
;
m_n_instances
++
;
m_mutex
.
unlock
();
...
...
@@ -117,7 +119,7 @@ void Notifier::showCallMessage (
m_n_instances
--
;
if
(
m_n_instances
==
0
)
m_offset
=
0
;
m_offset
=
NOTIFICATION_START_OFFSET
;
m_mutex
.
unlock
();
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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