- Move the ~17 top-level QML files into views/, settings/, and forms/ subdirectories, grouped so cross-directory type references stay minimal (only 3 files need an added `import` line). Root now only holds the four surfaces plugin.json points at directly. - Add a `dms ipc call dankChat popout` IPC target to open the floating window directly, alongside the existing `toggle`, and document both in the README along with the new directory layout. - Add one line of breathing room between the last message and the composer bar via the message ListView's bottomMargin (measured with FontMetrics rather than a guessed pixel value). Co-Authored-By: Claude Sonnet 5 <[email protected]>
58 lines
1.5 KiB
QML
58 lines
1.5 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import qs.Common
|
|
import qs.Widgets
|
|
|
|
// XMPP's account shape isn't IRC's nick/host/port - it's a single JID
|
|
// (user@domain, optionally /resource) plus a password, since unlike IRC,
|
|
// XMPP has no anonymous auth. See actions.h's ChatdXmppAccountOptions for
|
|
// why this is a separate form/backend path rather than reusing IRC's.
|
|
ColumnLayout {
|
|
id: root
|
|
|
|
signal connectRequested(string jid, string password)
|
|
|
|
property string errorText: ""
|
|
|
|
spacing: Theme.spacingXS
|
|
|
|
RowLayout {
|
|
Layout.fillWidth: true
|
|
spacing: Theme.spacingXS
|
|
|
|
DankTextField {
|
|
id: jidField
|
|
Layout.fillWidth: true
|
|
placeholderText: "[email protected]"
|
|
}
|
|
|
|
DankTextField {
|
|
id: passwordField
|
|
Layout.preferredWidth: 160
|
|
placeholderText: "password"
|
|
echoMode: TextInput.Password
|
|
}
|
|
|
|
DankButton {
|
|
text: "Connect"
|
|
onClicked: {
|
|
if (!jidField.text || !passwordField.text) {
|
|
root.errorText = "JID and password are required.";
|
|
return;
|
|
}
|
|
root.errorText = "";
|
|
root.connectRequested(jidField.text, passwordField.text);
|
|
passwordField.text = "";
|
|
}
|
|
}
|
|
}
|
|
|
|
StyledText {
|
|
Layout.fillWidth: true
|
|
visible: root.errorText !== ""
|
|
text: root.errorText
|
|
color: Theme.error
|
|
wrapMode: Text.WordWrap
|
|
}
|
|
}
|