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