Change Settings to singleton and add AutoMouseArea.
Also fixes acceptInvitation issue.
This commit is contained in:
@@ -6,6 +6,7 @@ import QtQuick.Controls.Material 2.2
|
||||
import QtQml.Models 2.3
|
||||
import Matrique 0.1
|
||||
import SortFilterProxyModel 0.2
|
||||
import MatriqueSettings 0.1
|
||||
|
||||
import "qrc:/qml/component"
|
||||
|
||||
@@ -13,7 +14,7 @@ Item {
|
||||
property alias listModel: roomListProxyModel.sourceModel
|
||||
readonly property int currentIndex: roomListProxyModel.mapToSource(listView.currentIndex)
|
||||
readonly property var currentRoom: currentIndex != -1 ? listModel.roomAt(currentIndex) : null
|
||||
readonly property bool mini: setting.miniMode // Used as an indicator of whether the listform should be displayed as "Mini mode".
|
||||
readonly property bool mini: MatriqueSettings.miniMode // Used as an indicator of whether the listform should be displayed as "Mini mode".
|
||||
signal enterRoom()
|
||||
|
||||
ColumnLayout {
|
||||
@@ -121,9 +122,14 @@ Item {
|
||||
delegate: ItemDelegate {
|
||||
width: parent.width
|
||||
height: 80
|
||||
onPressed: listView.currentIndex = index
|
||||
onPressAndHold: roomListMenu.popup()
|
||||
onClicked: category === RoomType.Invited ? inviteDialog.open() : enterRoom()
|
||||
|
||||
AutoMouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
onPressed: listView.currentIndex = index
|
||||
onSecondaryClicked: roomListMenu.popup()
|
||||
onPrimaryClicked: category === RoomType.Invited ? inviteDialog.open() : enterRoom()
|
||||
}
|
||||
|
||||
ToolTip.visible: mini && hovered
|
||||
ToolTip.text: name
|
||||
@@ -209,7 +215,7 @@ Item {
|
||||
contentItem: Label { text: "Accept this invitation?" }
|
||||
|
||||
onAccepted: currentRoom.acceptInvitation()
|
||||
onRejected: currentRoom.rejectInvitation()
|
||||
onRejected: currentRoom.forget()
|
||||
}
|
||||
|
||||
Menu {
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import MatriqueSettings 0.1
|
||||
|
||||
Page {
|
||||
property alias darkTheme: themeSwitch.checked
|
||||
property alias miniMode: miniModeSwitch.checked
|
||||
|
||||
Column {
|
||||
Switch {
|
||||
id: themeSwitch
|
||||
text: "Dark theme"
|
||||
checked: MatriqueSettings.darkTheme
|
||||
onCheckedChanged: MatriqueSettings.darkTheme = checked
|
||||
}
|
||||
|
||||
Switch {
|
||||
id: miniModeSwitch
|
||||
text: "Mini Room List"
|
||||
checked: MatriqueSettings.miniMode
|
||||
onCheckedChanged: MatriqueSettings.miniMode = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,32 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import MatriqueSettings 0.1
|
||||
|
||||
Page {
|
||||
property alias lazyLoad: lazyLoadSwitch.checked
|
||||
property alias asyncMessageDelegate: asyncMessageDelegateSwitch.checked
|
||||
property alias richText: richTextSwitch.checked
|
||||
|
||||
Column {
|
||||
Switch {
|
||||
id: lazyLoadSwitch
|
||||
text: "Lazy load at initial sync"
|
||||
checked: true
|
||||
checked: MatriqueSettings.lazyLoad
|
||||
onCheckedChanged: MatriqueSettings.lazyLoad = checked
|
||||
}
|
||||
Switch {
|
||||
id: asyncMessageDelegateSwitch
|
||||
text: "Force loading message delegates asynchronously"
|
||||
checked: MatriqueSettings.asyncMessageDelegate
|
||||
onCheckedChanged: MatriqueSettings.asyncMessageDelegate = checked
|
||||
}
|
||||
Switch {
|
||||
id: richTextSwitch
|
||||
text: "Use RichText instead of StyledText"
|
||||
checked: MatriqueSettings.richText
|
||||
onCheckedChanged: MatriqueSettings.richText = checked
|
||||
}
|
||||
Switch {
|
||||
id: pressAndHoldSwitch
|
||||
text: "Use press and hold instead of right click"
|
||||
checked: MatriqueSettings.pressAndHold
|
||||
onCheckedChanged: MatriqueSettings.pressAndHold = checked
|
||||
}
|
||||
|
||||
Button {
|
||||
|
||||
Reference in New Issue
Block a user