UploadBars: tooltip and expand text on error/click
This commit is contained in:
parent
e4aa3b6572
commit
92bfb02446
|
@ -221,6 +221,7 @@ class MatrixClient(nio.AsyncClient):
|
||||||
self.models[Upload, room_id][upload_item.uuid] = upload_item
|
self.models[Upload, room_id][upload_item.uuid] = upload_item
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
raise MatrixError(111, "Ooops!")
|
||||||
url, mime, crypt_dict = await self.upload(
|
url, mime, crypt_dict = await self.upload(
|
||||||
path, filename=path.name, encrypt=encrypt,
|
path, filename=path.name, encrypt=encrypt,
|
||||||
)
|
)
|
||||||
|
|
|
@ -37,8 +37,9 @@ Rectangle {
|
||||||
|
|
||||||
HRowLayout {
|
HRowLayout {
|
||||||
HLabel {
|
HLabel {
|
||||||
id: filenameLabel
|
id: statusLabel
|
||||||
elide: Text.ElideRight
|
elide: expand ? Text.ElideNone : Text.ElideRight
|
||||||
|
wrapMode: expand ? Text.Wrap : Text.NoWrap
|
||||||
|
|
||||||
color: model.status === "Error" ?
|
color: model.status === "Error" ?
|
||||||
theme.colors.errorText : theme.colors.text
|
theme.colors.errorText : theme.colors.text
|
||||||
|
@ -81,6 +82,8 @@ Rectangle {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
property bool expand: model.status === "Error"
|
||||||
|
|
||||||
readonly property string fileName:
|
readonly property string fileName:
|
||||||
model.filepath.split("/").slice(-1)[0]
|
model.filepath.split("/").slice(-1)[0]
|
||||||
}
|
}
|
||||||
|
@ -103,6 +106,18 @@ Rectangle {
|
||||||
|
|
||||||
Behavior on Layout.preferredWidth { HNumberAnimation {} }
|
Behavior on Layout.preferredWidth { HNumberAnimation {} }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TapHandler {
|
||||||
|
onTapped: statusLabel.expand = ! statusLabel.expand
|
||||||
|
}
|
||||||
|
|
||||||
|
HoverHandler { id: infoRowHover }
|
||||||
|
|
||||||
|
HToolTip {
|
||||||
|
id: statusToolTip
|
||||||
|
text: statusLabel.truncated ? statusLabel.text : ""
|
||||||
|
visible: text && infoRowHover.hovered
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HProgressBar {
|
HProgressBar {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user