mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-04-21 21:52:03 +02:00
misc: Qt 6.2.0 initial migration
Remove unsupported QtQuick One component and it will be added back in the following patches Change-Id: Iad206a880096cf956a4220a81dca85a993721fbd
This commit is contained in:
parent
1a476218ae
commit
be41f0e7a6
197 changed files with 1137 additions and 1694 deletions
|
@ -153,27 +153,39 @@ set(COMMON_HEADERS
|
|||
${SRC_DIR}/previewengine.h)
|
||||
|
||||
set(QML_LIBS
|
||||
Qt5::Quick
|
||||
Qt5::QuickWidgets
|
||||
Qt5::Network
|
||||
Qt5::Svg
|
||||
Qt5::Sql
|
||||
Qt5::Concurrent
|
||||
Qt5::QuickControls2
|
||||
Qt5::WebEngine
|
||||
Qt5::Core
|
||||
Qt5::WebEngineWidgets)
|
||||
Qt::Quick
|
||||
Qt::Network
|
||||
Qt::NetworkAuth
|
||||
Qt::Svg
|
||||
Qt::Gui
|
||||
Qt::Qml
|
||||
Qt::QmlModels
|
||||
Qt::Positioning
|
||||
Qt::Sql
|
||||
Qt::Concurrent
|
||||
Qt::Core
|
||||
Qt::Core5Compat
|
||||
Qt::WebEngineCore
|
||||
Qt::WebEngineQuick
|
||||
Qt::WebChannel
|
||||
Qt::WebEngineWidgets)
|
||||
|
||||
set(QML_LIBS_LIST
|
||||
Core
|
||||
Concurrent
|
||||
Quick
|
||||
QuickWidgets
|
||||
Network
|
||||
NetworkAuth
|
||||
Svg
|
||||
Gui
|
||||
Qml
|
||||
QmlModels
|
||||
Positioning
|
||||
Sql
|
||||
QuickControls2
|
||||
WebEngine
|
||||
Concurrent
|
||||
Core
|
||||
Core5Compat
|
||||
WebEngineCore
|
||||
WebEngineQuick
|
||||
WebChannel
|
||||
WebEngineWidgets)
|
||||
|
||||
set(WINDOWS_SYS_LIBS Shell32.lib
|
||||
|
@ -185,6 +197,14 @@ set(WINDOWS_SYS_LIBS Shell32.lib
|
|||
Crypt32.lib
|
||||
Strmiids.lib)
|
||||
|
||||
# Here we let find_package(<PackageName>...) try to find Qt 6,
|
||||
# If it is found, find_package will succeed, and the CMake variable
|
||||
# QT_VERSION_MAJOR will be defined 6.
|
||||
find_package(QT NAMES Qt6 COMPONENTS ${QML_LIBS_LIST} REQUIRED)
|
||||
if (${QT_VERSION_MAJOR} STRLESS 6)
|
||||
message(FATAL_ERROR "We currently only support Qt6" )
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# preprocessor defines
|
||||
add_definitions(-DUNICODE -DQT_NO_DEBUG -DNDEBUG)
|
||||
|
@ -240,7 +260,7 @@ else()
|
|||
list(APPEND COMMON_HEADERS
|
||||
${SRC_DIR}/dbuserrorhandler.h
|
||||
${SRC_DIR}/xrectsel.h)
|
||||
list(APPEND QML_LIBS Qt5::DBus)
|
||||
list(APPEND QML_LIBS Qt::DBus)
|
||||
list(APPEND QML_LIBS_LIST DBus)
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
@ -318,21 +338,16 @@ else()
|
|||
endif()
|
||||
|
||||
# Qt find package
|
||||
if(QT5_VER AND QT5_PATH)
|
||||
string(REPLACE "." ";" VERSION_LIST ${QT5_VER})
|
||||
list(GET VERSION_LIST 0 QT5_VER_MAJOR)
|
||||
list(GET VERSION_LIST 1 QT5_VER_MINOR)
|
||||
list(GET VERSION_LIST 2 QT5_VER_PATCH)
|
||||
|
||||
if((${QT5_VER_MAJOR} GREATER_EQUAL 5) AND (${QT5_VER_MINOR} GREATER_EQUAL 14))
|
||||
if(QT6_VER AND QT6_PATH)
|
||||
message(STATUS "Using custom Qt version")
|
||||
find_package(Qt5 ${QT5_VER} REQUIRED COMPONENTS ${QML_LIBS_LIST}
|
||||
PATHS ${QT5_PATH} NO_DEFAULT_PATH)
|
||||
find_package(Qt5LinguistTools ${QT5_VER} PATHS ${QT5_PATH} NO_DEFAULT_PATH)
|
||||
endif()
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${QML_LIBS_LIST}
|
||||
PATHS ${QT6_PATH} NO_DEFAULT_PATH)
|
||||
# Linguist tools is not required.
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS LinguistTools
|
||||
PATHS ${QT6_PATH} NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_package(Qt5 REQUIRED COMPONENTS ${QML_LIBS_LIST})
|
||||
find_package(Qt5LinguistTools)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ${QML_LIBS_LIST})
|
||||
find_package(Qt${QT_VERSION_MAJOR}LinguistTools)
|
||||
endif()
|
||||
|
||||
# common include
|
||||
|
@ -340,7 +355,7 @@ include_directories(${PROJECT_SOURCE_DIR}
|
|||
${SRC_DIR})
|
||||
|
||||
# common executable sources
|
||||
add_executable(${PROJECT_NAME}
|
||||
qt_add_executable(${PROJECT_NAME} MANUAL_FINALIZATION
|
||||
${SRC_DIR}/main.cpp
|
||||
${COMMON_HEADERS}
|
||||
${COMMON_SOURCES}
|
||||
|
@ -352,7 +367,7 @@ if(MSVC)
|
|||
# Makes it a GUI executable instead of a console application
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
${QML_LIBS}
|
||||
${QRENCODE_LIB}
|
||||
${WINDOWS_SYS_LIBS})
|
||||
|
@ -367,14 +382,14 @@ if(MSVC)
|
|||
# executable icon
|
||||
target_sources(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/ico.rc)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
${RINGCLIENT_STATIC_LIB}
|
||||
${QTWRAPPER_LIB}
|
||||
${DRING_LIB}
|
||||
${GNUTLS_LIB})
|
||||
|
||||
# translations
|
||||
if(Qt5LinguistTools_FOUND)
|
||||
if(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
|
||||
message("Releasing and copying translation files")
|
||||
file(MAKE_DIRECTORY "${JAMI_OUTPUT_DIRECTORY_RELEASE}/share/ring/translations/")
|
||||
file(MAKE_DIRECTORY "${JAMI_OUTPUT_DIRECTORY_RELEASE}/share/libringclient/translations/")
|
||||
|
@ -384,8 +399,9 @@ if(MSVC)
|
|||
"${JAMI_OUTPUT_DIRECTORY_RELEASE}/share/ring/translations")
|
||||
set_source_files_properties(${TS_LRC_FILES} PROPERTIES OUTPUT_LOCATION
|
||||
"${JAMI_OUTPUT_DIRECTORY_RELEASE}/share/libringclient/translations")
|
||||
qt5_add_translation(QM_CLIENT_FILES ${TS_CLIENT_FILES})
|
||||
qt5_add_translation(QM_LRC_FILES ${TS_LRC_FILES})
|
||||
|
||||
qt_add_translation(QM_CLIENT_FILES ${TS_CLIENT_FILES})
|
||||
qt_add_translation(QM_LRC_FILES ${TS_LRC_FILES})
|
||||
target_sources(${PROJECT_NAME} PRIVATE ${QM_CLIENT_FILES})
|
||||
target_sources(${PROJECT_NAME} PRIVATE ${QM_LRC_FILES})
|
||||
endif()
|
||||
|
@ -426,7 +442,7 @@ if(MSVC)
|
|||
# executable name
|
||||
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "Jami")
|
||||
else()
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
${QML_LIBS}
|
||||
${LRC_LIB_NAME}
|
||||
${qrencode}
|
||||
|
@ -516,12 +532,13 @@ else()
|
|||
endif()
|
||||
|
||||
# translations
|
||||
if(Qt5LinguistTools_FOUND)
|
||||
if(Qt${QT_VERSION_MAJOR}LinguistTools_FOUND)
|
||||
message("Releasing and copying translation files")
|
||||
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/share/ring/translations/")
|
||||
file(GLOB TS_FILES ${PROJECT_SOURCE_DIR}/translations/*.ts)
|
||||
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "share/ring/translations")
|
||||
qt5_add_translation(QM_FILES ${TS_FILES})
|
||||
|
||||
qt_add_translation(QM_FILES ${TS_FILES})
|
||||
add_custom_target(translations ALL DEPENDS ${QM_FILES})
|
||||
install(DIRECTORY "${CMAKE_BINARY_DIR}/share/ring/translations/"
|
||||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/ring/translations)
|
||||
|
@ -537,6 +554,10 @@ else()
|
|||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
||||
endif()
|
||||
|
||||
|
||||
qt_import_qml_plugins(${PROJECT_NAME})
|
||||
qt_finalize_executable(${PROJECT_NAME})
|
||||
|
||||
# test
|
||||
if(ENABLE_TESTS)
|
||||
message("Add Jami tests")
|
||||
|
|
|
@ -12,7 +12,7 @@ from enum import Enum
|
|||
# vs help
|
||||
win_sdk_default = '10.0.16299.0'
|
||||
win_toolset_default = '142'
|
||||
qt_version_default = '5.15.0'
|
||||
qt_version_default = '6.2.0'
|
||||
|
||||
vs_where_path = os.path.join(
|
||||
os.environ['ProgramFiles(x86)'], 'Microsoft Visual Studio', 'Installer', 'vswhere.exe'
|
||||
|
@ -22,6 +22,7 @@ host_is_64bit = (False, True)[platform.machine().endswith('64')]
|
|||
this_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
build_dir = os.path.join(this_dir, 'build')
|
||||
temp_path = os.environ['TEMP']
|
||||
openssl_include_dir = 'C:\\Qt\\Tools\\OpenSSL\\Win_x64\\include\\openssl'
|
||||
|
||||
# project path
|
||||
jami_qt_project = os.path.join(build_dir, 'jami-qt.vcxproj')
|
||||
|
@ -214,20 +215,37 @@ def build(arch, toolset, sdk_version, config_str, project_path_under_current_pat
|
|||
|
||||
qt_dir = os.path.join("C:\\", 'Qt', qtver)
|
||||
cmake_gen = getCMakeGenerator(getLatestVSVersion())
|
||||
msvc_folder = 'msvc2019_64'
|
||||
qt_major_version = getQtVersionNumber(qtver, QtVerison.Major)
|
||||
qt_general_macro = 'Qt' + qt_major_version
|
||||
msvc_folder = '\\msvc2019_64'
|
||||
|
||||
qt_cmake_dir = qt_dir + msvc_folder + '\\lib\\cmake\\'
|
||||
cmake_prefix_path = qt_dir + msvc_folder
|
||||
|
||||
qt_cmake_dir = os.path.join(qt_dir, msvc_folder, 'lib', 'cmake')
|
||||
cmake_prefix_path = os.path.join(qt_dir, msvc_folder)
|
||||
cmake_options = [
|
||||
'-DCMAKE_PREFIX_PATH=' + cmake_prefix_path,
|
||||
'-DQt5_DIR=' + qt_cmake_dir + 'Qt5',
|
||||
'-DQt5Core_DIR=' + qt_cmake_dir + 'Qt5Core',
|
||||
'-DQt5Sql_DIR=' + qt_cmake_dir + 'Qt5Sql',
|
||||
'-DQt5LinguistTools_DIR=' + qt_cmake_dir + 'Qt5LinguistTools',
|
||||
'-DQt5Concurrent_DIR=' + qt_cmake_dir + 'Qt5Concurrent',
|
||||
'-DQt5Gui_DIR=' + qt_cmake_dir + 'Qt5Gui',
|
||||
'-DQt5Test_DIR=' + qt_cmake_dir + 'Qt5Test',
|
||||
'-DQt5QuickTest_DIR=' + qt_cmake_dir + 'Qt5QuickTest',
|
||||
'-DOPENSSL_INCLUDE_DIR=' + openssl_include_dir,
|
||||
'-DQT_DIR=' + qt_dir + msvc_folder,
|
||||
'-D' + qt_general_macro + '_DIR=' + qt_cmake_dir + qt_general_macro,
|
||||
'-D' + qt_general_macro + 'Core_DIR=' + qt_cmake_dir + qt_general_macro + 'Core',
|
||||
'-D' + qt_general_macro + 'Core5Compat_DIR=' + qt_cmake_dir + qt_general_macro + 'Core5Compat',
|
||||
'-D' + qt_general_macro + 'WebEngineCore_DIR=' + qt_cmake_dir + qt_general_macro + 'WebEngineCore',
|
||||
'-D' + qt_general_macro + 'WebEngineQuick_DIR=' + qt_cmake_dir + qt_general_macro + 'WebEngineQuick',
|
||||
'-D' + qt_general_macro + 'WebChannel_DIR=' + qt_cmake_dir + qt_general_macro + 'WebChannel',
|
||||
'-D' + qt_general_macro + 'WebEngineWidgets_DIR=' + qt_cmake_dir + qt_general_macro + 'WebEngineWidgets',
|
||||
'-D' + qt_general_macro + 'Sql_DIR=' + qt_cmake_dir + qt_general_macro + 'Sql',
|
||||
'-D' + qt_general_macro + 'LinguistTools_DIR=' + qt_cmake_dir + qt_general_macro + 'LinguistTools',
|
||||
'-D' + qt_general_macro + 'Concurrent_DIR=' + qt_cmake_dir + qt_general_macro + 'Concurrent',
|
||||
'-D' + qt_general_macro + 'Network_DIR=' + qt_cmake_dir + qt_general_macro + 'Network',
|
||||
'-D' + qt_general_macro + 'NetworkAuth_DIR=' + qt_cmake_dir + qt_general_macro + 'NetworkAuth',
|
||||
'-D' + qt_general_macro + 'Gui_DIR=' + qt_cmake_dir + qt_general_macro + 'Gui',
|
||||
'-D' + qt_general_macro + 'Qml_DIR=' + qt_cmake_dir + qt_general_macro + 'Qml',
|
||||
'-D' + qt_general_macro + 'QmlModels_DIR=' + qt_cmake_dir + qt_general_macro + 'QmlModels',
|
||||
'-D' + qt_general_macro + 'Positioning_DIR=' + qt_cmake_dir + qt_general_macro + 'Positioning',
|
||||
'-D' + qt_general_macro + 'Test_DIR=' + qt_cmake_dir + qt_general_macro + 'Test',
|
||||
'-D' + qt_general_macro + 'QuickTest_DIR=' + qt_cmake_dir + qt_general_macro + 'QuickTest',
|
||||
'-DENABLE_TESTS=' + (str("ENABLE_TESTS") if test_building_type != TestBuilding.NoTests else ''),
|
||||
'-DCMAKE_SYSTEM_VERSION=' + sdk_version
|
||||
]
|
||||
|
@ -384,6 +402,10 @@ def main():
|
|||
|
||||
parsed_args = parse_args()
|
||||
|
||||
if int(getQtVersionNumber(parsed_args.qtver, QtVerison.Major)) < 6:
|
||||
print('We currently only support Qt6')
|
||||
sys.exit(1)
|
||||
|
||||
test_building_type = TestBuilding.NoTests
|
||||
|
||||
if parsed_args.withtest:
|
||||
|
|
7
qml.qrc
7
qml.qrc
|
@ -10,7 +10,7 @@
|
|||
<file>src/commoncomponents/PasswordDialog.qml</file>
|
||||
<file>src/commoncomponents/MaterialLineEdit.qml</file>
|
||||
<file>src/commoncomponents/PhotoboothView.qml</file>
|
||||
<file>src/commoncomponents/ListViewJami.qml</file>
|
||||
<file>src/commoncomponents/JamiListView.qml</file>
|
||||
<file>src/commoncomponents/DeleteAccountDialog.qml</file>
|
||||
<file>src/commoncomponents/CustomBorder.qml</file>
|
||||
<file>src/commoncomponents/PushButton.qml</file>
|
||||
|
@ -41,8 +41,6 @@
|
|||
<file>src/settingsview/components/AudioSettings.qml</file>
|
||||
<file>src/settingsview/components/VideoSettings.qml</file>
|
||||
<file>src/settingsview/components/GeneralSettingsPage.qml</file>
|
||||
<file>src/settingsview/components/KeyBoardShortcutTable.qml</file>
|
||||
<file>src/settingsview/components/KeyBoardShortcutKey.qml</file>
|
||||
<file>src/settingsview/components/PluginSettingsPage.qml</file>
|
||||
<file>src/settingsview/components/PluginListSettingsView.qml</file>
|
||||
<file>src/settingsview/components/PluginListPreferencesView.qml</file>
|
||||
|
@ -172,5 +170,8 @@
|
|||
<file>src/commoncomponents/DataTransferMessageDelegate.qml</file>
|
||||
<file>src/mainview/components/ScrollToBottomButton.qml</file>
|
||||
<file>src/commoncomponents/TypingDots.qml</file>
|
||||
<file>src/commoncomponents/JamiScrollBar.qml</file>
|
||||
<file>qtquickcontrols2.conf</file>
|
||||
<file>src/commoncomponents/JamiFlickable.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
9
qtquickcontrols2.conf
Normal file
9
qtquickcontrols2.conf
Normal file
|
@ -0,0 +1,9 @@
|
|||
; This file can be edited to change the style of the application
|
||||
; Read "Qt Quick Controls 2 Configuration File" for details:
|
||||
; https://doc.qt.io/qt/qtquickcontrols2-configuration.html
|
||||
|
||||
[Controls]
|
||||
Style=Universal
|
||||
|
||||
[Universal]
|
||||
Theme=Light
|
|
@ -16,11 +16,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Controls.Universal 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
import net.jami.Models 1.1
|
||||
|
@ -33,8 +32,6 @@ ApplicationWindow {
|
|||
property bool connectionFailed: false
|
||||
property int preferredMargin: 15
|
||||
|
||||
Universal.theme: Universal.Light
|
||||
|
||||
title: "Jami"
|
||||
|
||||
width: 600
|
||||
|
@ -201,7 +198,7 @@ ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
overlay.modal: ColorOverlay {
|
||||
Overlay.modal: ColorOverlay {
|
||||
source: root.contentItem
|
||||
color: "transparent"
|
||||
|
||||
|
|
|
@ -20,12 +20,11 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Controls.Universal 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
@ -40,55 +39,18 @@ import "commoncomponents"
|
|||
ApplicationWindow {
|
||||
id: root
|
||||
|
||||
property ApplicationWindow appWindow : root
|
||||
|
||||
// To facilitate reparenting of the callview during
|
||||
// fullscreen mode, we need QQuickItem based object.
|
||||
Item {
|
||||
id: appContainer
|
||||
anchors.fill: parent
|
||||
}
|
||||
property bool isFullScreen: false
|
||||
visibility: !visible ?
|
||||
Window.Hidden : (isFullScreen ?
|
||||
Window.FullScreen :
|
||||
Window.Windowed)
|
||||
function toggleFullScreen() {
|
||||
isFullScreen = !isFullScreen
|
||||
}
|
||||
|
||||
enum LoadedSource {
|
||||
WizardView = 0,
|
||||
MainView,
|
||||
None
|
||||
}
|
||||
|
||||
Universal.theme: Universal.Light
|
||||
property ApplicationWindow appWindow : root
|
||||
property bool isFullScreen: false
|
||||
|
||||
title: JamiStrings.appTitle
|
||||
|
||||
width: {
|
||||
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
|
||||
return JamiTheme.wizardViewMinWidth
|
||||
return JamiTheme.mainViewPreferredWidth
|
||||
function toggleFullScreen() {
|
||||
isFullScreen = !isFullScreen
|
||||
}
|
||||
height: {
|
||||
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
|
||||
return JamiTheme.wizardViewMinHeight
|
||||
return JamiTheme.mainViewPreferredHeight
|
||||
}
|
||||
minimumWidth: {
|
||||
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
|
||||
return JamiTheme.wizardViewMinWidth
|
||||
return JamiTheme.mainViewMinWidth
|
||||
}
|
||||
minimumHeight: {
|
||||
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
|
||||
return JamiTheme.wizardViewMinHeight
|
||||
return JamiTheme.mainViewMinHeight
|
||||
}
|
||||
|
||||
visible: mainApplicationLoader.status === Loader.Ready
|
||||
|
||||
function checkLoadedSource() {
|
||||
var sourceString = mainApplicationLoader.source.toString()
|
||||
|
@ -123,6 +85,44 @@ ApplicationWindow {
|
|||
hide()
|
||||
}
|
||||
|
||||
visibility: !visible ?
|
||||
Window.Hidden : (isFullScreen ?
|
||||
Window.FullScreen :
|
||||
Window.Windowed)
|
||||
|
||||
title: JamiStrings.appTitle
|
||||
|
||||
width: {
|
||||
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
|
||||
return JamiTheme.wizardViewMinWidth
|
||||
return JamiTheme.mainViewPreferredWidth
|
||||
}
|
||||
height: {
|
||||
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
|
||||
return JamiTheme.wizardViewMinHeight
|
||||
return JamiTheme.mainViewPreferredHeight
|
||||
}
|
||||
minimumWidth: {
|
||||
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
|
||||
return JamiTheme.wizardViewMinWidth
|
||||
return JamiTheme.mainViewMinWidth
|
||||
}
|
||||
minimumHeight: {
|
||||
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
|
||||
return JamiTheme.wizardViewMinHeight
|
||||
return JamiTheme.mainViewMinHeight
|
||||
}
|
||||
|
||||
visible: mainApplicationLoader.status === Loader.Ready
|
||||
|
||||
// To facilitate reparenting of the callview during
|
||||
// fullscreen mode, we need QQuickItem based object.
|
||||
Item {
|
||||
id: appContainer
|
||||
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
AccountMigrationDialog {
|
||||
id: accountMigrationDialog
|
||||
|
||||
|
@ -165,17 +165,6 @@ ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
overlay.modal: ColorOverlay {
|
||||
source: root.contentItem
|
||||
color: "transparent"
|
||||
|
||||
// Color animation for overlay when pop up is shown.
|
||||
ColorAnimation on color {
|
||||
to: Qt.rgba(0, 0, 0, 0.33)
|
||||
duration: 500
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: LRCInstance
|
||||
|
||||
|
@ -220,6 +209,17 @@ ApplicationWindow {
|
|||
}
|
||||
}
|
||||
|
||||
Overlay.modal: ColorOverlay {
|
||||
source: root.contentItem
|
||||
color: "transparent"
|
||||
|
||||
// Color animation for overlay when pop up is shown.
|
||||
ColorAnimation on color {
|
||||
to: Qt.rgba(0, 0, 0, 0.33)
|
||||
duration: 500
|
||||
}
|
||||
}
|
||||
|
||||
onClosing: root.close()
|
||||
|
||||
onScreenChanged: JamiQmlUtils.mainApplicationScreen = root.screen
|
||||
|
|
|
@ -144,7 +144,7 @@ AccountAdapter::createJamiAccount(QString registeredName,
|
|||
|
||||
connectFailure();
|
||||
|
||||
QtConcurrent::run([this, settings] {
|
||||
auto futureResult = QtConcurrent::run([this, settings] {
|
||||
lrcInstance_->accountModel().createNewAccount(lrc::api::profile::Type::JAMI,
|
||||
settings["alias"].toString(),
|
||||
settings["archivePath"].toString(),
|
||||
|
@ -189,7 +189,7 @@ AccountAdapter::createSIPAccount(const QVariantMap& settings)
|
|||
|
||||
connectFailure();
|
||||
|
||||
QtConcurrent::run([this, settings] {
|
||||
auto futureResult = QtConcurrent::run([this, settings] {
|
||||
lrcInstance_->accountModel().createNewAccount(lrc::api::profile::Type::SIP,
|
||||
settings["alias"].toString(),
|
||||
settings["archivePath"].toString(),
|
||||
|
@ -233,7 +233,7 @@ AccountAdapter::createJAMSAccount(const QVariantMap& settings)
|
|||
|
||||
connectFailure();
|
||||
|
||||
QtConcurrent::run([this, settings] {
|
||||
auto futureResult = QtConcurrent::run([this, settings] {
|
||||
lrcInstance_->accountModel().connectToAccountManager(settings["username"].toString(),
|
||||
settings["password"].toString(),
|
||||
settings["manager"].toString());
|
||||
|
@ -278,7 +278,7 @@ AccountAdapter::setCurrAccDisplayName(const QString& text)
|
|||
void
|
||||
AccountAdapter::setCurrentAccountAvatarFile(const QString& source)
|
||||
{
|
||||
QtConcurrent::run([this, source]() {
|
||||
auto futureResult = QtConcurrent::run([this, source]() {
|
||||
QPixmap image;
|
||||
if (!image.load(source)) {
|
||||
qWarning() << "Not a valid image file";
|
||||
|
@ -298,7 +298,7 @@ AccountAdapter::setCurrentAccountAvatarFile(const QString& source)
|
|||
void
|
||||
AccountAdapter::setCurrentAccountAvatarBase64(const QString& data)
|
||||
{
|
||||
QtConcurrent::run([this, data]() {
|
||||
auto futureResult = QtConcurrent::run([this, data]() {
|
||||
auto accountId = lrcInstance_->get_currentAccountId();
|
||||
lrcInstance_->accountModel().setAvatar(accountId, data);
|
||||
});
|
||||
|
@ -346,7 +346,7 @@ AccountAdapter::exportToFile(const QString& accountId,
|
|||
void
|
||||
AccountAdapter::setArchivePasswordAsync(const QString& accountID, const QString& password)
|
||||
{
|
||||
QtConcurrent::run([this, accountID, password] {
|
||||
auto futureResult = QtConcurrent::run([this, accountID, password] {
|
||||
auto config = lrcInstance_->accountModel().getAccountConfig(accountID);
|
||||
config.archivePassword = password;
|
||||
lrcInstance_->accountModel().setAccountConfig(accountID, config);
|
||||
|
|
|
@ -129,7 +129,7 @@ AvAdapter::shareAllScreens()
|
|||
void
|
||||
AvAdapter::captureScreen(int screenNumber)
|
||||
{
|
||||
QtConcurrent::run([this, screenNumber]() {
|
||||
auto futureResult = QtConcurrent::run([this, screenNumber]() {
|
||||
QScreen* screen = QGuiApplication::screens().at(screenNumber);
|
||||
if (!screen)
|
||||
return;
|
||||
|
@ -149,7 +149,7 @@ AvAdapter::captureScreen(int screenNumber)
|
|||
void
|
||||
AvAdapter::captureAllScreens()
|
||||
{
|
||||
QtConcurrent::run([this]() {
|
||||
auto futureResult = QtConcurrent::run([this]() {
|
||||
auto screens = QGuiApplication::screens();
|
||||
|
||||
QList<QPixmap> scrs;
|
||||
|
@ -338,7 +338,7 @@ AvAdapter::getScreenNumber() const
|
|||
// Get display
|
||||
QString display_env {getenv("DISPLAY")};
|
||||
if (!display_env.isEmpty()) {
|
||||
auto list = display_env.split(':', QString::SplitBehavior::SkipEmptyParts);
|
||||
auto list = display_env.split(':', Qt::SkipEmptyParts);
|
||||
// Should only be one display, so get the first one
|
||||
if (list.size() > 0) {
|
||||
display = list.at(0).toInt();
|
||||
|
|
|
@ -344,10 +344,9 @@ CallOverlayModel::eventFilter(QObject* object, QEvent* event)
|
|||
{
|
||||
if (event->type() == QEvent::MouseMove) {
|
||||
auto mouseEvent = static_cast<QMouseEvent*>(event);
|
||||
QPoint eventPos(mouseEvent->x(), mouseEvent->y());
|
||||
auto windowItem = static_cast<QQuickWindow*>(object)->contentItem();
|
||||
Q_FOREACH (const auto& item, watchedItems_) {
|
||||
if (item->contains(windowItem->mapToItem(item, eventPos))) {
|
||||
if (item->contains(windowItem->mapToItem(item, mouseEvent->pos()))) {
|
||||
Q_EMIT mouseMoved(item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
@ -194,7 +194,6 @@ Window {
|
|||
visible: false
|
||||
|
||||
title: JamiStrings.authenticate
|
||||
modality: Qt.WindowModal
|
||||
flags: Qt.WindowStaysOnTopHint
|
||||
|
||||
width: 600
|
||||
|
@ -504,7 +503,7 @@ Window {
|
|||
onSpinnerDisplyStateChanged: {
|
||||
switch (spinnerDisplyState) {
|
||||
case "spinnerLabel_Regular":
|
||||
background = Qt.createQmlObject("import QtQuick 2.15;
|
||||
background = Qt.createQmlObject("import QtQuick;
|
||||
import \"qrc:/src/constant/\";
|
||||
AnimatedImage {
|
||||
source: JamiResources.jami_eclipse_spinner_gif
|
||||
|
@ -514,7 +513,7 @@ Window {
|
|||
mipmap: true}", spinnerLabel)
|
||||
break
|
||||
case "spinnerLabel_Failure":
|
||||
background = Qt.createQmlObject("import QtQuick 2.15;
|
||||
background = Qt.createQmlObject("import QtQuick;
|
||||
import \"qrc:/src/constant/\";
|
||||
Image {
|
||||
anchors.fill: parent;
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
@ -64,7 +64,7 @@ Item {
|
|||
}
|
||||
|
||||
Connections {
|
||||
target: ScreenInfo
|
||||
target: CurrentScreenInfo
|
||||
|
||||
function onDevicePixelRatioChanged() {
|
||||
image.updateSource()
|
||||
|
@ -94,7 +94,7 @@ Item {
|
|||
}
|
||||
|
||||
opacity: status === Image.Ready
|
||||
scale: Math.min(opacity + 0.5, 1.0)
|
||||
scale: Math.min(image.opacity + 0.5, 1.0)
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Dialogs 1.3
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Dialog {
|
||||
id: root
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
// Inspired by
|
||||
// https://stackoverflow.com/questions/16534489/qml-control-border-width-and-color-on-any-one-side-of-rectangle-element
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
import net.jami.Models 1.1
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtWebEngine 1.10
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import QtWebEngine
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtWebEngine 1.10
|
||||
import QtWebChannel 1.15
|
||||
import QtQuick
|
||||
import QtWebEngine
|
||||
import QtWebChannel
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
@ -50,14 +50,14 @@ WebEngineView {
|
|||
id: webViewChannel
|
||||
}
|
||||
|
||||
onNavigationRequested: {
|
||||
onNavigationRequested: function (request) {
|
||||
if (request.navigationType === WebEngineView.LinkClickedNavigation) {
|
||||
MessagesAdapter.openUrl(request.url)
|
||||
request.action = WebEngineView.IgnoreRequest
|
||||
}
|
||||
}
|
||||
|
||||
onContextMenuRequested: {
|
||||
onContextMenuRequested: function (request) {
|
||||
var needContextMenu = request.selectedText.length || request.isContentEditable
|
||||
if (!needContextMenu)
|
||||
request.accepted = true
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import Qt.labs.platform 1.1
|
||||
import QtQuick
|
||||
import Qt.labs.platform
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
50
src/commoncomponents/JamiFlickable.qml
Normal file
50
src/commoncomponents/JamiFlickable.qml
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright (C) 2020 by Savoir-faire Linux
|
||||
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
||||
*
|
||||
* 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 3 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, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
Flickable {
|
||||
id: root
|
||||
|
||||
property bool attachedFlickableMoving: root.moving
|
||||
property alias verticalHandleColor: verticalScrollBar.handleColor
|
||||
property alias horizontalHandleColor: horizontalScrollBar.handleColor
|
||||
|
||||
maximumFlickVelocity: 1024
|
||||
clip: true
|
||||
|
||||
ScrollBar.vertical: JamiScrollBar {
|
||||
id: verticalScrollBar
|
||||
|
||||
attachedFlickableMoving: root.attachedFlickableMoving
|
||||
}
|
||||
ScrollBar.horizontal: JamiScrollBar {
|
||||
id: horizontalScrollBar
|
||||
|
||||
attachedFlickableMoving: root.attachedFlickableMoving
|
||||
orientation: Qt.Horizontal
|
||||
}
|
||||
|
||||
Keys.onLeftPressed: horizontalScrollBar.decrease()
|
||||
Keys.onRightPressed: horizontalScrollBar.increase()
|
||||
Keys.onUpPressed: verticalScrollBar.decrease()
|
||||
Keys.onDownPressed: verticalScrollBar.increase()
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2020 by Savoir-faire Linux
|
||||
* Author: Yang Wang <yang.wang@savoirfairelinux.com>
|
||||
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -16,32 +17,24 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
Rectangle {
|
||||
id: listViewBackground
|
||||
|
||||
property alias model: listView.model
|
||||
property alias delegate: listView.delegate
|
||||
property alias currentIndex: listView.currentIndex
|
||||
|
||||
border.width: 0
|
||||
|
||||
color: JamiTheme.backgroundColor
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
id: root
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
visible: listViewBackground.visible
|
||||
layer.mipmap: false
|
||||
clip: true
|
||||
maximumFlickVelocity: 1024
|
||||
|
||||
ScrollBar.vertical: ScrollBar { }
|
||||
ScrollBar.vertical: JamiScrollBar {
|
||||
id: verticalScrollBar
|
||||
|
||||
attachedFlickableMoving: root.moving
|
||||
}
|
||||
|
||||
Keys.onUpPressed: verticalScrollBar.decrease()
|
||||
Keys.onDownPressed: verticalScrollBar.increase()
|
||||
}
|
84
src/commoncomponents/JamiScrollBar.qml
Normal file
84
src/commoncomponents/JamiScrollBar.qml
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* Copyright (C) 2020 by Savoir-faire Linux
|
||||
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
||||
*
|
||||
* 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 3 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, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
// Assumed to be attached to Flickable
|
||||
ScrollBar {
|
||||
id: root
|
||||
|
||||
property bool attachedFlickableMoving: false
|
||||
property alias handleColor: scrollBarRect.color
|
||||
|
||||
active: {
|
||||
if (root.orientation === Qt.Horizontal)
|
||||
return visible
|
||||
else
|
||||
return hovered || pressed || attachedFlickableMoving
|
||||
}
|
||||
hoverEnabled: true
|
||||
orientation: Qt.Vertical
|
||||
|
||||
topPadding: root.orientation === Qt.Vertical ? 2 : 0
|
||||
leftPadding: root.orientation === Qt.Horizontal ? 2 : 0
|
||||
bottomPadding: 2
|
||||
rightPadding: 2
|
||||
|
||||
contentItem: Rectangle {
|
||||
id: scrollBarRect
|
||||
|
||||
implicitHeight: JamiTheme.scrollBarHandleSize
|
||||
implicitWidth: JamiTheme.scrollBarHandleSize
|
||||
radius: width / 2
|
||||
color: pressed ? Qt.darker(JamiTheme.scrollBarHandleColor, 2.0) :
|
||||
JamiTheme.scrollBarHandleColor
|
||||
opacity: 0
|
||||
|
||||
states: State {
|
||||
name: "active"
|
||||
when: root.policy === ScrollBar.AlwaysOn ||
|
||||
(root.active && root.size < 1.0)
|
||||
PropertyChanges {
|
||||
target: root.contentItem
|
||||
opacity: 1
|
||||
}
|
||||
}
|
||||
|
||||
transitions: Transition {
|
||||
from: "active"
|
||||
SequentialAnimation {
|
||||
PauseAnimation { duration: JamiTheme.longFadeDuration }
|
||||
NumberAnimation { target: root.contentItem
|
||||
duration: JamiTheme.shortFadeDuration
|
||||
property: "opacity"
|
||||
to: 0.0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: scrollBarRect.implicitHeight
|
||||
implicitWidth: scrollBarRect.implicitWidth
|
||||
color: JamiTheme.transparentColor
|
||||
radius: width / 2
|
||||
}
|
||||
}
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
@ -62,8 +62,8 @@ TextField {
|
|||
color: readOnly? "transparent" : backgroundColor
|
||||
}
|
||||
|
||||
onReleased: {
|
||||
if (event.button == Qt.RightButton)
|
||||
onReleased: function (event) {
|
||||
if (event.button === Qt.RightButton)
|
||||
lineEditContextMenu.openMenuAt(event)
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ TextField {
|
|||
// Use editingFinished when the info is saved by focus lost
|
||||
// (since losing focus will also emit editingFinished)
|
||||
// Use accepted when the info is not saved by focus lost
|
||||
Keys.onPressed: {
|
||||
Keys.onPressed: function (event) {
|
||||
if (event.key === Qt.Key_Enter ||
|
||||
event.key === Qt.Key_Return) {
|
||||
if (loseFocusWhenEnterPressed)
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtGraphicalEffects 1.0
|
||||
import QtQuick
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
@ -29,11 +29,6 @@ Popup {
|
|||
property bool autoClose: true
|
||||
property alias backgroundColor: container.color
|
||||
|
||||
onContentItemChanged: {
|
||||
if(root.contentItem !== null)
|
||||
root.contentItem.parent = container
|
||||
}
|
||||
|
||||
parent: Overlay.overlay
|
||||
|
||||
// center in parent
|
||||
|
@ -65,9 +60,9 @@ Popup {
|
|||
horizontalOffset: 3.0
|
||||
verticalOffset: 3.0
|
||||
radius: container.radius * 4
|
||||
samples: JamiTheme.modalPopupDropShadowSamples
|
||||
color: JamiTheme.shadowColor
|
||||
source: container
|
||||
transparentBorder: true
|
||||
}
|
||||
|
||||
enter: Transition {
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import Qt.labs.platform 1.1
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Qt.labs.platform
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
import net.jami.Helpers 1.1
|
||||
|
@ -48,7 +48,7 @@ Item {
|
|||
height: Math.trunc(containerHeight * Math.sqrt(2) * 0.5) + 3 - padding
|
||||
|
||||
Connections {
|
||||
target: ScreenInfo
|
||||
target: CurrentScreenInfo
|
||||
|
||||
function onDevicePixelRatioChanged() {
|
||||
image.setSourceSize()
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
// UI dev tool to visualize components/layouts
|
||||
Rectangle {
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
@ -111,19 +111,18 @@ ComboBox {
|
|||
}
|
||||
|
||||
popup: Popup {
|
||||
id: popup
|
||||
|
||||
y: root.height - 1
|
||||
width: root.width
|
||||
implicitHeight: contentItem.implicitHeight
|
||||
padding: 1
|
||||
|
||||
contentItem: ListView {
|
||||
contentItem: JamiListView {
|
||||
id: listView
|
||||
|
||||
clip: true
|
||||
implicitHeight: contentHeight
|
||||
implicitHeight: popup.contentHeight
|
||||
model: root.delegateModel
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
@ -111,8 +111,8 @@ Menu {
|
|||
horizontalOffset: 3.0
|
||||
verticalOffset: 3.0
|
||||
radius: 16.0
|
||||
samples: 16
|
||||
color: JamiTheme.shadowColor
|
||||
transparentBorder: true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import "../../commoncomponents/contextmenu"
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
@ -54,10 +54,13 @@ MenuItem {
|
|||
|
||||
background: Rectangle {
|
||||
id: background
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 1
|
||||
anchors.rightMargin: 1
|
||||
color: "transparent"
|
||||
|
||||
color: menuItemContentRect.hovered ?
|
||||
JamiTheme.hoverColor : JamiTheme.backgroundColor
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
|
@ -127,25 +130,6 @@ MenuItem {
|
|||
menuItem.clicked()
|
||||
parentMenu.close()
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "hovered"
|
||||
when: hovered
|
||||
PropertyChanges {
|
||||
target: background
|
||||
color: JamiTheme.hoverColor
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "normal"
|
||||
when: !hovered
|
||||
PropertyChanges {
|
||||
target: background
|
||||
color: JamiTheme.backgroundColor
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
highlighted: true
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtWebEngine 1.10
|
||||
import QtWebChannel 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtWebEngine
|
||||
import QtWebChannel
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
@ -82,8 +82,8 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
onLoadingChanged: {
|
||||
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
|
||||
onLoadingChanged: function (loadingInfo) {
|
||||
if (loadingInfo.status === WebEngineView.LoadSucceededStatus) {
|
||||
emojiPickerWebView.runJavaScript(UtilsAdapter.qStringFromFile(
|
||||
":qwebchannel.js"))
|
||||
emojiPickerWebView.runJavaScript(
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// JamiQmlUtils as a singleton is to provide global property entry
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// JamiStrings as a singleton is to provide global strings entries.
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import net.jami.Helpers 1.1
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// JamiTheme as a singleton is to provide global theme property entry.
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Enums 1.1
|
||||
|
@ -173,6 +173,9 @@ Item {
|
|||
// Files To Send Container
|
||||
property color removeFileButtonColor: Qt.rgba(96, 95, 97, 0.5)
|
||||
|
||||
// JamiScrollBar
|
||||
property color scrollBarHandleColor: "#cecece"
|
||||
|
||||
// TypingDots
|
||||
property color typingDotsNormalColor: darkTheme ? "#686b72" : "lightgrey"
|
||||
property color typingDotsEnlargeColor: darkTheme ? "white" : Qt.darker("lightgrey", 3.0)
|
||||
|
@ -194,6 +197,7 @@ Item {
|
|||
property color bgDarkMode_: rgba256(32, 32, 32, 100)
|
||||
|
||||
property int shortFadeDuration: 150
|
||||
property int longFadeDuration: 400
|
||||
property int recordBlinkDuration: 500
|
||||
property int overlayFadeDelay: 4000
|
||||
property int overlayFadeDuration: 250
|
||||
|
@ -274,7 +278,6 @@ Item {
|
|||
|
||||
// Modal Popup
|
||||
property real modalPopupRadius: 4
|
||||
property real modalPopupDropShadowSamples: 16
|
||||
|
||||
// MessageWebView
|
||||
property real chatViewHairLineSize: 1
|
||||
|
@ -336,6 +339,9 @@ Item {
|
|||
property real usernameLineEditPointSize: 9
|
||||
property real usernameLineEditlookupInterval: 200
|
||||
|
||||
// JamiScrollBar
|
||||
property int scrollBarHandleSize: 6
|
||||
|
||||
// Main application spec
|
||||
property real mainViewMinWidth: 332
|
||||
property real mainViewMinHeight: 500
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
pragma Singleton
|
||||
import QtQml 2.15
|
||||
import QtQml
|
||||
QtObject {
|
||||
//readonly property int unknown: -1
|
||||
readonly property int single: 0
|
||||
|
|
|
@ -49,18 +49,20 @@ ContactAdapter::getContactSelectableModel(int type)
|
|||
// Adjust filter.
|
||||
switch (listModeltype_) {
|
||||
case SmartListModel::Type::CONVERSATION:
|
||||
selectableProxyModel_->setPredicate([this](const QModelIndex& index, const QRegExp&) {
|
||||
selectableProxyModel_->setPredicate(
|
||||
[this](const QModelIndex& index, const QRegularExpression&) {
|
||||
return !defaultModerators_.contains(index.data(Role::URI).toString());
|
||||
});
|
||||
break;
|
||||
|
||||
case SmartListModel::Type::CONFERENCE:
|
||||
selectableProxyModel_->setPredicate([](const QModelIndex& index, const QRegExp&) {
|
||||
selectableProxyModel_->setPredicate([](const QModelIndex& index, const QRegularExpression&) {
|
||||
return index.data(Role::Presence).toBool();
|
||||
});
|
||||
break;
|
||||
case SmartListModel::Type::TRANSFER:
|
||||
selectableProxyModel_->setPredicate([this](const QModelIndex& index, const QRegExp& regexp) {
|
||||
selectableProxyModel_->setPredicate([this](const QModelIndex& index,
|
||||
const QRegularExpression& regexp) {
|
||||
// Exclude current sip callee and filtered contact.
|
||||
bool match = true;
|
||||
const auto& conv = lrcInstance_->getConversationFromConvUid(
|
||||
|
@ -70,12 +72,13 @@ ContactAdapter::getContactSelectableModel(int type)
|
|||
->getAccountInfo(lrcInstance_->get_currentAccountId())
|
||||
.contactModel->bestIdForContact(conv.participants[0]);
|
||||
|
||||
QRegExp matchExcept = QRegExp(QString("\\b(?!" + calleeDisplayId + "\\b)\\w+"));
|
||||
match = matchExcept.indexIn(index.data(Role::BestId).toString()) != -1;
|
||||
QRegularExpression matchExcept = QRegularExpression(
|
||||
QString("\\b(?!" + calleeDisplayId + "\\b)\\w+"));
|
||||
match = matchExcept.match(index.data(Role::BestId).toString()).hasMatch();
|
||||
}
|
||||
|
||||
if (match) {
|
||||
match = regexp.indexIn(index.data(Role::BestId).toString()) != -1;
|
||||
match = regexp.match(index.data(Role::BestId).toString()).hasMatch();
|
||||
}
|
||||
return match && !index.parent().isValid();
|
||||
});
|
||||
|
@ -95,13 +98,13 @@ ContactAdapter::setSearchFilter(const QString& filter)
|
|||
smartListModel_->setConferenceableFilter(filter);
|
||||
} else if (listModeltype_ == SmartListModel::Type::CONVERSATION) {
|
||||
selectableProxyModel_->setPredicate(
|
||||
[this, filter](const QModelIndex& index, const QRegExp&) {
|
||||
[this, filter](const QModelIndex& index, const QRegularExpression&) {
|
||||
return (!defaultModerators_.contains(index.data(Role::URI).toString())
|
||||
&& index.data(Role::Title).toString().contains(filter));
|
||||
});
|
||||
}
|
||||
selectableProxyModel_->setFilterRegExp(
|
||||
QRegExp(filter, Qt::CaseInsensitive, QRegExp::FixedString));
|
||||
selectableProxyModel_->setFilterRegularExpression(
|
||||
QRegularExpression(filter, QRegularExpression::CaseInsensitiveOption));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -190,6 +193,7 @@ ContactAdapter::contactSelected(int index)
|
|||
void
|
||||
ContactAdapter::connectSignals()
|
||||
{
|
||||
if (lrcInstance_->getCurrentContactModel())
|
||||
connect(lrcInstance_->getCurrentContactModel(),
|
||||
&ContactModel::bannedStatusChanged,
|
||||
this,
|
||||
|
|
|
@ -42,7 +42,7 @@ class SelectableProxyModel final : public QSortFilterProxyModel
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
using FilterPredicate = std::function<bool(const QModelIndex&, const QRegExp&)>;
|
||||
using FilterPredicate = std::function<bool(const QModelIndex&, const QRegularExpression&)>;
|
||||
|
||||
explicit SelectableProxyModel(QObject* parent = nullptr)
|
||||
: QSortFilterProxyModel(parent)
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
{
|
||||
// Accept all contacts in conversation list filtered with account type, except those in a call.
|
||||
auto index = sourceModel()->index(sourceRow, 0, sourceParent);
|
||||
return filterPredicate_ ? filterPredicate_(index, filterRegExp()) : false;
|
||||
return filterPredicate_ ? filterPredicate_(index, filterRegularExpression()) : false;
|
||||
}
|
||||
|
||||
bool lessThan(const QModelIndex& left, const QModelIndex& right) const override
|
||||
|
|
|
@ -93,7 +93,7 @@ bool
|
|||
ConversationListProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const
|
||||
{
|
||||
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
|
||||
auto rx = filterRegExp();
|
||||
auto rx = filterRegularExpression();
|
||||
auto uriStripper = URI(rx.pattern());
|
||||
bool stripScheme = (uriStripper.schemeType() < URI::SchemeType::COUNT__);
|
||||
FlagPack<URI::Section> flags = URI::Section::USER_INFO | URI::Section::HOSTNAME
|
||||
|
@ -118,16 +118,18 @@ ConversationListProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& s
|
|||
|
||||
// banned contacts require exact match
|
||||
if (index.data(Role::IsBanned).toBool()) {
|
||||
if (!rx.isEmpty()) {
|
||||
Q_FOREACH (const auto& filter, toFilter)
|
||||
if (rx.exactMatch(filter)) {
|
||||
if (!rx.isValid()) {
|
||||
Q_FOREACH (const auto& filter, toFilter) {
|
||||
auto matchResult = rx.match(filter);
|
||||
if (matchResult.hasMatch() && matchResult.captured(0) == filter) {
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Q_FOREACH (const auto& filter, toFilter)
|
||||
if (rx.indexIn(filter) != -1) {
|
||||
if (rx.match(filter).hasMatch()) {
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ ConversationListModelBase::dataForItem(item_t item, int role) const
|
|||
if (!draft.isEmpty()) {
|
||||
// Pencil Emoji
|
||||
uint cp = 0x270F;
|
||||
auto emojiString = QString::fromUcs4(&cp, 1);
|
||||
auto emojiString = QString::fromUcs4(reinterpret_cast<char32_t*>(&cp), 1);
|
||||
return emojiString + draft;
|
||||
}
|
||||
}
|
||||
|
|
16
src/main.cpp
16
src/main.cpp
|
@ -24,7 +24,8 @@
|
|||
|
||||
#include <QCryptographicHash>
|
||||
#include <QApplication>
|
||||
#include <QtWebEngine>
|
||||
#include <QtWebEngineCore>
|
||||
#include <QtWebEngineQuick>
|
||||
|
||||
#include <clocale>
|
||||
|
||||
|
@ -74,23 +75,16 @@ main(int argc, char* argv[])
|
|||
#endif
|
||||
#endif
|
||||
qtWebEngineChromiumFlags << disableWebSecurity;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
|
||||
// To be recovered in Qt 6.2 and above
|
||||
// https://bugs.chromium.org/p/chromium/issues/detail?id=1060099#c6*/
|
||||
qtWebEngineChromiumFlags << singleProcess;
|
||||
#endif
|
||||
|
||||
QtWebEngineQuick::initialize();
|
||||
|
||||
QApplication::setApplicationName("Jami");
|
||||
QApplication::setOrganizationDomain("jami.net");
|
||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true);
|
||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
QApplication::setQuitOnLastWindowClosed(false);
|
||||
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
|
||||
QCoreApplication::setApplicationVersion(QString(VERSION_STRING));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
QApplication::setHighDpiScaleFactorRoundingPolicy(
|
||||
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||
#endif
|
||||
QtWebEngine::initialize();
|
||||
|
||||
auto newArgv = parseInputArgument(argc, argv, qtWebEngineChromiumFlags);
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ ScreenInfo::setCurrentFocusWindow(QWindow* window)
|
|||
{
|
||||
if (window && !currentFocusWindow_) {
|
||||
currentFocusWindow_ = window;
|
||||
setDevicePixelRatio(currentFocusWindow_->screen()->devicePixelRatio());
|
||||
set_devicePixelRatio(currentFocusWindow_->screen()->devicePixelRatio());
|
||||
|
||||
disconnect(devicePixelRatioConnection_);
|
||||
disconnect(currentFocusWindowScreenConnection_);
|
||||
|
@ -105,11 +105,11 @@ ScreenInfo::setCurrentFocusWindow(QWindow* window)
|
|||
currentFocusWindowScreenConnection_
|
||||
= connect(currentFocusWindow_, &QWindow::screenChanged, [this] {
|
||||
currentFocusWindowScreen_ = currentFocusWindow_->screen();
|
||||
setDevicePixelRatio(currentFocusWindowScreen_->devicePixelRatio());
|
||||
set_devicePixelRatio(currentFocusWindowScreen_->devicePixelRatio());
|
||||
|
||||
devicePixelRatioConnection_ = connect(
|
||||
currentFocusWindowScreen_, &QScreen::physicalDotsPerInchChanged, [this] {
|
||||
setDevicePixelRatio(currentFocusWindowScreen_->devicePixelRatio());
|
||||
set_devicePixelRatio(currentFocusWindowScreen_->devicePixelRatio());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -270,12 +270,14 @@ MainApplication::loadTranslations()
|
|||
QTranslator* qtTranslator_name = new QTranslator(this);
|
||||
if (locale_name != locale_lang) {
|
||||
if (qtTranslator_lang->load("qt_" + locale_lang,
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
|
||||
QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
|
||||
installTranslator(qtTranslator_lang);
|
||||
}
|
||||
qtTranslator_name->load("qt_" + locale_name,
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
|
||||
if (qtTranslator_name->load("qt_" + locale_name,
|
||||
QLibraryInfo::path(QLibraryInfo::TranslationsPath))) {
|
||||
installTranslator(qtTranslator_name);
|
||||
}
|
||||
|
||||
QTranslator* lrcTranslator_lang = new QTranslator(this);
|
||||
QTranslator* lrcTranslator_name = new QTranslator(this);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "lrcinstance.h"
|
||||
#include "qtutils.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QApplication>
|
||||
|
@ -41,24 +42,11 @@ class PreviewEngine;
|
|||
class ScreenInfo : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(double devicePixelRatio MEMBER devicePixelRatio_ NOTIFY devicePixelRatioChanged)
|
||||
QML_PROPERTY(double, devicePixelRatio)
|
||||
public:
|
||||
void setCurrentFocusWindow(QWindow* window);
|
||||
void setDevicePixelRatio(double ratio)
|
||||
{
|
||||
if (ratio != devicePixelRatio_) {
|
||||
devicePixelRatio_ = ratio;
|
||||
|
||||
Q_EMIT devicePixelRatioChanged();
|
||||
}
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void devicePixelRatioChanged();
|
||||
|
||||
private:
|
||||
double devicePixelRatio_ {0.0};
|
||||
|
||||
QMetaObject::Connection currentFocusWindowScreenConnection_;
|
||||
QMetaObject::Connection devicePixelRatioConnection_;
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
@ -340,7 +340,7 @@ Rectangle {
|
|||
width: mainViewSidePanelRect.width
|
||||
height: mainViewSidePanelRect.height
|
||||
|
||||
onItemSelected: {
|
||||
onItemSelected: function (index) {
|
||||
settingsView.setSelected(index)
|
||||
if (sidePanelOnly)
|
||||
sidePanelViewStack.push(settingsView, StackView.Immediate)
|
||||
|
@ -454,8 +454,12 @@ Rectangle {
|
|||
AboutPopUp {
|
||||
id: aboutPopUpDialog
|
||||
|
||||
height: Math.min(preferredHeight,
|
||||
onVisibleChanged: {
|
||||
height = Qt.binding(function () {
|
||||
return Math.min(preferredHeight,
|
||||
mainView.height - JamiTheme.preferredMarginSize * 2)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
WelcomePageQrDialog {
|
||||
|
@ -510,14 +514,6 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequence: "F10"
|
||||
context: Qt.ApplicationShortcut
|
||||
onActivated: {
|
||||
shortcutsTable.open()
|
||||
}
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
sequence: "F11"
|
||||
context: Qt.ApplicationShortcut
|
||||
|
@ -565,8 +561,4 @@ Rectangle {
|
|||
context: Qt.ApplicationShortcut
|
||||
onActivated: Qt.quit()
|
||||
}
|
||||
|
||||
KeyBoardShortcutTable {
|
||||
id: shortcutsTable
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
@ -37,26 +37,18 @@ ModalPopup {
|
|||
implicitWidth: 400
|
||||
color: JamiTheme.backgroundColor
|
||||
|
||||
ScrollView {
|
||||
JamiFlickable {
|
||||
id: aboutPopUpScrollView
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||
|
||||
clip: true
|
||||
|
||||
ColumnLayout {
|
||||
width: Math.max(root.width, implicitWidth)
|
||||
height: Math.max(aboutPopUpScrollView.height, implicitHeight)
|
||||
|
||||
spacing: 0
|
||||
contentHeight: aboutPopUpContentRectColumnLayout.implicitHeight
|
||||
|
||||
ColumnLayout {
|
||||
id: aboutPopUpContentRectColumnLayout
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
width: Math.max(root.width, implicitWidth)
|
||||
height: Math.max(aboutPopUpScrollView.height, implicitHeight)
|
||||
|
||||
ResponsiveImage {
|
||||
id: aboutPopUPJamiLogoImage
|
||||
|
@ -253,4 +245,3 @@ ModalPopup {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
@ -42,19 +42,18 @@ Popup {
|
|||
padding: 0
|
||||
modal: true
|
||||
Overlay.modal: Rectangle {
|
||||
color: "transparent"
|
||||
color: JamiTheme.transparentColor
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
ListView {
|
||||
|
||||
JamiListView {
|
||||
id: listView
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: parent.width
|
||||
|
||||
clip: true
|
||||
|
||||
model: CurrentAccountFilterModel
|
||||
delegate: AccountItemDelegate {
|
||||
height: JamiTheme.accountListItemHeight
|
||||
|
@ -64,8 +63,6 @@ Popup {
|
|||
LRCInstance.currentAccountId = ID
|
||||
}
|
||||
}
|
||||
|
||||
ScrollBar.vertical: ScrollBar { }
|
||||
}
|
||||
|
||||
// fake footer item as workaround for Qt 5.15 bug
|
||||
|
@ -114,8 +111,8 @@ Popup {
|
|||
horizontalOffset: 3.0
|
||||
verticalOffset: 3.0
|
||||
radius: 16.0
|
||||
samples: 16
|
||||
color: JamiTheme.shadowColor
|
||||
transparentBorder: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
@ -463,7 +463,7 @@ Control {
|
|||
anchors.bottom: parent.top
|
||||
anchors.bottomMargin: itemSpacing
|
||||
visible: !overflowButton.popup.visible
|
||||
ListView {
|
||||
JamiListView {
|
||||
id: urgentOverflowListView
|
||||
|
||||
spacing: itemSpacing
|
||||
|
@ -473,7 +473,6 @@ Control {
|
|||
null
|
||||
|
||||
delegate: buttonDelegate
|
||||
ScrollBar.vertical: ScrollBar { }
|
||||
|
||||
add: Transition {
|
||||
NumberAnimation {
|
||||
|
@ -494,7 +493,7 @@ Control {
|
|||
implicitHeight: contentItem.implicitHeight
|
||||
padding: 0
|
||||
|
||||
contentItem: ListView {
|
||||
contentItem: JamiListView {
|
||||
id: overflowHiddenListView
|
||||
spacing: itemSpacing
|
||||
implicitHeight: contentHeight
|
||||
|
@ -502,8 +501,6 @@ Control {
|
|||
model: overflowButton.popup.visible ?
|
||||
overflowButton.delegateModel :
|
||||
null
|
||||
|
||||
ScrollBar.vertical: ScrollBar { }
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
@ -244,7 +244,7 @@ ItemDelegate {
|
|||
|
||||
onOpened: menuAction.triggered()
|
||||
|
||||
contentItem: ListView {
|
||||
contentItem: JamiListView {
|
||||
id: itemListView
|
||||
|
||||
property real menuItemWidth: 0
|
||||
|
@ -255,10 +255,6 @@ ItemDelegate {
|
|||
implicitWidth: menuItemWidth
|
||||
implicitHeight: Math.min(contentHeight, menuItemHeight * 6) + 24
|
||||
|
||||
ScrollBar.vertical: ScrollBar { }
|
||||
|
||||
clip: true
|
||||
|
||||
model: menu.delegateModel
|
||||
|
||||
TextMetrics {
|
||||
|
@ -300,8 +296,8 @@ ItemDelegate {
|
|||
horizontalOffset: 0
|
||||
verticalOffset: 0
|
||||
radius: 8.0
|
||||
samples: 16
|
||||
color: "#80000000"
|
||||
transparentBorder: true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Models 1.1
|
||||
|
@ -105,7 +105,7 @@ Popup {
|
|||
}
|
||||
}
|
||||
|
||||
ListViewJami {
|
||||
JamiListView {
|
||||
id: contactPickerListView
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
|
@ -114,8 +114,6 @@ Popup {
|
|||
|
||||
model: ContactAdapter.getContactSelectableModel(type)
|
||||
|
||||
clip: true
|
||||
|
||||
delegate: ContactPickerItemDelegate {
|
||||
id: contactPickerItemDelegate
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Models 1.1
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
@ -94,8 +94,8 @@ Rectangle {
|
|||
}
|
||||
|
||||
onTextChanged: root.contactSearchBarTextChanged(contactSearchBar.text)
|
||||
onReleased: {
|
||||
if (event.button == Qt.RightButton)
|
||||
onReleased: function (event) {
|
||||
if (event.button === Qt.RightButton)
|
||||
lineEditContextMenu.openMenuAt(event)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
|
||||
|
|
|
@ -17,14 +17,16 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
ListView {
|
||||
import "../../commoncomponents"
|
||||
|
||||
JamiListView {
|
||||
id: root
|
||||
|
||||
// the following should be marked required (Qtver >= 5.15)
|
||||
|
@ -35,10 +37,6 @@ ListView {
|
|||
delegate: SmartListItemDelegate {}
|
||||
currentIndex: model.currentFilteredRow
|
||||
|
||||
clip: true
|
||||
maximumFlickVelocity: 1024
|
||||
ScrollBar.vertical: ScrollBar { }
|
||||
|
||||
// highlight selection
|
||||
// down and hover states are done within the delegate
|
||||
highlight: Rectangle {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,12 +16,14 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
import "../../commoncomponents"
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
|
@ -30,7 +32,7 @@ Rectangle {
|
|||
|
||||
color: JamiTheme.messageOutBgColor
|
||||
|
||||
ScrollView {
|
||||
JamiFlickable {
|
||||
id: filesToSendContainerScrollView
|
||||
|
||||
anchors.fill: root
|
||||
|
@ -38,16 +40,9 @@ Rectangle {
|
|||
contentHeight: root.height
|
||||
contentWidth: filesToSendContainerRow.width
|
||||
|
||||
ScrollBar.horizontal.visible: {
|
||||
var ratio = filesToSendContainerRow.width / root.width
|
||||
return ratio > 1
|
||||
}
|
||||
ScrollBar.horizontal.contentItem: Rectangle {
|
||||
implicitHeight: 5
|
||||
radius: width / 2
|
||||
color: filesToSendContainerScrollView.ScrollBar.horizontal.pressed ?
|
||||
horizontalHandleColor:
|
||||
filesToSendContainerScrollView.ScrollBar.horizontal.pressed ?
|
||||
JamiTheme.darkGreyColor : JamiTheme.whiteColor
|
||||
}
|
||||
ScrollBar.vertical.policy: ScrollBar.AlwaysOff
|
||||
|
||||
Row {
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
import net.jami.Models 1.1
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
@ -82,7 +82,9 @@ Rectangle {
|
|||
anchors.fill: parent
|
||||
propagateComposedEvents: false
|
||||
acceptedButtons: Qt.AllButtons
|
||||
onDoubleClicked: mouse.accepted = true
|
||||
onDoubleClicked: function (mouse) {
|
||||
mouse.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Models 1.1
|
||||
|
|
|
@ -16,15 +16,15 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
import "../../commoncomponents"
|
||||
|
||||
Flickable {
|
||||
JamiFlickable {
|
||||
id: root
|
||||
|
||||
property alias text: textArea.text
|
||||
|
@ -57,15 +57,11 @@ Flickable {
|
|||
}
|
||||
}
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
policy: contentHeight > height ? ScrollBar.AlwaysOn : ScrollBar.AsNeeded
|
||||
}
|
||||
|
||||
contentWidth: width
|
||||
contentHeight: textArea.implicitHeight
|
||||
|
||||
interactive: true
|
||||
clip: true
|
||||
attachedFlickableMoving: contentHeight > height || root.moving
|
||||
|
||||
function ensureVisible(r) {
|
||||
if (contentY >= r.y)
|
||||
|
@ -118,7 +114,7 @@ Flickable {
|
|||
color: JamiTheme.transparentColor
|
||||
}
|
||||
|
||||
onReleased: {
|
||||
onReleased: function (event) {
|
||||
if (event.button == Qt.RightButton)
|
||||
textAreaContextMenu.openMenuAt(event)
|
||||
}
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import Qt.labs.qmlmodels 1.0
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtGraphicalEffects 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
@ -151,12 +151,12 @@ Rectangle {
|
|||
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onDoubleClicked: {
|
||||
onDoubleClicked: function (mouse) {
|
||||
if (mouse.button === Qt.LeftButton)
|
||||
callStackView.toggleFullScreen()
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
onClicked: function (mouse) {
|
||||
if (mouse.button === Qt.RightButton)
|
||||
callOverlay.openCallViewContextMenuInPos(mouse.x, mouse.y)
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ Rectangle {
|
|||
|
||||
anchors.fill: previewRenderer
|
||||
|
||||
onPressed: {
|
||||
onPressed: function (mouse) {
|
||||
clickPos = Qt.point(mouse.x, mouse.y)
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ Rectangle {
|
|||
previewMagneticSnap()
|
||||
}
|
||||
|
||||
onPositionChanged: {
|
||||
onPositionChanged: function (mouse) {
|
||||
// Calculate mouse position relative change.
|
||||
var delta = Qt.point(mouse.x - clickPos.x,
|
||||
mouse.y - clickPos.y)
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Models 1.1
|
||||
|
|
|
@ -16,14 +16,16 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
ListView {
|
||||
import "../../commoncomponents"
|
||||
|
||||
JamiListView {
|
||||
id: root
|
||||
|
||||
width: currentItem ? currentItem.width + currentItem.spinningAnimationWidth
|
||||
|
@ -52,8 +54,4 @@ ListView {
|
|||
: preferredHeight
|
||||
}
|
||||
}
|
||||
|
||||
clip: true
|
||||
maximumFlickVelocity: 1024
|
||||
ScrollBar.vertical: ScrollBar { }
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Shapes 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Shapes
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Models 1.1
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick
|
||||
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Models 1.1
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue