Compare commits
1 Commits
master
...
work/nico/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92029b20f6 |
@@ -191,6 +191,8 @@ set_source_files_properties(qml/OsmLocationPlugin.qml PROPERTIES
|
|||||||
QT_QML_SINGLETON_TYPE TRUE
|
QT_QML_SINGLETON_TYPE TRUE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc)
|
||||||
|
|
||||||
qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
|
qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
|
||||||
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat
|
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat
|
||||||
QML_FILES
|
QML_FILES
|
||||||
@@ -418,8 +420,6 @@ if (TARGET KF6::Crash)
|
|||||||
target_link_libraries(neochat PUBLIC KF6::Crash)
|
target_link_libraries(neochat PUBLIC KF6::Crash)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc)
|
|
||||||
|
|
||||||
if(NEOCHAT_FLATPAK)
|
if(NEOCHAT_FLATPAK)
|
||||||
target_compile_definitions(neochat PUBLIC NEOCHAT_FLATPAK)
|
target_compile_definitions(neochat PUBLIC NEOCHAT_FLATPAK)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ QQC2.Control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
if (!repeatTimer.running && Config.typingNotifications) {
|
if (!repeatTimer.running && NeoChatConfig.typingNotifications) {
|
||||||
var textExists = text.length > 0;
|
var textExists = text.length > 0;
|
||||||
root.currentRoom.sendTypingNotification(textExists);
|
root.currentRoom.sendTypingNotification(textExists);
|
||||||
textExists ? repeatTimer.start() : repeatTimer.stop();
|
textExists ? repeatTimer.start() : repeatTimer.stop();
|
||||||
@@ -353,8 +353,8 @@ QQC2.Control {
|
|||||||
startBreakpoint: Kirigami.Units.gridUnit * 46
|
startBreakpoint: Kirigami.Units.gridUnit * 46
|
||||||
endBreakpoint: Kirigami.Units.gridUnit * 66
|
endBreakpoint: Kirigami.Units.gridUnit * 66
|
||||||
startPercentWidth: 100
|
startPercentWidth: 100
|
||||||
endPercentWidth: Config.compactLayout ? 100 : 85
|
endPercentWidth: NeoChatConfig.compactLayout ? 100 : 85
|
||||||
maxWidth: Config.compactLayout ? -1 : Kirigami.Units.gridUnit * 60
|
maxWidth: NeoChatConfig.compactLayout ? -1 : Kirigami.Units.gridUnit * 60
|
||||||
|
|
||||||
parentWidth: root.width
|
parentWidth: root.width
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,25 +17,25 @@ FormCard.FormCardPage {
|
|||||||
|
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
text: i18nc("@option:check", "Show hidden events in the timeline")
|
text: i18nc("@option:check", "Show hidden events in the timeline")
|
||||||
checked: Config.showAllEvents
|
checked: NeoChatConfig.showAllEvents
|
||||||
|
|
||||||
onToggled: Config.showAllEvents = checked
|
onToggled: NeoChatConfig.showAllEvents = checked
|
||||||
}
|
}
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: roomAccountDataVisibleCheck
|
id: roomAccountDataVisibleCheck
|
||||||
text: i18nc("@option:check Enable the matrix 'threads' feature", "Always allow device verification")
|
text: i18nc("@option:check Enable the matrix 'threads' feature", "Always allow device verification")
|
||||||
description: i18n("Allow the user to start a verification session with devices that were already verified")
|
description: i18n("Allow the user to start a verification session with devices that were already verified")
|
||||||
checked: Config.alwaysVerifyDevice
|
checked: NeoChatConfig.alwaysVerifyDevice
|
||||||
|
|
||||||
onToggled: Config.alwaysVerifyDevice = checked
|
onToggled: NeoChatConfig.alwaysVerifyDevice = checked
|
||||||
}
|
}
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
text: i18nc("@option:check", "Show focus in window header")
|
text: i18nc("@option:check", "Show focus in window header")
|
||||||
checked: Config.windowTitleFocus
|
checked: NeoChatConfig.windowTitleFocus
|
||||||
|
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.windowTitleFocus = checked;
|
NeoChatConfig.windowTitleFocus = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,23 +18,23 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: roomAccountDataVisibleCheck
|
id: roomAccountDataVisibleCheck
|
||||||
text: i18nc("@option:check Enable the matrix 'threads' feature", "Threads")
|
text: i18nc("@option:check Enable the matrix 'threads' feature", "Threads")
|
||||||
checked: Config.threads
|
checked: NeoChatConfig.threads
|
||||||
|
|
||||||
onToggled: Config.threads = checked
|
onToggled: NeoChatConfig.threads = checked
|
||||||
}
|
}
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
text: i18nc("@option:check Enable the matrix 'secret backup' feature", "Secret Backup")
|
text: i18nc("@option:check Enable the matrix 'secret backup' feature", "Secret Backup")
|
||||||
checked: Config.secretBackup
|
checked: NeoChatConfig.secretBackup
|
||||||
|
|
||||||
onToggled: Config.secretBackup = checked
|
onToggled: NeoChatConfig.secretBackup = checked
|
||||||
}
|
}
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
text: i18nc("@option:check Enable the matrix feature to add a phone number as a third party ID", "Add phone numbers as 3PIDs")
|
text: i18nc("@option:check Enable the matrix feature to add a phone number as a third party ID", "Add phone numbers as 3PIDs")
|
||||||
checked: Config.phone3PId
|
checked: NeoChatConfig.phone3PId
|
||||||
|
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.phone3PId = checked
|
NeoChatConfig.phone3PId = checked
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,20 +12,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
#include "neochatconfig.h"
|
|
||||||
|
|
||||||
struct ForeignConfig {
|
|
||||||
Q_GADGET
|
|
||||||
QML_FOREIGN(NeoChatConfig)
|
|
||||||
QML_NAMED_ELEMENT(Config)
|
|
||||||
QML_SINGLETON
|
|
||||||
public:
|
|
||||||
static NeoChatConfig *create(QQmlEngine *, QJSEngine *)
|
|
||||||
{
|
|
||||||
QQmlEngine::setObjectOwnership(NeoChatConfig::self(), QQmlEngine::CppOwnership);
|
|
||||||
return NeoChatConfig::self();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ForeignAccountRegistry {
|
struct ForeignAccountRegistry {
|
||||||
Q_GADGET
|
Q_GADGET
|
||||||
|
|||||||
@@ -7,3 +7,4 @@ DefaultValueGetters=true
|
|||||||
GenerateProperties=true
|
GenerateProperties=true
|
||||||
ParentInConstructor=true
|
ParentInConstructor=true
|
||||||
Singleton=true
|
Singleton=true
|
||||||
|
QmlRegistration=true
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ QQC2.Menu {
|
|||||||
QQC2.MenuItem {
|
QQC2.MenuItem {
|
||||||
text: i18n("Open developer tools")
|
text: i18n("Open developer tools")
|
||||||
icon.name: "tools"
|
icon.name: "tools"
|
||||||
visible: Config.developerTools
|
visible: NeoChatConfig.developerTools
|
||||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
|
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
}, {
|
}, {
|
||||||
@@ -66,7 +66,7 @@ QQC2.Menu {
|
|||||||
QQC2.MenuItem {
|
QQC2.MenuItem {
|
||||||
text: i18nc("@action:inmenu", "Open Secret Backup")
|
text: i18nc("@action:inmenu", "Open Secret Backup")
|
||||||
icon.name: "unlock"
|
icon.name: "unlock"
|
||||||
visible: Config.secretBackup
|
visible: NeoChatConfig.secretBackup
|
||||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'UnlockSSSSDialog'), {}, {
|
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'UnlockSSSSDialog'), {}, {
|
||||||
title: i18nc("@title:window", "Open Key Backup")
|
title: i18nc("@title:window", "Open Key Backup")
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ Loader {
|
|||||||
* Some common actions shared between menus
|
* Some common actions shared between menus
|
||||||
*/
|
*/
|
||||||
component ViewSourceAction: Kirigami.Action {
|
component ViewSourceAction: Kirigami.Action {
|
||||||
visible: Config.developerTools
|
visible: NeoChatConfig.developerTools
|
||||||
text: i18n("View Source")
|
text: i18n("View Source")
|
||||||
icon.name: "code-context"
|
icon.name: "code-context"
|
||||||
onTriggered: RoomManager.viewEventSource(root.eventId)
|
onTriggered: RoomManager.viewEventSource(root.eventId)
|
||||||
|
|||||||
@@ -101,13 +101,13 @@ DelegateContextMenu {
|
|||||||
id: saveAsDialog
|
id: saveAsDialog
|
||||||
FileDialog {
|
FileDialog {
|
||||||
fileMode: FileDialog.SaveFile
|
fileMode: FileDialog.SaveFile
|
||||||
folder: Config.lastSaveDirectory.length > 0 ? Config.lastSaveDirectory : StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
folder: NeoChatConfig.lastSaveDirectory.length > 0 ? NeoChatConfig.lastSaveDirectory : StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
if (!currentFile) {
|
if (!currentFile) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Config.lastSaveDirectory = folder;
|
NeoChatConfig.lastSaveDirectory = folder;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
currentRoom.downloadFile(eventId, currentFile);
|
currentRoom.downloadFile(eventId, currentFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ QQC2.Control {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
visible: Config.threads && !root.currentRoom.readOnly
|
visible: NeoChatConfig.threads && !root.currentRoom.readOnly
|
||||||
text: i18n("Reply in Thread")
|
text: i18n("Reply in Thread")
|
||||||
icon.name: "dialog-messages"
|
icon.name: "dialog-messages"
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ Kirigami.ApplicationWindow {
|
|||||||
readonly property HoverLinkIndicator hoverLinkIndicator: linkIndicator
|
readonly property HoverLinkIndicator hoverLinkIndicator: linkIndicator
|
||||||
|
|
||||||
|
|
||||||
title: Config.windowTitleFocus ? activeFocusItem + " " + (activeFocusItem ? activeFocusItem.Accessible.name : "") : "NeoChat"
|
title: NeoChatConfig.windowTitleFocus ? activeFocusItem + " " + (activeFocusItem ? activeFocusItem.Accessible.name : "") : "NeoChat"
|
||||||
|
|
||||||
minimumWidth: Kirigami.Units.gridUnit * 20
|
minimumWidth: Kirigami.Units.gridUnit * 20
|
||||||
minimumHeight: Kirigami.Units.gridUnit * 15
|
minimumHeight: Kirigami.Units.gridUnit * 15
|
||||||
@@ -157,7 +157,7 @@ Kirigami.ApplicationWindow {
|
|||||||
|
|
||||||
// This is a memory for all user initiated actions on the drawer, i.e. clicking the button
|
// This is a memory for all user initiated actions on the drawer, i.e. clicking the button
|
||||||
// It is used to ensure that user choice is remembered when changing pages and expanding and contracting the window width
|
// It is used to ensure that user choice is remembered when changing pages and expanding and contracting the window width
|
||||||
property bool drawerUserState: Config.autoRoomInfoDrawer
|
property bool drawerUserState: NeoChatConfig.autoRoomInfoDrawer
|
||||||
|
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ Kirigami.ApplicationWindow {
|
|||||||
modal: (!root.wideScreen || !enabled)
|
modal: (!root.wideScreen || !enabled)
|
||||||
onEnabledChanged: drawerOpen = enabled && !modal
|
onEnabledChanged: drawerOpen = enabled && !modal
|
||||||
onModalChanged: {
|
onModalChanged: {
|
||||||
if (Config.autoRoomInfoDrawer) {
|
if (NeoChatConfig.autoRoomInfoDrawer) {
|
||||||
drawerOpen = !modal && drawerUserState;
|
drawerOpen = !modal && drawerUserState;
|
||||||
dim = false;
|
dim = false;
|
||||||
}
|
}
|
||||||
@@ -190,11 +190,11 @@ Kirigami.ApplicationWindow {
|
|||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
CustomEmojiModel.connection = root.connection;
|
CustomEmojiModel.connection = root.connection;
|
||||||
SpaceHierarchyCache.connection = root.connection;
|
SpaceHierarchyCache.connection = root.connection;
|
||||||
WindowController.setBlur(pageStack, Config.blur && !Config.compactLayout);
|
WindowController.setBlur(pageStack, NeoChatConfig.blur && !NeoChatConfig.compactLayout);
|
||||||
if (ShareHandler.text && root.connection) {
|
if (ShareHandler.text && root.connection) {
|
||||||
root.handleShare()
|
root.handleShare()
|
||||||
}
|
}
|
||||||
if (Config.minimizeToSystemTrayOnStartup && !Kirigami.Settings.isMobile && Controller.supportSystemTray && Config.systemTray) {
|
if (NeoChatConfig.minimizeToSystemTrayOnStartup && !Kirigami.Settings.isMobile && Controller.supportSystemTray && NeoChatConfig.systemTray) {
|
||||||
restoreWindowGeometryConnections.enabled = true; // To restore window size and position
|
restoreWindowGeometryConnections.enabled = true; // To restore window size and position
|
||||||
} else {
|
} else {
|
||||||
visible = true;
|
visible = true;
|
||||||
@@ -204,19 +204,19 @@ Kirigami.ApplicationWindow {
|
|||||||
Connections {
|
Connections {
|
||||||
target: Config
|
target: Config
|
||||||
function onBlurChanged() {
|
function onBlurChanged() {
|
||||||
WindowController.setBlur(pageStack, Config.blur && !Config.compactLayout);
|
WindowController.setBlur(pageStack, NeoChatConfig.blur && !NeoChatConfig.compactLayout);
|
||||||
}
|
}
|
||||||
function onCompactLayoutChanged() {
|
function onCompactLayoutChanged() {
|
||||||
WindowController.setBlur(pageStack, Config.blur && !Config.compactLayout);
|
WindowController.setBlur(pageStack, NeoChatConfig.blur && !NeoChatConfig.compactLayout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// blur effect
|
// blur effect
|
||||||
color: Config.blur && !Config.compactLayout ? "transparent" : Kirigami.Theme.backgroundColor
|
color: NeoChatConfig.blur && !NeoChatConfig.compactLayout ? "transparent" : Kirigami.Theme.backgroundColor
|
||||||
|
|
||||||
// we need to apply the translucency effect separately on top of the color
|
// we need to apply the translucency effect separately on top of the color
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: Config.blur && !Config.compactLayout ? Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 1 - Config.transparency) : "transparent"
|
color: NeoChatConfig.blur && !NeoChatConfig.compactLayout ? Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 1 - NeoChatConfig.transparency) : "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ Components.AlbumMaximizeComponent {
|
|||||||
fileMode: Platform.FileDialog.SaveFile
|
fileMode: Platform.FileDialog.SaveFile
|
||||||
folder: root.saveFolder
|
folder: root.saveFolder
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
Config.lastSaveDirectory = folder;
|
NeoChatConfig.lastSaveDirectory = folder;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
if (!currentFile) {
|
if (!currentFile) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ Delegates.RoundedItemDelegate {
|
|||||||
Components.Avatar {
|
Components.Avatar {
|
||||||
source: root.avatar ? root.connection.makeMediaUrl("mxc://" + root.avatar) : ""
|
source: root.avatar ? root.connection.makeMediaUrl("mxc://" + root.avatar) : ""
|
||||||
name: root.displayName
|
name: root.displayName
|
||||||
visible: Config.showAvatarInRoomDrawer
|
visible: NeoChatConfig.showAvatarInRoomDrawer
|
||||||
implicitHeight: Kirigami.Units.gridUnit + (Config.compactRoomList ? 0 : Kirigami.Units.largeSpacing * 2)
|
implicitHeight: Kirigami.Units.gridUnit + (NeoChatConfig.compactRoomList ? 0 : Kirigami.Units.largeSpacing * 2)
|
||||||
implicitWidth: visible ? implicitHeight : 0
|
implicitWidth: visible ? implicitHeight : 0
|
||||||
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
@@ -90,7 +90,7 @@ Delegates.RoundedItemDelegate {
|
|||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font: Kirigami.Theme.smallFont
|
font: Kirigami.Theme.smallFont
|
||||||
opacity: root.hasNotifications ? 0.9 : 0.7
|
opacity: root.hasNotifications ? 0.9 : 0.7
|
||||||
visible: !Config.compactRoomList && text.length > 0
|
visible: !NeoChatConfig.compactRoomList && text.length > 0
|
||||||
textFormat: Text.PlainText
|
textFormat: Text.PlainText
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -136,7 +136,7 @@ Delegates.RoundedItemDelegate {
|
|||||||
|
|
||||||
QQC2.Button {
|
QQC2.Button {
|
||||||
id: configButton
|
id: configButton
|
||||||
visible: root.hovered && !Kirigami.Settings.isMobile && !Config.compactRoomList && !root.collapsed && root.showConfigure
|
visible: root.hovered && !Kirigami.Settings.isMobile && !NeoChatConfig.compactRoomList && !root.collapsed && root.showConfigure
|
||||||
text: i18n("Configure room")
|
text: i18n("Configure room")
|
||||||
display: QQC2.Button.IconOnly
|
display: QQC2.Button.IconOnly
|
||||||
|
|
||||||
@@ -154,14 +154,14 @@ Delegates.RoundedItemDelegate {
|
|||||||
room: root.currentRoom,
|
room: root.currentRoom,
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
});
|
});
|
||||||
if (!Kirigami.Settings.isMobile && !Config.compactRoomList) {
|
if (!Kirigami.Settings.isMobile && !NeoChatConfig.compactRoomList) {
|
||||||
configButton.visible = true;
|
configButton.visible = true;
|
||||||
configButton.down = true;
|
configButton.down = true;
|
||||||
}
|
}
|
||||||
menu.closed.connect(function () {
|
menu.closed.connect(function () {
|
||||||
configButton.down = undefined;
|
configButton.down = undefined;
|
||||||
configButton.visible = Qt.binding(() => {
|
configButton.visible = Qt.binding(() => {
|
||||||
return root.hovered && !Kirigami.Settings.isMobile && !Config.compactRoomList;
|
return root.hovered && !Kirigami.Settings.isMobile && !NeoChatConfig.compactRoomList;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
menu.open();
|
menu.open();
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ Kirigami.OverlayDrawer {
|
|||||||
readonly property int maxWidth: Kirigami.Units.gridUnit * 25
|
readonly property int maxWidth: Kirigami.Units.gridUnit * 25
|
||||||
readonly property int defaultWidth: Kirigami.Units.gridUnit * 20
|
readonly property int defaultWidth: Kirigami.Units.gridUnit * 20
|
||||||
property int actualWidth: {
|
property int actualWidth: {
|
||||||
if (Config.roomDrawerWidth === -1) {
|
if (NeoChatConfig.roomDrawerWidth === -1) {
|
||||||
return Kirigami.Units.gridUnit * 20;
|
return Kirigami.Units.gridUnit * 20;
|
||||||
} else {
|
} else {
|
||||||
return Config.roomDrawerWidth;
|
return NeoChatConfig.roomDrawerWidth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,8 +45,8 @@ Kirigami.OverlayDrawer {
|
|||||||
visible: true
|
visible: true
|
||||||
onPressed: _lastX = mapToGlobal(mouseX, mouseY).x
|
onPressed: _lastX = mapToGlobal(mouseX, mouseY).x
|
||||||
onReleased: {
|
onReleased: {
|
||||||
Config.roomDrawerWidth = root.actualWidth;
|
NeoChatConfig.roomDrawerWidth = root.actualWidth;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
property real _lastX: -1
|
property real _lastX: -1
|
||||||
|
|
||||||
@@ -55,9 +55,9 @@ Kirigami.OverlayDrawer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (Qt.application.layoutDirection === Qt.RightToLeft) {
|
if (Qt.application.layoutDirection === Qt.RightToLeft) {
|
||||||
root.actualWidth = Math.min(root.maxWidth, Math.max(root.minWidth, Config.roomDrawerWidth - _lastX + mapToGlobal(mouseX, mouseY).x));
|
root.actualWidth = Math.min(root.maxWidth, Math.max(root.minWidth, NeoChatConfig.roomDrawerWidth - _lastX + mapToGlobal(mouseX, mouseY).x));
|
||||||
} else {
|
} else {
|
||||||
root.actualWidth = Math.min(root.maxWidth, Math.max(root.minWidth, Config.roomDrawerWidth + _lastX - mapToGlobal(mouseX, mouseY).x));
|
root.actualWidth = Math.min(root.maxWidth, Math.max(root.minWidth, NeoChatConfig.roomDrawerWidth + _lastX - mapToGlobal(mouseX, mouseY).x));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Kirigami.Page {
|
|||||||
|
|
||||||
required property NeoChatConnection connection
|
required property NeoChatConnection connection
|
||||||
|
|
||||||
readonly property bool collapsed: Config.collapsed
|
readonly property bool collapsed: NeoChatConfig.collapsed
|
||||||
|
|
||||||
signal search
|
signal search
|
||||||
|
|
||||||
@@ -258,7 +258,7 @@ Kirigami.Page {
|
|||||||
if (_private.currentWidth < _private.collapseWidth && _private.currentWidth + (mouse.x - _lastX) >= _private.collapseWidth) {
|
if (_private.currentWidth < _private.collapseWidth && _private.currentWidth + (mouse.x - _lastX) >= _private.collapseWidth) {
|
||||||
// Here we get back directly to a more wide mode.
|
// Here we get back directly to a more wide mode.
|
||||||
_private.currentWidth = _private.defaultWidth;
|
_private.currentWidth = _private.defaultWidth;
|
||||||
Config.collapsed = false;
|
NeoChatConfig.collapsed = false;
|
||||||
} else if (_private.currentWidth >= _private.collapseWidth) {
|
} else if (_private.currentWidth >= _private.collapseWidth) {
|
||||||
// Increase page width
|
// Increase page width
|
||||||
_private.currentWidth = Math.min(_private.defaultWidth, _private.currentWidth + (mouse.x - _lastX));
|
_private.currentWidth = Math.min(_private.defaultWidth, _private.currentWidth + (mouse.x - _lastX));
|
||||||
@@ -267,7 +267,7 @@ Kirigami.Page {
|
|||||||
const tmpWidth = _private.currentWidth - (_lastX - mouse.x);
|
const tmpWidth = _private.currentWidth - (_lastX - mouse.x);
|
||||||
if (tmpWidth < _private.collapseWidth) {
|
if (tmpWidth < _private.collapseWidth) {
|
||||||
_private.currentWidth = Qt.binding(() => _private.collapsedSize);
|
_private.currentWidth = Qt.binding(() => _private.collapsedSize);
|
||||||
Config.collapsed = true;
|
NeoChatConfig.collapsed = true;
|
||||||
} else {
|
} else {
|
||||||
_private.currentWidth = tmpWidth;
|
_private.currentWidth = tmpWidth;
|
||||||
}
|
}
|
||||||
@@ -324,9 +324,9 @@ Kirigami.Page {
|
|||||||
*/
|
*/
|
||||||
QtObject {
|
QtObject {
|
||||||
id: _private
|
id: _private
|
||||||
property int currentWidth: Config.collapsed ? collapsedSize : defaultWidth
|
property int currentWidth: NeoChatConfig.collapsed ? collapsedSize : defaultWidth
|
||||||
readonly property int defaultWidth: Kirigami.Units.gridUnit * 17
|
readonly property int defaultWidth: Kirigami.Units.gridUnit * 17
|
||||||
readonly property int collapseWidth: Kirigami.Units.gridUnit * 10
|
readonly property int collapseWidth: Kirigami.Units.gridUnit * 10
|
||||||
readonly property int collapsedSize: Kirigami.Units.gridUnit + (Config.compactRoomList ? 0 : Kirigami.Units.largeSpacing * 2) + Kirigami.Units.largeSpacing * 2 + (scrollView.QQC2.ScrollBar.vertical.visible ? scrollView.QQC2.ScrollBar.vertical.width : 0)
|
readonly property int collapsedSize: Kirigami.Units.gridUnit + (NeoChatConfig.compactRoomList ? 0 : Kirigami.Units.largeSpacing * 2) + Kirigami.Units.largeSpacing * 2 + (scrollView.QQC2.ScrollBar.vertical.visible ? scrollView.QQC2.ScrollBar.vertical.width : 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ Kirigami.Page {
|
|||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
Kirigami.Theme.colorSet: Kirigami.Theme.View
|
||||||
Kirigami.Theme.inherit: false
|
Kirigami.Theme.inherit: false
|
||||||
color: Config.compactLayout ? Kirigami.Theme.backgroundColor : "transparent"
|
color: NeoChatConfig.compactLayout ? Kirigami.Theme.backgroundColor : "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
footer: Loader {
|
footer: Loader {
|
||||||
|
|||||||
@@ -142,12 +142,12 @@ QQC2.ScrollView {
|
|||||||
footer: Item {
|
footer: Item {
|
||||||
z: 3
|
z: 3
|
||||||
width: root.width
|
width: root.width
|
||||||
visible: messageListView.sectionBannerItem && messageListView.sectionBannerItem.ListView.section !== "" && !Config.blur
|
visible: messageListView.sectionBannerItem && messageListView.sectionBannerItem.ListView.section !== "" && !NeoChatConfig.blur
|
||||||
|
|
||||||
SectionDelegate {
|
SectionDelegate {
|
||||||
id: sectionDelegate
|
id: sectionDelegate
|
||||||
anchors.leftMargin: state === "alignLeft" ? Kirigami.Units.largeSpacing : 0
|
anchors.leftMargin: state === "alignLeft" ? Kirigami.Units.largeSpacing : 0
|
||||||
state: Config.compactLayout ? "alignLeft" : "alignCenter"
|
state: NeoChatConfig.compactLayout ? "alignLeft" : "alignCenter"
|
||||||
// Align left when in compact mode and center when using bubbles
|
// Align left when in compact mode and center when using bubbles
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
@@ -170,7 +170,7 @@ QQC2.ScrollView {
|
|||||||
|
|
||||||
width: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.contentItem.width : 0
|
width: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.contentItem.width : 0
|
||||||
labelText: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.ListView.section : ""
|
labelText: messageListView.sectionBannerItem ? messageListView.sectionBannerItem.ListView.section : ""
|
||||||
colorSet: Config.compactLayout ? Kirigami.Theme.View : Kirigami.Theme.Window
|
colorSet: NeoChatConfig.compactLayout ? Kirigami.Theme.View : Kirigami.Theme.Window
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
footerPositioning: ListView.OverlayHeader
|
footerPositioning: ListView.OverlayHeader
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ FormCard.FormCardPage {
|
|||||||
medium: "email"
|
medium: "email"
|
||||||
}
|
}
|
||||||
ThreePIdCard {
|
ThreePIdCard {
|
||||||
visible: Config.phone3PId
|
visible: NeoChatConfig.phone3PId
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
title: i18n("Phone Numbers")
|
title: i18n("Phone Numbers")
|
||||||
medium: "msisdn"
|
medium: "msisdn"
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ FormCard.FormCardPage {
|
|||||||
KirigamiComponents.Avatar {
|
KirigamiComponents.Avatar {
|
||||||
color: "#4a5bcc"
|
color: "#4a5bcc"
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
visible: Config.showAvatarInTimeline
|
visible: NeoChatConfig.showAvatarInTimeline
|
||||||
Layout.preferredWidth: Config.showAvatarInTimeline ? Kirigami.Units.largeSpacing * 2 : 0
|
Layout.preferredWidth: NeoChatConfig.showAvatarInTimeline ? Kirigami.Units.largeSpacing * 2 : 0
|
||||||
Layout.preferredHeight: Kirigami.Units.largeSpacing * 2
|
Layout.preferredHeight: Kirigami.Units.largeSpacing * 2
|
||||||
}
|
}
|
||||||
QQC2.Control {
|
QQC2.Control {
|
||||||
@@ -78,8 +78,8 @@ FormCard.FormCardPage {
|
|||||||
KirigamiComponents.Avatar {
|
KirigamiComponents.Avatar {
|
||||||
color: "#9f244b"
|
color: "#9f244b"
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
visible: Config.showAvatarInTimeline
|
visible: NeoChatConfig.showAvatarInTimeline
|
||||||
Layout.preferredWidth: Config.showAvatarInTimeline ? Kirigami.Units.largeSpacing * 2 : 0
|
Layout.preferredWidth: NeoChatConfig.showAvatarInTimeline ? Kirigami.Units.largeSpacing * 2 : 0
|
||||||
Layout.preferredHeight: Kirigami.Units.largeSpacing * 2
|
Layout.preferredHeight: Kirigami.Units.largeSpacing * 2
|
||||||
}
|
}
|
||||||
QQC2.Control {
|
QQC2.Control {
|
||||||
@@ -113,13 +113,13 @@ FormCard.FormCardPage {
|
|||||||
]
|
]
|
||||||
|
|
||||||
text: i18n("Bubbles")
|
text: i18n("Bubbles")
|
||||||
checked: !Config.compactLayout
|
checked: !NeoChatConfig.compactLayout
|
||||||
QQC2.ButtonGroup.group: themeGroup
|
QQC2.ButtonGroup.group: themeGroup
|
||||||
enabled: !Config.isCompactLayoutImmutable
|
enabled: !NeoChatConfig.isCompactLayoutImmutable
|
||||||
|
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.compactLayout = !checked;
|
NeoChatConfig.compactLayout = !checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ThemeRadioButton {
|
ThemeRadioButton {
|
||||||
@@ -131,8 +131,8 @@ FormCard.FormCardPage {
|
|||||||
KirigamiComponents.Avatar {
|
KirigamiComponents.Avatar {
|
||||||
color: "#4a5bcc"
|
color: "#4a5bcc"
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
visible: Config.showAvatarInTimeline
|
visible: NeoChatConfig.showAvatarInTimeline
|
||||||
Layout.preferredWidth: Config.showAvatarInTimeline ? Kirigami.Units.largeSpacing * 2 : 0
|
Layout.preferredWidth: NeoChatConfig.showAvatarInTimeline ? Kirigami.Units.largeSpacing * 2 : 0
|
||||||
Layout.preferredHeight: Kirigami.Units.largeSpacing * 2
|
Layout.preferredHeight: Kirigami.Units.largeSpacing * 2
|
||||||
}
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
@@ -158,8 +158,8 @@ FormCard.FormCardPage {
|
|||||||
KirigamiComponents.Avatar {
|
KirigamiComponents.Avatar {
|
||||||
color: "#9f244b"
|
color: "#9f244b"
|
||||||
Layout.alignment: Qt.AlignTop
|
Layout.alignment: Qt.AlignTop
|
||||||
visible: Config.showAvatarInTimeline
|
visible: NeoChatConfig.showAvatarInTimeline
|
||||||
Layout.preferredWidth: Config.showAvatarInTimeline ? Kirigami.Units.largeSpacing * 2 : 0
|
Layout.preferredWidth: NeoChatConfig.showAvatarInTimeline ? Kirigami.Units.largeSpacing * 2 : 0
|
||||||
Layout.preferredHeight: Kirigami.Units.largeSpacing * 2
|
Layout.preferredHeight: Kirigami.Units.largeSpacing * 2
|
||||||
}
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
@@ -182,13 +182,13 @@ FormCard.FormCardPage {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
text: i18n("Compact")
|
text: i18n("Compact")
|
||||||
checked: Config.compactLayout
|
checked: NeoChatConfig.compactLayout
|
||||||
QQC2.ButtonGroup.group: themeGroup
|
QQC2.ButtonGroup.group: themeGroup
|
||||||
enabled: !Config.isCompactLayoutImmutable
|
enabled: !NeoChatConfig.isCompactLayoutImmutable
|
||||||
|
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.compactLayout = checked;
|
NeoChatConfig.compactLayout = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
@@ -204,10 +204,10 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: compactRoomListDelegate
|
id: compactRoomListDelegate
|
||||||
text: i18n("Use compact room list")
|
text: i18n("Use compact room list")
|
||||||
checked: Config.compactRoomList
|
checked: NeoChatConfig.compactRoomList
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.compactRoomList = checked;
|
NeoChatConfig.compactRoomList = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,11 +231,11 @@ FormCard.FormCardPage {
|
|||||||
id: hasWindowSystemDelegate
|
id: hasWindowSystemDelegate
|
||||||
visible: WindowController.hasWindowSystem
|
visible: WindowController.hasWindowSystem
|
||||||
text: i18n("Use transparent chat page")
|
text: i18n("Use transparent chat page")
|
||||||
enabled: !Config.compactLayout && !Config.isBlurImmutable
|
enabled: !NeoChatConfig.compactLayout && !NeoChatConfig.isBlurImmutable
|
||||||
checked: Config.blur
|
checked: NeoChatConfig.blur
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.blur = checked;
|
NeoChatConfig.blur = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,8 +246,8 @@ FormCard.FormCardPage {
|
|||||||
|
|
||||||
FormCard.AbstractFormDelegate {
|
FormCard.AbstractFormDelegate {
|
||||||
id: transparencyDelegate
|
id: transparencyDelegate
|
||||||
visible: WindowController.hasWindowSystem && Config.blur
|
visible: WindowController.hasWindowSystem && NeoChatConfig.blur
|
||||||
enabled: !Config.isTransparancyImmutable
|
enabled: !NeoChatConfig.isTransparancyImmutable
|
||||||
background: Item {}
|
background: Item {}
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
QQC2.Label {
|
QQC2.Label {
|
||||||
@@ -255,14 +255,14 @@ FormCard.FormCardPage {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
QQC2.Slider {
|
QQC2.Slider {
|
||||||
enabled: !Config.compactLayout && Config.blur
|
enabled: !NeoChatConfig.compactLayout && NeoChatConfig.blur
|
||||||
from: 0
|
from: 0
|
||||||
to: 1
|
to: 1
|
||||||
stepSize: 0.05
|
stepSize: 0.05
|
||||||
value: Config.transparency
|
value: NeoChatConfig.transparency
|
||||||
onMoved: {
|
onMoved: {
|
||||||
Config.transparency = value;
|
NeoChatConfig.transparency = value;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
@@ -273,7 +273,7 @@ FormCard.FormCardPage {
|
|||||||
QQC2.ToolTip.text: i18n("Only enabled if the transparent chat page is enabled.")
|
QQC2.ToolTip.text: i18n("Only enabled if the transparent chat page is enabled.")
|
||||||
}
|
}
|
||||||
QQC2.Label {
|
QQC2.Label {
|
||||||
text: Math.round(Config.transparency * 100) + "%"
|
text: Math.round(NeoChatConfig.transparency * 100) + "%"
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -288,11 +288,11 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: showLocalMessagesOnRightDelegate
|
id: showLocalMessagesOnRightDelegate
|
||||||
text: i18n("Show your messages on the right")
|
text: i18n("Show your messages on the right")
|
||||||
checked: Config.showLocalMessagesOnRight
|
checked: NeoChatNeoChatConfig.showLocalMessagesOnRight
|
||||||
enabled: !Config.isShowLocalMessagesOnRightImmutable && !Config.compactLayout
|
enabled: !NeoChatConfig.isShowLocalMessagesOnRightImmutable && !NeoChatConfig.compactLayout
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.showLocalMessagesOnRight = checked;
|
NeoChatConfig.showLocalMessagesOnRight = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,10 +304,10 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: showLinkPreviewDelegate
|
id: showLinkPreviewDelegate
|
||||||
text: i18n("Show links preview in the chat messages")
|
text: i18n("Show links preview in the chat messages")
|
||||||
checked: Config.showLinkPreview
|
checked: NeoChatConfig.showLinkPreview
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.showLinkPreview = checked;
|
NeoChatConfig.showLinkPreview = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -318,21 +318,21 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCard {
|
FormCard.FormCard {
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
text: i18n("In chat")
|
text: i18n("In chat")
|
||||||
checked: Config.showAvatarInTimeline
|
checked: NeoChatConfig.showAvatarInTimeline
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.showAvatarInTimeline = checked;
|
NeoChatConfig.showAvatarInTimeline = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
enabled: !Config.isShowAvatarInTimelineImmutable
|
enabled: !NeoChatConfig.isShowAvatarInTimelineImmutable
|
||||||
}
|
}
|
||||||
|
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
text: i18n("In sidebar")
|
text: i18n("In sidebar")
|
||||||
checked: Config.showAvatarInRoomDrawer
|
checked: NeoChatConfig.showAvatarInRoomDrawer
|
||||||
enabled: !Config.isShowAvatarInRoomDrawerImmutable
|
enabled: !NeoChatConfig.isShowAvatarInRoomDrawerImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.showAvatarInRoomDrawer = checked;
|
NeoChatConfig.showAvatarInRoomDrawer = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ FormCard.FormComboBoxDelegate {
|
|||||||
textRole: "display"
|
textRole: "display"
|
||||||
valueRole: "display"
|
valueRole: "display"
|
||||||
model: ColorSchemer.model
|
model: ColorSchemer.model
|
||||||
Component.onCompleted: currentIndex = ColorSchemer.indexForScheme(Config.colorScheme)
|
Component.onCompleted: currentIndex = ColorSchemer.indexForScheme(NeoChatConfig.colorScheme)
|
||||||
onCurrentValueChanged: {
|
onCurrentValueChanged: {
|
||||||
ColorSchemer.apply(currentIndex);
|
ColorSchemer.apply(currentIndex);
|
||||||
Config.colorScheme = ColorSchemer.nameForIndex(currentIndex);
|
NeoChatConfig.colorScheme = ColorSchemer.nameForIndex(currentIndex);
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ FormCard.AbstractFormDelegate {
|
|||||||
}
|
}
|
||||||
QQC2.ToolButton {
|
QQC2.ToolButton {
|
||||||
display: QQC2.AbstractButton.IconOnly
|
display: QQC2.AbstractButton.IconOnly
|
||||||
visible: root.showVerifyButton && (root.type !== DevicesModel.Verified || Config.alwaysVerifyDevice)
|
visible: root.showVerifyButton && (root.type !== DevicesModel.Verified || NeoChatConfig.alwaysVerifyDevice)
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
id: verifyDeviceAction
|
id: verifyDeviceAction
|
||||||
text: i18n("Verify device")
|
text: i18n("Verify device")
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: closeDelegate
|
id: closeDelegate
|
||||||
text: i18n("Show in System Tray")
|
text: i18n("Show in System Tray")
|
||||||
checked: Config.systemTray
|
checked: NeoChatConfig.systemTray
|
||||||
visible: Controller.supportSystemTray
|
visible: Controller.supportSystemTray
|
||||||
enabled: !Config.isSystemTrayImmutable
|
enabled: !NeoChatConfig.isSystemTrayImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.systemTray = checked;
|
NeoChatConfig.systemTray = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,12 +39,12 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: minimizeDelegate
|
id: minimizeDelegate
|
||||||
text: i18n("Minimize to system tray on startup")
|
text: i18n("Minimize to system tray on startup")
|
||||||
checked: Config.minimizeToSystemTrayOnStartup
|
checked: NeoChatConfig.minimizeToSystemTrayOnStartup
|
||||||
visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile
|
visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile
|
||||||
enabled: Config.systemTray && !Config.isMinimizeToSystemTrayOnStartupImmutable
|
enabled: NeoChatConfig.systemTray && !NeoChatConfig.isMinimizeToSystemTrayOnStartupImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.minimizeToSystemTrayOnStartup = checked;
|
NeoChatConfig.minimizeToSystemTrayOnStartup = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,12 +56,12 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: automaticallyDelegate
|
id: automaticallyDelegate
|
||||||
text: i18n("Automatically hide/unhide the room information when resizing the window")
|
text: i18n("Automatically hide/unhide the room information when resizing the window")
|
||||||
checked: Config.autoRoomInfoDrawer
|
checked: NeoChatConfig.autoRoomInfoDrawer
|
||||||
enabled: !Config.isAutoRoomInfoDrawerImmutable
|
enabled: !NeoChatConfig.isAutoRoomInfoDrawerImmutable
|
||||||
visible: Qt.platform.os !== "android"
|
visible: Qt.platform.os !== "android"
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.autoRoomInfoDrawer = checked;
|
NeoChatConfig.autoRoomInfoDrawer = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,11 +72,11 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: categorizeDelegate
|
id: categorizeDelegate
|
||||||
text: i18n("Show all rooms in \"Home\" tab")
|
text: i18n("Show all rooms in \"Home\" tab")
|
||||||
checked: Config.allRoomsInHome
|
checked: NeoChatConfig.allRoomsInHome
|
||||||
enabled: !Config.isAllRoomsInHomeImmutable
|
enabled: !NeoChatConfig.isAllRoomsInHomeImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.allRoomsInHome = checked;
|
NeoChatConfig.allRoomsInHome = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,20 +87,20 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCard {
|
FormCard.FormCard {
|
||||||
FormCard.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18nc("As in 'sort something based on last activity'", "Activity")
|
text: i18nc("As in 'sort something based on last activity'", "Activity")
|
||||||
checked: Config.sortOrder === 1
|
checked: NeoChatConfig.sortOrder === 1
|
||||||
enabled: !Config.isSortOrderImmutable
|
enabled: !NeoChatConfig.isSortOrderImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.sortOrder = 1
|
NeoChatConfig.sortOrder = 1
|
||||||
Config.save()
|
NeoChatConfig.save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FormCard.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18nc("As in 'sort something alphabetically'", "Alphabetical")
|
text: i18nc("As in 'sort something alphabetically'", "Alphabetical")
|
||||||
checked: Config.sortOrder === 0
|
checked: NeoChatConfig.sortOrder === 0
|
||||||
enabled: !Config.isSortOrderImmutable
|
enabled: !NeoChatConfig.isSortOrderImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.sortOrder = 0
|
NeoChatConfig.sortOrder = 0
|
||||||
Config.save()
|
NeoChatConfig.save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,11 +111,11 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: showDeletedMessages
|
id: showDeletedMessages
|
||||||
text: i18n("Show deleted messages")
|
text: i18n("Show deleted messages")
|
||||||
checked: Config.showDeletedMessages
|
checked: NeoChatConfig.showDeletedMessages
|
||||||
enabled: !Config.isShowDeletedMessagesImmutable
|
enabled: !NeoChatConfig.isShowDeletedMessagesImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.showDeletedMessages = checked;
|
NeoChatConfig.showDeletedMessages = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,65 +127,65 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: showStateEvents
|
id: showStateEvents
|
||||||
text: i18n("Show state events")
|
text: i18n("Show state events")
|
||||||
checked: Config.showStateEvent
|
checked: NeoChatConfig.showStateEvent
|
||||||
enabled: !Config.isShowStateEventImmutable
|
enabled: !NeoChatConfig.isShowStateEventImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.showStateEvent = checked;
|
NeoChatConfig.showStateEvent = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FormCard.FormDelegateSeparator {
|
FormCard.FormDelegateSeparator {
|
||||||
visible: Config.showStateEvent
|
visible: NeoChatConfig.showStateEvent
|
||||||
above: showStateEvents
|
above: showStateEvents
|
||||||
below: showLeaveJoinEventDelegate
|
below: showLeaveJoinEventDelegate
|
||||||
}
|
}
|
||||||
|
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: showLeaveJoinEventDelegate
|
id: showLeaveJoinEventDelegate
|
||||||
visible: Config.showStateEvent
|
visible: NeoChatConfig.showStateEvent
|
||||||
text: i18n("Show leave and join events")
|
text: i18n("Show leave and join events")
|
||||||
checked: Config.showLeaveJoinEvent
|
checked: NeoChatConfig.showLeaveJoinEvent
|
||||||
enabled: !Config.isShowLeaveJoinEventImmutable
|
enabled: !NeoChatConfig.isShowLeaveJoinEventImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.showLeaveJoinEvent = checked;
|
NeoChatConfig.showLeaveJoinEvent = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FormCard.FormDelegateSeparator {
|
FormCard.FormDelegateSeparator {
|
||||||
visible: Config.showStateEvent
|
visible: NeoChatConfig.showStateEvent
|
||||||
above: showLeaveJoinEventDelegate
|
above: showLeaveJoinEventDelegate
|
||||||
below: showNameDelegate
|
below: showNameDelegate
|
||||||
}
|
}
|
||||||
|
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: showNameDelegate
|
id: showNameDelegate
|
||||||
visible: Config.showStateEvent
|
visible: NeoChatConfig.showStateEvent
|
||||||
text: i18n("Show name change events")
|
text: i18n("Show name change events")
|
||||||
checked: Config.showRename
|
checked: NeoChatConfig.showRename
|
||||||
enabled: !Config.isShowRenameImmutable
|
enabled: !NeoChatConfig.isShowRenameImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.showRename = checked;
|
NeoChatConfig.showRename = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FormCard.FormDelegateSeparator {
|
FormCard.FormDelegateSeparator {
|
||||||
visible: Config.showStateEvent
|
visible: NeoChatConfig.showStateEvent
|
||||||
above: showNameDelegate
|
above: showNameDelegate
|
||||||
below: showAvatarChangeDelegate
|
below: showAvatarChangeDelegate
|
||||||
}
|
}
|
||||||
|
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: showAvatarChangeDelegate
|
id: showAvatarChangeDelegate
|
||||||
visible: Config.showStateEvent
|
visible: NeoChatConfig.showStateEvent
|
||||||
text: i18n("Show avatar update events")
|
text: i18n("Show avatar update events")
|
||||||
checked: Config.showAvatarUpdate
|
checked: NeoChatConfig.showAvatarUpdate
|
||||||
enabled: !Config.isShowAvatarUpdateImmutable
|
enabled: !NeoChatConfig.isShowAvatarUpdateImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.showAvatarUpdate = checked;
|
NeoChatConfig.showAvatarUpdate = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,11 +196,11 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: quickEditCheckbox
|
id: quickEditCheckbox
|
||||||
text: i18n("Use s/text/replacement syntax to edit your last message")
|
text: i18n("Use s/text/replacement syntax to edit your last message")
|
||||||
checked: Config.allowQuickEdit
|
checked: NeoChatConfig.allowQuickEdit
|
||||||
enabled: !Config.isAllowQuickEditImmutable
|
enabled: !NeoChatConfig.isAllowQuickEditImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.allowQuickEdit = checked;
|
NeoChatConfig.allowQuickEdit = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FormCard.FormDelegateSeparator {
|
FormCard.FormDelegateSeparator {
|
||||||
@@ -210,11 +210,11 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
id: typingNotificationsDelegate
|
id: typingNotificationsDelegate
|
||||||
text: i18n("Send typing notifications")
|
text: i18n("Send typing notifications")
|
||||||
checked: Config.typingNotifications
|
checked: NeoChatConfig.typingNotifications
|
||||||
enabled: !Config.isTypingNotificationsImmutable
|
enabled: !NeoChatConfig.isTypingNotificationsImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.typingNotifications = checked;
|
NeoChatConfig.typingNotifications = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,15 +224,15 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormCard {
|
FormCard.FormCard {
|
||||||
FormCard.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
text: i18n("Enable developer tools")
|
text: i18n("Enable developer tools")
|
||||||
checked: Config.developerTools
|
checked: NeoChatConfig.developerTools
|
||||||
enabled: !Config.isDeveloperToolsImmutable
|
enabled: !NeoChatConfig.isDeveloperToolsImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
Config.developerTools = checked;
|
NeoChatConfig.developerTools = checked;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FormCard.FormButtonDelegate {
|
FormCard.FormButtonDelegate {
|
||||||
visible: Config.developerTools
|
visible: NeoChatConfig.developerTools
|
||||||
text: i18n("Open developer tools")
|
text: i18n("Open developer tools")
|
||||||
onClicked: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
|
onClicked: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ KirigamiSettings.CategorizedSettings {
|
|||||||
actionName: "spellChecking"
|
actionName: "spellChecking"
|
||||||
text: i18n("Spell Checking")
|
text: i18n("Spell Checking")
|
||||||
icon.name: "tools-check-spelling"
|
icon.name: "tools-check-spelling"
|
||||||
page: Qt.resolvedUrl("SonnetConfigPage.qml")
|
page: Qt.resolvedUrl("SonnetConfigpage.qml")
|
||||||
visible: Qt.platform.os !== "android"
|
visible: Qt.platform.os !== "android"
|
||||||
},
|
},
|
||||||
KirigamiSettings.SettingAction {
|
KirigamiSettings.SettingAction {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18n("System Default")
|
text: i18n("System Default")
|
||||||
checked: currentType === 0
|
checked: currentType === 0
|
||||||
enabled: !Config.isProxyTypeImmutable
|
enabled: !NeoChatConfig.isProxyTypeImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
currentType = 0;
|
currentType = 0;
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18n("No Proxy")
|
text: i18n("No Proxy")
|
||||||
checked: currentType === 3
|
checked: currentType === 3
|
||||||
enabled: !Config.isProxyTypeImmutable
|
enabled: !NeoChatConfig.isProxyTypeImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
currentType = 3;
|
currentType = 3;
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18n("HTTP")
|
text: i18n("HTTP")
|
||||||
checked: currentType === 1
|
checked: currentType === 1
|
||||||
enabled: !Config.isProxyTypeImmutable
|
enabled: !NeoChatConfig.isProxyTypeImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
currentType = 1;
|
currentType = 1;
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18n("Socks5")
|
text: i18n("Socks5")
|
||||||
checked: currentType === 2
|
checked: currentType === 2
|
||||||
enabled: !Config.isProxyTypeImmutable
|
enabled: !NeoChatConfig.isProxyTypeImmutable
|
||||||
onToggled: {
|
onToggled: {
|
||||||
currentType = 2;
|
currentType = 2;
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormTextFieldDelegate {
|
FormCard.FormTextFieldDelegate {
|
||||||
id: hostField
|
id: hostField
|
||||||
label: i18n("Host")
|
label: i18n("Host")
|
||||||
text: Config.proxyHost
|
text: NeoChatConfig.proxyHost
|
||||||
inputMethodHints: Qt.ImhUrlCharactersOnly
|
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
proxyConfigChanged = true;
|
proxyConfigChanged = true;
|
||||||
@@ -71,7 +71,7 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormSpinBoxDelegate {
|
FormCard.FormSpinBoxDelegate {
|
||||||
id: portField
|
id: portField
|
||||||
label: i18n("Port")
|
label: i18n("Port")
|
||||||
value: Config.proxyPort
|
value: NeoChatConfig.proxyPort
|
||||||
from: 0
|
from: 0
|
||||||
to: 65536
|
to: 65536
|
||||||
textFromValue: function (value, locale) {
|
textFromValue: function (value, locale) {
|
||||||
@@ -84,7 +84,7 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormTextFieldDelegate {
|
FormCard.FormTextFieldDelegate {
|
||||||
id: userField
|
id: userField
|
||||||
label: i18n("User")
|
label: i18n("User")
|
||||||
text: Config.proxyUser
|
text: NeoChatConfig.proxyUser
|
||||||
inputMethodHints: Qt.ImhUrlCharactersOnly
|
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
proxyConfigChanged = true;
|
proxyConfigChanged = true;
|
||||||
@@ -93,7 +93,7 @@ FormCard.FormCardPage {
|
|||||||
FormCard.FormTextFieldDelegate {
|
FormCard.FormTextFieldDelegate {
|
||||||
id: passwordField
|
id: passwordField
|
||||||
label: i18n("Password")
|
label: i18n("Password")
|
||||||
text: Config.proxyPassword
|
text: NeoChatConfig.proxyPassword
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
inputMethodHints: Qt.ImhUrlCharactersOnly
|
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
@@ -111,14 +111,14 @@ FormCard.FormCardPage {
|
|||||||
|
|
||||||
QQC2.Button {
|
QQC2.Button {
|
||||||
text: i18n("Apply")
|
text: i18n("Apply")
|
||||||
enabled: currentType !== Config.proxyType || proxyConfigChanged
|
enabled: currentType !== NeoChatConfig.proxyType || proxyConfigChanged
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Config.proxyType = currentType;
|
NeoChatConfig.proxyType = currentType;
|
||||||
Config.proxyHost = hostField.text;
|
NeoChatConfig.proxyHost = hostField.text;
|
||||||
Config.proxyPort = portField.value;
|
NeoChatConfig.proxyPort = portField.value;
|
||||||
Config.proxyUser = userField.text;
|
NeoChatConfig.proxyUser = userField.text;
|
||||||
Config.proxyPassword = passwordField.text;
|
NeoChatConfig.proxyPassword = passwordField.text;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
proxyConfigChanged = false;
|
proxyConfigChanged = false;
|
||||||
ProxyController.setApplicationProxy();
|
ProxyController.setApplicationProxy();
|
||||||
}
|
}
|
||||||
@@ -127,6 +127,6 @@ FormCard.FormCardPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
currentType = Config.proxyType;
|
currentType = NeoChatConfig.proxyType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ DelegateChooser {
|
|||||||
|
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
roleValue: DelegateType.Other
|
roleValue: DelegateType.Other
|
||||||
delegate: Config.showAllEvents ? hiddenDelegate : emptyDelegate
|
delegate: NeoChatConfig.showAllEvents ? hiddenDelegate : emptyDelegate
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: hiddenDelegate
|
id: hiddenDelegate
|
||||||
|
|||||||
@@ -197,10 +197,10 @@ ColumnLayout {
|
|||||||
|
|
||||||
FileDialog {
|
FileDialog {
|
||||||
fileMode: FileDialog.SaveFile
|
fileMode: FileDialog.SaveFile
|
||||||
folder: Config.lastSaveDirectory.length > 0 ? Config.lastSaveDirectory : StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
folder: NeoChatConfig.lastSaveDirectory.length > 0 ? NeoChatConfig.lastSaveDirectory : StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
Config.lastSaveDirectory = folder;
|
NeoChatConfig.lastSaveDirectory = folder;
|
||||||
Config.save();
|
NeoChatConfig.save();
|
||||||
if (autoOpenFile) {
|
if (autoOpenFile) {
|
||||||
UrlHelper.copyTo(root.fileTransferInfo.localPath, file);
|
UrlHelper.copyTo(root.fileTransferInfo.localPath, file);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ TimelineDelegate {
|
|||||||
required property var author
|
required property var author
|
||||||
|
|
||||||
width: parent?.width
|
width: parent?.width
|
||||||
rightPadding: Config.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
rightPadding: NeoChatConfig.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
||||||
|
|
||||||
alwaysFillWidth: Config.compactLayout
|
alwaysFillWidth: NeoChatConfig.compactLayout
|
||||||
|
|
||||||
contentItem: QQC2.Control {
|
contentItem: QQC2.Control {
|
||||||
id: contentControl
|
id: contentControl
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ TimelineDelegate {
|
|||||||
id: root
|
id: root
|
||||||
|
|
||||||
width: parent?.width
|
width: parent?.width
|
||||||
rightPadding: Config.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
rightPadding: NeoChatConfig.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
||||||
|
|
||||||
alwaysFillWidth: Config.compactLayout
|
alwaysFillWidth: NeoChatConfig.compactLayout
|
||||||
|
|
||||||
contentItem: Kirigami.PlaceholderMessage {
|
contentItem: Kirigami.PlaceholderMessage {
|
||||||
text: i18n("Loading…")
|
text: i18n("Loading…")
|
||||||
|
|||||||
@@ -237,9 +237,9 @@ TimelineDelegate {
|
|||||||
property real contentMaxWidth: bubbleSizeHelper.currentWidth - bubble.leftPadding - bubble.rightPadding
|
property real contentMaxWidth: bubbleSizeHelper.currentWidth - bubble.leftPadding - bubble.rightPadding
|
||||||
|
|
||||||
width: parent?.width
|
width: parent?.width
|
||||||
rightPadding: Config.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
rightPadding: NeoChatConfig.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
||||||
|
|
||||||
alwaysFillWidth: Config.compactLayout
|
alwaysFillWidth: NeoChatConfig.compactLayout
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
spacing: Kirigami.Units.smallSpacing
|
spacing: Kirigami.Units.smallSpacing
|
||||||
@@ -249,13 +249,13 @@ TimelineDelegate {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: root.showSection
|
visible: root.showSection
|
||||||
labelText: root.section
|
labelText: root.section
|
||||||
colorSet: Config.compactLayout || root.alwaysFillWidth ? Kirigami.Theme.View : Kirigami.Theme.Window
|
colorSet: NeoChatConfig.compactLayout || root.alwaysFillWidth ? Kirigami.Theme.View : Kirigami.Theme.Window
|
||||||
}
|
}
|
||||||
QQC2.ItemDelegate {
|
QQC2.ItemDelegate {
|
||||||
id: mainContainer
|
id: mainContainer
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: root.showAuthor || root.alwaysShowAuthor ? Kirigami.Units.largeSpacing : (Config.compactLayout ? 1 : Kirigami.Units.smallSpacing)
|
Layout.topMargin: root.showAuthor || root.alwaysShowAuthor ? Kirigami.Units.largeSpacing : (NeoChatConfig.compactLayout ? 1 : Kirigami.Units.smallSpacing)
|
||||||
Layout.leftMargin: Kirigami.Units.smallSpacing
|
Layout.leftMargin: Kirigami.Units.smallSpacing
|
||||||
Layout.rightMargin: Kirigami.Units.smallSpacing
|
Layout.rightMargin: Kirigami.Units.smallSpacing
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ TimelineDelegate {
|
|||||||
|
|
||||||
KirigamiComponents.AvatarButton {
|
KirigamiComponents.AvatarButton {
|
||||||
id: avatar
|
id: avatar
|
||||||
width: visible || Config.showAvatarInTimeline ? Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2 : 0
|
width: visible || NeoChatConfig.showAvatarInTimeline ? Kirigami.Units.gridUnit + Kirigami.Units.largeSpacing * 2 : 0
|
||||||
height: width
|
height: width
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
@@ -279,7 +279,7 @@ TimelineDelegate {
|
|||||||
topMargin: Kirigami.Units.smallSpacing
|
topMargin: Kirigami.Units.smallSpacing
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: (root.showAuthor || root.alwaysShowAuthor) && Config.showAvatarInTimeline && (Config.compactLayout || !_private.showUserMessageOnRight)
|
visible: (root.showAuthor || root.alwaysShowAuthor) && NeoChatConfig.showAvatarInTimeline && (NeoChatConfig.compactLayout || !_private.showUserMessageOnRight)
|
||||||
name: root.author.displayName
|
name: root.author.displayName
|
||||||
source: root.author.avatarSource
|
source: root.author.avatarSource
|
||||||
color: root.author.color
|
color: root.author.color
|
||||||
@@ -294,9 +294,9 @@ TimelineDelegate {
|
|||||||
anchors.rightMargin: Kirigami.Units.largeSpacing
|
anchors.rightMargin: Kirigami.Units.largeSpacing
|
||||||
maxContentWidth: root.contentMaxWidth
|
maxContentWidth: root.contentMaxWidth
|
||||||
|
|
||||||
topPadding: Config.compactLayout ? Kirigami.Units.smallSpacing / 2 : Kirigami.Units.largeSpacing
|
topPadding: NeoChatConfig.compactLayout ? Kirigami.Units.smallSpacing / 2 : Kirigami.Units.largeSpacing
|
||||||
bottomPadding: Config.compactLayout ? Kirigami.Units.mediumSpacing / 2 : Kirigami.Units.largeSpacing
|
bottomPadding: NeoChatConfig.compactLayout ? Kirigami.Units.mediumSpacing / 2 : Kirigami.Units.largeSpacing
|
||||||
leftPadding: Config.compactLayout ? 0 : Kirigami.Units.largeSpacing + Kirigami.Units.smallSpacing
|
leftPadding: NeoChatConfig.compactLayout ? 0 : Kirigami.Units.largeSpacing + Kirigami.Units.smallSpacing
|
||||||
rightPadding: Kirigami.Units.largeSpacing + Kirigami.Units.smallSpacing
|
rightPadding: Kirigami.Units.largeSpacing + Kirigami.Units.smallSpacing
|
||||||
|
|
||||||
state: _private.showUserMessageOnRight ? "userMessageOnRight" : "userMessageOnLeft"
|
state: _private.showUserMessageOnRight ? "userMessageOnRight" : "userMessageOnLeft"
|
||||||
@@ -343,11 +343,11 @@ TimelineDelegate {
|
|||||||
}
|
}
|
||||||
onShowMessageMenu: _private.showMessageMenu()
|
onShowMessageMenu: _private.showMessageMenu()
|
||||||
|
|
||||||
showBackground: root.cardBackground && !Config.compactLayout
|
showBackground: root.cardBackground && !NeoChatConfig.compactLayout
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
visible: mainContainer.hovered && (Config.compactLayout || root.alwaysFillWidth)
|
visible: mainContainer.hovered && (NeoChatConfig.compactLayout || root.alwaysFillWidth)
|
||||||
color: Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, Kirigami.Theme.highlightColor, 0.15)
|
color: Kirigami.ColorUtils.tintWithAlpha(Kirigami.Theme.backgroundColor, Kirigami.Theme.highlightColor, 0.15)
|
||||||
radius: Kirigami.Units.cornerRadius
|
radius: Kirigami.Units.cornerRadius
|
||||||
}
|
}
|
||||||
@@ -390,7 +390,7 @@ TimelineDelegate {
|
|||||||
startPercentWidth: root.alwaysFillWidth ? 100 : 90
|
startPercentWidth: root.alwaysFillWidth ? 100 : 90
|
||||||
endPercentWidth: root.alwaysFillWidth ? 100 : 60
|
endPercentWidth: root.alwaysFillWidth ? 100 : 60
|
||||||
|
|
||||||
parentWidth: mainContainer.availableWidth - (Config.showAvatarInTimeline ? avatar.width + bubble.anchors.leftMargin : 0)
|
parentWidth: mainContainer.availableWidth - (NeoChatConfig.showAvatarInTimeline ? avatar.width + bubble.anchors.leftMargin : 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,7 +411,7 @@ TimelineDelegate {
|
|||||||
/**
|
/**
|
||||||
* @brief Whether local user messages should be aligned right.
|
* @brief Whether local user messages should be aligned right.
|
||||||
*/
|
*/
|
||||||
property bool showUserMessageOnRight: Config.showLocalMessagesOnRight && root.author.isLocalUser && !Config.compactLayout && !root.alwaysFillWidth
|
property bool showUserMessageOnRight: NeoChatConfig.showLocalMessagesOnRight && root.author.isLocalUser && !NeoChatConfig.compactLayout && !root.alwaysFillWidth
|
||||||
|
|
||||||
function showMessageMenu() {
|
function showMessageMenu() {
|
||||||
RoomManager.viewEventMenu(root.eventId, root.room, root.selectedText);
|
RoomManager.viewEventMenu(root.eventId, root.room, root.selectedText);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ Flow {
|
|||||||
background: Kirigami.ShadowedRectangle {
|
background: Kirigami.ShadowedRectangle {
|
||||||
color: reactionDelegate.hasLocalUser ? Kirigami.Theme.positiveBackgroundColor : Kirigami.Theme.backgroundColor
|
color: reactionDelegate.hasLocalUser ? Kirigami.Theme.positiveBackgroundColor : Kirigami.Theme.backgroundColor
|
||||||
Kirigami.Theme.inherit: false
|
Kirigami.Theme.inherit: false
|
||||||
Kirigami.Theme.colorSet: Config.compactLayout ? Kirigami.Theme.Window : Kirigami.Theme.View
|
Kirigami.Theme.colorSet: NeoChatConfig.compactLayout ? Kirigami.Theme.Window : Kirigami.Theme.View
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
shadow {
|
shadow {
|
||||||
size: Kirigami.Units.smallSpacing
|
size: Kirigami.Units.smallSpacing
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ TimelineDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
width: parent?.width
|
width: parent?.width
|
||||||
rightPadding: Config.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
rightPadding: NeoChatConfig.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
||||||
|
|
||||||
alwaysFillWidth: Config.compactLayout
|
alwaysFillWidth: NeoChatConfig.compactLayout
|
||||||
|
|
||||||
contentItem: QQC2.ItemDelegate {
|
contentItem: QQC2.ItemDelegate {
|
||||||
padding: Kirigami.Units.largeSpacing
|
padding: Kirigami.Units.largeSpacing
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ QQC2.ItemDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: Config.blur ? "transparent" : Kirigami.Theme.backgroundColor
|
color: NeoChatConfig.blur ? "transparent" : Kirigami.Theme.backgroundColor
|
||||||
Kirigami.Theme.inherit: false
|
Kirigami.Theme.inherit: false
|
||||||
Kirigami.Theme.colorSet: root.colorSet
|
Kirigami.Theme.colorSet: root.colorSet
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,16 +74,16 @@ TimelineDelegate {
|
|||||||
property bool folded: true
|
property bool folded: true
|
||||||
|
|
||||||
width: parent?.width
|
width: parent?.width
|
||||||
rightPadding: Config.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
rightPadding: NeoChatConfig.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
||||||
|
|
||||||
alwaysFillWidth: Config.compactLayout
|
alwaysFillWidth: NeoChatConfig.compactLayout
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
SectionDelegate {
|
SectionDelegate {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: root.showSection
|
visible: root.showSection
|
||||||
labelText: root.section
|
labelText: root.section
|
||||||
colorSet: Config.compactLayout ? Kirigami.Theme.View : Kirigami.Theme.Window
|
colorSet: NeoChatConfig.compactLayout ? Kirigami.Theme.View : Kirigami.Theme.Window
|
||||||
}
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ TimelineDelegate {
|
|||||||
required property NeoChatRoom room
|
required property NeoChatRoom room
|
||||||
|
|
||||||
width: parent?.width
|
width: parent?.width
|
||||||
rightPadding: Config.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
rightPadding: NeoChatConfig.compactLayout && root.ListView.view.width >= Kirigami.Units.gridUnit * 20 ? Kirigami.Units.gridUnit * 2 + Kirigami.Units.largeSpacing : Kirigami.Units.largeSpacing
|
||||||
|
|
||||||
alwaysFillWidth: Config.compactLayout
|
alwaysFillWidth: NeoChatConfig.compactLayout
|
||||||
|
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|||||||
Reference in New Issue
Block a user