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 { LabelWithButtonType {
id: backup id: backup
visible: !SettingsController.isOnTv()
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Backup") text: qsTr("Backup")
@ -98,7 +99,9 @@ PageType {
} }
} }
DividerType {} DividerType {
visible: !SettingsController.isOnTv()
}
LabelWithButtonType { LabelWithButtonType {
id: about id: about

View file

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

View file

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