Changed the installed button to be a secondary button

CURA-6006
This commit is contained in:
Jaime van Kessel 2018-12-07 09:44:09 +01:00
parent 9eb09132d6
commit eaf413997d
2 changed files with 27 additions and 14 deletions

View File

@ -16,24 +16,36 @@ Column
width: UM.Theme.getSize("toolbox_action_button").width width: UM.Theme.getSize("toolbox_action_button").width
spacing: UM.Theme.getSize("narrow_margin").height spacing: UM.Theme.getSize("narrow_margin").height
ToolboxProgressButton Item
{ {
id: installButton width: installButton.width
active: toolbox.isDownloading && toolbox.activePackage == model height: installButton.height
complete: installed ToolboxProgressButton
onReadyAction:
{ {
toolbox.activePackage = model id: installButton
toolbox.startDownload(model.download_url) active: toolbox.isDownloading && toolbox.activePackage == model
onReadyAction:
{
toolbox.activePackage = model
toolbox.startDownload(model.download_url)
}
onActiveAction: toolbox.cancelDownload()
// Don't allow installing while another download is running
enabled: installed || (!(toolbox.isDownloading && toolbox.activePackage != model) && !loginRequired)
opacity: enabled ? 1.0 : 0.5
visible: !updateButton.visible && !installed// Don't show when the update button is visible
} }
onActiveAction: toolbox.cancelDownload()
onCompleteAction: toolbox.viewCategory = "installed" Cura.SecondaryButton
{
// Don't allow installing while another download is running visible: installed
enabled: installed || (!(toolbox.isDownloading && toolbox.activePackage != model) && !loginRequired) onClicked: toolbox.viewCategory = "installed"
opacity: enabled ? 1.0 : 0.5 text: catalog.i18nc("@action:button", "Installed")
visible: !updateButton.visible // Don't show when the update button is visible fixedWidthMode: true
width: installButton.width
height: installButton.height
}
} }
Label Label

View File

@ -7,6 +7,7 @@ import QtQuick.Controls.Styles 1.4
import UM 1.1 as UM import UM 1.1 as UM
import Cura 1.0 as Cura import Cura 1.0 as Cura
// TODO; This is in quite some need for refactoring.
Item Item
{ {
id: base id: base