mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-23 06:38:07 +00:00
fix(app): naming conventions in App.xpp and correct access to root children in Chat/Message
This commit is contained in:
parent
4ef9e4c70c
commit
69bb766ed1
3 changed files with 13 additions and 10 deletions
|
|
@ -2,7 +2,6 @@
|
|||
#include <QQmlComponent>
|
||||
#include <QQmlContext>
|
||||
#include <QQuickView>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QtDebug>
|
||||
|
||||
#include "../components/contacts/ContactsListProxyModel.hpp"
|
||||
|
|
@ -84,7 +83,7 @@ void App::addContextProperties () {
|
|||
if (component.isError()) {
|
||||
qWarning() << component.errors();
|
||||
} else {
|
||||
// context->setContextProperty("CallsWindow", component.create());
|
||||
context->setContextProperty("CallsWindow", component.create());
|
||||
}
|
||||
|
||||
// Models.
|
||||
|
|
@ -99,7 +98,7 @@ void App::addContextProperties () {
|
|||
void App::setTrayIcon () {
|
||||
QQuickWindow *root = qobject_cast<QQuickWindow *>(m_engine.rootObjects().at(0));
|
||||
QMenu *menu = new QMenu();
|
||||
QSystemTrayIcon *tray_icon = new QSystemTrayIcon(root);
|
||||
m_tray_icon = new QSystemTrayIcon(root);
|
||||
|
||||
// trayIcon: Right click actions.
|
||||
QAction *quit_action = new QAction("Quit", root);
|
||||
|
|
@ -109,7 +108,7 @@ void App::setTrayIcon () {
|
|||
root->connect(restore_action, &QAction::triggered, root, &QQuickWindow::showNormal);
|
||||
|
||||
// trayIcon: Left click actions.
|
||||
root->connect(tray_icon, &QSystemTrayIcon::activated, [root](QSystemTrayIcon::ActivationReason reason) {
|
||||
root->connect(m_tray_icon, &QSystemTrayIcon::activated, [root](QSystemTrayIcon::ActivationReason reason) {
|
||||
if (reason == QSystemTrayIcon::Trigger) {
|
||||
if (root->visibility() == QWindow::Hidden)
|
||||
root->showNormal();
|
||||
|
|
@ -123,8 +122,8 @@ void App::setTrayIcon () {
|
|||
menu->addSeparator();
|
||||
menu->addAction(quit_action);
|
||||
|
||||
tray_icon->setContextMenu(menu);
|
||||
tray_icon->setIcon(QIcon(WINDOW_ICON_PATH));
|
||||
tray_icon->setToolTip("Linphone");
|
||||
tray_icon->show();
|
||||
m_tray_icon->setContextMenu(menu);
|
||||
m_tray_icon->setIcon(QIcon(WINDOW_ICON_PATH));
|
||||
m_tray_icon->setToolTip("Linphone");
|
||||
m_tray_icon->show();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include <QApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlFileSelector>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QTranslator>
|
||||
|
||||
// ===================================================================
|
||||
|
|
@ -20,6 +21,7 @@ private:
|
|||
|
||||
QQmlApplicationEngine m_engine;
|
||||
QQmlFileSelector *m_file_selector;
|
||||
QSystemTrayIcon *m_tray_icon;
|
||||
QTranslator m_translator;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,11 @@ Item {
|
|||
var children = root.children
|
||||
|
||||
// Can be the `invertedMouseArea` of other message.
|
||||
var mouseArea = children[children.length - 1]
|
||||
var mouseArea = Utils.find(children, function (element) {
|
||||
return Utils.qmlTypeof(element, 'QQuickMouseArea')
|
||||
})
|
||||
|
||||
if (Utils.qmlTypeof(mouseArea, 'QQuickMouseArea')) {
|
||||
if (mouseArea != null) {
|
||||
mouseArea.cursorShape = hoveredLink
|
||||
? Qt.PointingHandCursor
|
||||
: Qt.ArrowCursor
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue