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
|
||||
|
||||
try:
|
||||
raise MatrixError(111, "Ooops!")
|
||||
url, mime, crypt_dict = await self.upload(
|
||||
path, filename=path.name, encrypt=encrypt,
|
||||
)
|
||||
|
|
|
@ -37,8 +37,9 @@ Rectangle {
|
|||
|
||||
HRowLayout {
|
||||
HLabel {
|
||||
id: filenameLabel
|
||||
elide: Text.ElideRight
|
||||
id: statusLabel
|
||||
elide: expand ? Text.ElideNone : Text.ElideRight
|
||||
wrapMode: expand ? Text.Wrap : Text.NoWrap
|
||||
|
||||
color: model.status === "Error" ?
|
||||
theme.colors.errorText : theme.colors.text
|
||||
|
@ -81,6 +82,8 @@ Rectangle {
|
|||
|
||||
Layout.fillWidth: true
|
||||
|
||||
property bool expand: model.status === "Error"
|
||||
|
||||
readonly property string fileName:
|
||||
model.filepath.split("/").slice(-1)[0]
|
||||
}
|
||||
|
@ -103,6 +106,18 @@ Rectangle {
|
|||
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user