# AtlasAppCard

> A store card for one app: icon, name, short summary, rating and size, with an install button at the end.

AtlasAppCard shows one app in a store. Pressing the card anywhere except on its action emits `clicked`: open the app's page. The action at the end is an [AtlasInstallButton](https://atlasos.eterneon.net/framework/atlas-ui/atlas-install-button.md) unless you give another through `actionComponent`.

AtlasAppCard is a Qt Quick Templates `AbstractButton`; its inherited properties (`icon.name`, `icon.source`, `clicked`) work as usual. See <https://doc.qt.io/qt-6/qml-qtquick-controls-abstractbutton.html>.

## Example

```qml
AtlasAppCard {
    name: "Atlas Notepad"
    summary: qsTr("Fast, plain text editing")
    icon.name: "accessories-text-editor"      // or icon.source: a url
    rating: 4.6                                // 0 hides it
    sizeText: "12 MB"
    installState: "installing"                 // see AtlasInstallButton
    progress: 0.4
    onClicked: openPage()
    onActionClicked: install()
    onCancelRequested: cancel()
}
```

Another action goes in `actionComponent`, a Component the card sizes and centres at its end:

```qml
AtlasAppCard {
    actionComponent: Component { TextButton { text: qsTr("Manage") } }
}
```

## Keyboard

The card is a Tab stop, and so is its action. Return or Enter on the focused card emits `clicked`; an action inside the card that has focus keeps its own Return.

## Properties

| Name | Type | Default | Description |
|---|---|---|---|
| `actionComponent` | `Component` | `defaultAction` | Replaces the AtlasInstallButton. Leave it alone to keep the default. |
| `defaultAction` | `Component` (read-only) | an AtlasInstallButton | The default action, bound to `installState` and `progress`. |
| `installState` | `string` | `"install"` | Forwarded to the default action; see [AtlasInstallButton](https://atlasos.eterneon.net/framework/atlas-ui/atlas-install-button.md). |
| `name` | `string` | `""` | The app's name, also its spoken name. |
| `progress` | `real` | `-1` | Forwarded to the default action; see AtlasInstallButton. |
| `rating` | `real` | `0` | Stars, 0 to 5. A value of 0 or less shows none. |
| `sizeText` | `string` | `""` | The download or installed size, already formatted ("12 MB"). |
| `summary` | `string` | `""` | A short description, up to two lines. |
| `symbol` | `int` (a `Symbols.<Name>` value, see [Symbols](https://atlasos.eterneon.net/framework/atlas-ui/symbols.md)) | `0` | The icon for an app without `icon.name` or `icon.source`. 0 shows `Symbols.Apps`. |

## Signals

| Name | Description |
|---|---|
| `actionClicked()` | The default action was clicked (not while `installState` is `"installing"`). |
| `cancelRequested()` | The default action asked to cancel an install in progress. |
