fix: hide UI elements that use file saving

This commit is contained in:
albexk 2024-11-25 13:56:14 +03:00
parent c72d76aec7
commit 09b1f322ba
3 changed files with 15 additions and 7 deletions

View file

@ -87,6 +87,7 @@ PageType {
LabelWithButtonType {
id: backup
visible: !SettingsController.isOnTv()
Layout.fillWidth: true
text: qsTr("Backup")
@ -98,7 +99,9 @@ PageType {
}
}
DividerType {}
DividerType {
visible: !SettingsController.isOnTv()
}
LabelWithButtonType {
id: about

View file

@ -373,6 +373,7 @@ PageType {
LabelWithButtonType {
id: exportSitesButton
visible: !SettingsController.isOnTv()
Layout.fillWidth: true
text: qsTr("Save site list")
@ -396,7 +397,9 @@ PageType {
}
}
DividerType {}
DividerType {
visible: !SettingsController.isOnTv()
}
}
}

View file

@ -324,14 +324,16 @@ PageType {
target: ServersModel
function onModelReset() {
var hasServerWithWriteAccess = ServersModel.hasServerWithWriteAccess()
shareTabButton.visible = hasServerWithWriteAccess
shareTabButton.width = hasServerWithWriteAccess ? undefined : 0
if (!SettingsController.isOnTv()) {
var hasServerWithWriteAccess = ServersModel.hasServerWithWriteAccess()
shareTabButton.visible = hasServerWithWriteAccess
shareTabButton.width = hasServerWithWriteAccess ? undefined : 0
}
}
}
visible: ServersModel.hasServerWithWriteAccess()
width: ServersModel.hasServerWithWriteAccess() ? undefined : 0
visible: !SettingsController.isOnTv() && ServersModel.hasServerWithWriteAccess()
width: !SettingsController.isOnTv() && ServersModel.hasServerWithWriteAccess() ? undefined : 0
isSelected: tabBar.currentIndex === 1
image: "qrc:/images/controls/share-2.svg"