Reusable Status QML components
Go to file
Pascal Precht 3c4c7f040a feat(StatusPopupMenu): add support for letter identicons, identicons and images
This extends the popup menu to accept image or icon configurations a la `StatusIconSettings`
and `StatusImageSettings` in menu items, as well as nested menus.

Usage:

```qml
StatusPopupMenu {

    StatusMenuItem {
        text: "Custom Image icon"
        image.source: // image source
    }

    StatusMenuItem {
        text: "Custom identicon icon"
        image.source: // identicon source
        image.isIdenticon: true
    }

    StatusMenuItem {
        text: "Custom letter identicon"
        iconSettings.isLetterIdenticon: true
        iconSettings.background.color: "red"
    }
}
```

Few things to note:

- Because `StatusMenuItem` is an `Action` type, we can't extend its `icon` property,
  so we have to introduce our own (`iconSettings`) which can be of type `StatusIconSettings`
- Where possible, `StatusPopupMenu` will prefer `iconSettings.[...]` over `icon.[...]`,
  which means, both would work: `icon.name` and `iconSettings.name`.
  This is for consistency's sake. Consumers can switch completely to `iconSettings` if desired.
- When `isLetterIdenticon` is true, `iconSettings.background.color` must be set, similar
  to how it work in any other StatusQ component that makes use of this configuration type.

Closes #263
2021-07-22 13:24:26 +02:00
sandbox feat(StatusPopupMenu): add support for letter identicons, identicons and images 2021-07-22 13:24:26 +02:00
src feat(StatusPopupMenu): add support for letter identicons, identicons and images 2021-07-22 13:24:26 +02:00
.gitignore fix: Add missing .qml to resources, add qmlcache to gitignore 2021-06-29 09:47:47 +02:00
CHANGELOG.md chore(CHANGELOG): add missing version number 2021-07-21 10:16:00 +02:00
README.md chore(README): re-add sandbox app instructions 2021-06-29 13:43:31 +02:00
statusq.qrc feat(Popups): introduce `StatusMenuHeadline` component 2021-07-22 07:29:59 +02:00

README.md

StatusQ

An emerging reusable QML UI component library for Status applications.

Usage

StatusQ introduces a module namespace that semantically groups components so they can be easily imported. These modules are:

Provided components can be viewed and tested in the sandbox application that comes with this repository. Other than that, modules and components can be used as expected.

Example:

import Status.Core 0.1
import Status.Controls 0.1

StatusInput {
  ...
}

Viewing and testing components

To make viewing and testing components easy, we've added a sandbox application to this repository in which StatusQ components are being build. This is the first place where components see the light of the world and can be run in a proper application environment.

Using Qt Creator

The easiest way to run the sandbox application is to simply open the provided sandbox.pro file using Qt Creator.

Using command line interface

To run the sandbox from within a command line interface, run the following commands:

$ git clone https://github.com/status-im/StatusQ
$ cd StatusQ/sandbox
$ ./scripts/build

Once that is done, the sandbox can be started with the generated executable:

$ ./bin/sandbox

More Documentation available on the wiki