Commit Graph

311 Commits

Author SHA1 Message Date
B.Melnik 387bfe77c0
fix(StatusBaseInput): Make clear button bigger
Closes: #294
2021-08-31 13:47:31 +02:00
Pascal Precht 1749cc0e3b feat(StatusDescriptionListItem): expose subtitle component for fine control
This enables users to get more control over the subtitle to set things like
`elide` and font properties.

Closes: #356
2021-08-31 11:27:43 +02:00
Pascal Precht a963ef80c8 feat(StatusDescriptionListItem): introduce support for `value`
This adds a new `value` property to the component to set label for a
selected value and also rendering a chevron as an indicator that the list
item becomes clickable.
2021-08-31 11:27:43 +02:00
B.Melnik fbecac4ac3 fix(StatusChatToolBar): Fix mouse event catching after menu closing
Closes: #350
2021-08-31 11:26:52 +02:00
Sale Djenic 9b3275f327 refactor(StatusSearchPopup): change expected search model shape
This changes the share of the model expected to render search results.

BREAKING CHANGE:
The model has changed in the following way:
- `image` field added
- `color` field added
- `badgeIdenticonColor` field renamed to `badgeIconColor`
- `isLetterIdenticon` field renamed to `badgeIsLetterIdenticon`
2021-08-31 11:23:23 +02:00
Pascal Precht 28e514f927 feat(StatusModal): add ability to set elide config of header titles
There are now two new properties in `StatusModalHeaderSettings`:

- `titleElide`
- `subTitleElide`

These can be used to configure the `elide` property of both header titles.
The default values for both of them is `Text.ElideRight`.

Closes #353
2021-08-31 10:59:56 +02:00
B.Melnik 5c706fdc80 fix(StatusListItem): Add propogateCompostedEvents to title mouse area
Closes: #346
2021-08-30 13:45:14 +02:00
B.Melnik faca4765f4
feat(StatusWindowsTitleBar): Add windows title bar
Closes: #200
2021-08-30 09:42:01 +02:00
Pascal Precht 503a07bf5a fix(StatusModal): ensure header and subtitles elide if needed
Closes #256
2021-08-27 23:08:09 +02:00
B.Melnik f9775e4de3
feat(StatusChatListCategoryItem): Add tooltips settings
Usage:

```qml
StatusChatListCategoryItem {
   addButton.tootlip.text: "Some add lazy text"
   menuButton.tooltip.text: "My menu"
}
```
2021-08-27 13:42:22 +02:00
B.Melnik 7ef61ed3f8 fix(StatusChatInfoButton): Add self-calculated implicitWIdth and elide to texts
This commit add elide flags to text in title and subtitle and add flexibility to width. Now compoents use next rules:
1. If width is set - text should be elided when implicit text  width is more than root object width
2. Component grows if width is not set based on inner elements natural sizes

Closes: #335 and #338
2021-08-27 13:39:36 +02:00
Pascal Precht ee5ec7b3db fix(StatusListItem): don't set width on title item
There was an explicit `width` introduced on `statusListItemTitle`, most likely
to make room for it when `titleAsideText` is supplied.

This unfortunately causes the title get a very small width, resulting in broken
UI.

Since we can assume that there should be enough space for the titleAsideText
when it's used, we probably don't have to calculate a fixed width for the title
in the first place.

This commit therefore removes that explicit setting.
2021-08-27 09:37:06 +02:00
Pascal Precht a4178bd6dc
feat(StatusChatListAndCategories): add drag and drop support for cate… (#349)
* feat(StatusChatListAndCategories): add drag and drop support for categories

This adds support for dragging and dropping chat list categories.
To persist reorder of chat categories, the new `onChatListCategoryReordered`
signal can be leveraged.

Drag and drop of categories is turned off by default and needs to
be turned on using `draggableCategories: true`.

Closes #227

* feat(Status.Core): introduce Utils namespace

This adds a new package for utility related things.
2021-08-26 15:33:45 -04:00
Alexandra Betouni 7da4bdee74
fix(StatusAppThreePanelLayout): increase minimum width in right panel
This is to ensure it also inlcludes right margin.
2021-08-26 17:26:03 +02:00
khushboo-dev-cpp 2d8fd576e0 feat(StatusPopupMenu): changed close policy
Close on press outside added to closing policy as the I found old one to be buggy on mac. Causes no side effects.
2021-08-26 14:45:41 +02:00
B.Melnik 138458d10c fix(StatusBaseInput): fix click to focus
Closes: #325
2021-08-26 09:43:44 +02:00
Pascal Precht 5da9cb06d5 fix(StatusChatListCategory): emit original mouse event data in clicked signal
This fixes a bug that was introduced in 01da750899 with a breaking change
where `StatusChatListCategoryItem`'s `clicked` signal would no longer receive
a `mouse` event object.

The reason this is happening is because we've introduced a new `clicked` signal
on `StatusListItem`. The idea was to rely on that within `StatusChatListCategoryItem`,
however, we didn't take into account that the new `clicked` signal in `StatusListItem`
doesn't emit a `mouse` event object.

To fix this issue could either reintroduce the custom `clicked` handler on
`StatusChatListCategoryItem`, or listen to the original `sensor.onClicked` and
`onTitleClicked` signals exposed by `StatusListItem` instead, ensuring the required
`mouse` event data exists.

Fixes #333
2021-08-23 14:17:13 +02:00
B.Melnik c679854d7d feat(StatusChatList): Add drag and drop support of list items
This implements drag and drop capabilities of chat items within a `StatusChatList`.
The commit introduces a `DelegateModal` to visually reorder chat items
when they're being dragged and dropped onto a `DropArea`.

To persist the new order of chat items, various signals have been introduced to chat
list related components:

```qml
StatusChatList {

    onChatItemReordered: function (id, from, to) {
        // ...
    }
}

StatusChatListAndCategories {

    onChatItemReordered: function (categoryId, chatId, from, to) {
        // ...
    }
}
```

There's no such API on the `StatusChatListCategory` type because that one already
exposes its underlying `StatusChatList` via `chatList`, which makes the signal available.

Dragging and dropping chat items is disabled by default and needs to be turned on
using the `draggableItems` property:

```qml
StatusChatList {
    draggableItems: true
    ...
}
```
2021-08-23 14:16:53 +02:00
Pascal Precht c6952a89ae
Revert "fix(StatusChatInputButton) ensure button text is elided correctly"
This reverts commit 38b0207055.
2021-08-19 19:48:00 +02:00
Alexandra Betouni 38b0207055
fix(StatusChatInputButton) ensure button text is elided correctly
Closes #335
2021-08-19 15:28:26 +02:00
Khushboo Mehta d16719adda feat(StatusLetterIdenticon): Expose the text component
Aliased the text compoenent so that its color, text value can be set from outside
2021-08-18 10:44:05 +02:00
Pascal Precht ea3408012f feat(StatusBaseInput): introduce `dirty` and `pristine` properties
These properties can be used to determine whether a user has either
interacted with the form control, or changed its value.

It's also used in initial validation to ensure validation is done but
visually, form controls stay untouched.

Closes #327
2021-08-17 10:44:28 +02:00
Pascal Precht 4b107a0ef4 fix(StatusInput): ensure validation is performed on initialization
Closes #326
2021-08-17 10:42:21 +02:00
Pascal Precht 51d8b55b79 fix(StatusInput): remove recursive binding in label height 2021-08-17 10:42:09 +02:00
Pascal Precht 0243852c63 fix(StatusBaseInput): ensure wrapmode works as expectefd in multiline mode
Closes #324
2021-08-17 10:41:57 +02:00
Pascal Precht ea6743a776 fix(StatusBaseInput): expose cursorPosition
Fixes #323
2021-08-17 10:41:44 +02:00
Sale Djenic 2de261c49b fix(StatusSearchPopup): replace "#" character with "channel" icon 2021-08-17 10:38:23 +02:00
Sale Djenic 78edcb3795 feat(StatusSearchPopupMenuItem): New APIs resetSearchSelection and setSearchSelection
New methods added `resetSearchSelection` and `setSearchSelection` for resetting
and setting selected location.
2021-08-17 10:38:23 +02:00
Sale Djenic 3e134ada18 refactor(StatusSearchLocationMenu): expose a single itemClicked signal
A single `signal itemClicked(string firstLevelItemValue, string secondLevelItemValue)`
with parameters referring to the first level and second level item is exposed
and replaced multiple signals we had before for the same purpose.
2021-08-17 10:38:23 +02:00
Sale Djenic b133d10f96 feat(StatusSearchPopupMenuItem): new API
Status Menu item received new value property.
2021-08-17 10:38:23 +02:00
Sale Djenic c306b68296 fix(StatusSearchLocationMenu): typo fix
Fixed a typo in StatusSearchLocationMenu.locationModel
2021-08-17 10:38:23 +02:00
Sale Djenic 01da750899 feat(StatusListItem): introduce itemId and titleId properties and their handlers
A click on the item's title or whole item emits appropriate `titleClicked` or
`clicked` signal with `titleId` or `itemId` value respectively. `titleId` and
`itemId` may or may not defer from their display values, it's up to logic which
is applied.

This is introduced because of need of the issue-2934.
2021-08-17 10:38:23 +02:00
Pascal Precht ba4f27f9ba feat(StatusInput): introduce new validator pipeline
There's a new `validators` property that can be used to add validators to `StatusInput` instances, which are executed in the same order:

```qml
StatusInput {
  text: "Some value"
  validators: [...]
}
```

For convenience StatusQ provides some common validation methods, such as `StatusMinLengthValidator`, StatusMaxLengthValidator` and could be extended to other (e.g. email validation etc):

```qml
StatusInput {
  text: "Some value"
  validators: [
    StatusMinLengthValidator { minLength: 3 }
  ]
}
```

Validators are executed every time the text of the input changes. They are executed in the same order they have been applied, which enables users to create cascading conditions like "First make sure the value is at least 3 characters long, then make sure it matches a certain pattern".

When a validation fails, it sets the validity of the input (`valid: false`) accordingly and optionally exposes additional error information on `StatusInput.errors`:

```qml
StatusInput {
  text: "Fo"
  onTextChanged: {
    if (errors) {
      /**
       * errors now has the following structure:
       * errors: {
       *   minLength: { minValue: 3, actual: ... }
       * }
       * Also, `StatusInput` is now `valid = false`
       **/
       errorMesssage = "Expected " + errors.minLenght.minValue + " but got: "+ errors.minLength.actual; // i18n'able
    }
  }
  validators: [
    StatusMinLengthValidator { minLength: 3 }
  ]
}
```
There can be any number of error objects on the `errors` property, depending on who many validators have been run that failed validation.

Custom validators can be implemented by introducing a new `StatusValidator` type that has to implement a `validate()` function and defines the validators name. The `validate()` function has to return either `true` or `false` depending on whether the value is valid.

Alternatively, the function can return an error object which gets exposed on the underlying input's `errors` property, at which point it's considered invalid as well.

Here's a simple custom validator:

```qml
// HelloValidator.qml
import StatusQ.Controls.Validators 0.1

StatusValidator {

  property string name: "hello"

  validate: function (value) { // `value` is the `text` value of the underlying control
    return value === "hello"
  }
}
```

Applying this validators would look like this:

```qml
StatusInput {
  text: "Some value"
  validators: [
    HelloValidator {}
  ]
  onTextChanged: {
    if (errors.hello) {
      errorMessage = "Doesn't say hello!"
    }
  }
}
```

Alternatively, validators can return error objects to provide more information about what went wrong. Here's the implementation of the `StatusMinLengthValidator` as an example:

```qml
StatusValidator {

    property int minLength: 0

    name: "minLength"

    validate: function (value) {
        return value.length >= minLength ? true : {
            min: minLength,
            actual: value.length
        }
    }
}
```

Because validators as components, they can hold any custom properties they need to be configured.

There has been concern that, with this API, error messages need to be potentially defined in multiple places, given that there could be multiple instances of any validator. This is easily solved by having a centralized function figure out what the error message is, given a certain error object:

```qml
StatusInput {
  validators: [
    StatusMinLengthValidator { minLength: 3 }
  ]
  onTextChanged: {
    if (errors) {
      errorMessage = getErrorMessage(errors) // this function is provided by global or elsewhere
    }
  }
}
```

Closes #298
2021-08-16 09:37:39 +02:00
Pascal Precht f635bad63c feat(StatusBaseInput): enforce `maximumLength` if it's set
Prior to this commit, setting `charLimit` on `StatusInput` would only have a visual effect
(rendering the char limit), however it wouldn't actually enforce this limit.

This was by intended behaviour, because we wanted to leave some room
for possible validators to kick in (for example a max length validator).

If however the char limit is enforce, such a validator would never kick in.
There seems to be consensus in the team that the limit should be enforced though.

This commit enables that.
2021-08-16 09:28:35 +02:00
Pascal Precht 58a3071626 feat(StatusIcon): add `play-filled` and `pause-filled` icons
Closes #310
2021-08-13 15:02:23 +02:00
Khushboo Mehta d24c2e6208 fix(StatusChatToolBar): Use updated StatusFlatRoundButton
Adapting the StatusChatToolBar with the new StatusFlatRoundButton and initializing it
2021-08-12 17:23:47 +02:00
Khushboo Mehta 5a0489ba17 feat(StatusFlatRoundButton): Adding tooltip to the button
Adding the StatusToolTip to the StatusFlatRoundButton. This will only function when the tooltip text is set from the outside
2021-08-12 17:23:47 +02:00
Khushboo Mehta ee4296837a feat(StatusToolTip): Adding an offset property
Added an offset property with which the arrow position for the tooltip can be adjusted from the outside
2021-08-12 17:23:47 +02:00
Alexandra Betouni 30f5ae4b32 feat(StatusQ.Popups) Adding SearchPopup component
Closes #264
2021-08-12 11:35:09 +02:00
Pascal Precht 90aa9d76c0 fix(StatusPopupMenu): ensure icon or image settings exist
Fixes #295
2021-08-10 15:12:28 +02:00
RichΛrd 2e1359c9e2
fix(StatusAppNavBar): add profile button (#311) 2021-08-06 12:47:57 -04:00
RichΛrd aab59763e5
chore: replace profile icon (#312) 2021-08-06 12:47:52 -04:00
Alexandra Betouni a8e830f76c fix(StatusChatToolBar) Fixing more menu not closing
The menu has a CloseOnReleaseOutside policy and so it
was closing and immediately re-opened when the kebab icon
was clicked since it's outside the menu area and also was
calling the popup function of the menu. Added dummy bool
property to detect whether the menu is already closed and
not open it again

Closes #308
2021-08-05 09:59:39 +02:00
Pascal Precht b345c75a4c fix(StatusChatListItem): don't signal item selection if already selected
Closes #303
2021-08-03 09:48:53 +02:00
Jonathan Rainville 7e03daeaf9
feat(StatusListItem): add enabled prop to StatusLIneItem (#302) 2021-07-29 09:33:32 -04:00
Pascal Precht 556e5ccafc
feat(StatusQ.Theme.Core): introduce theme colors for StatusChatInput (#299)
There's some usage specific color being added to the chat input (which doesn't live in
StatusQ yet). To make sure we don't lose that change, I'm adding the new
colors to StatusQ theming system and have Status Desktop use it for the time being
until `StatusChatInput` is moved to StatusQ anyways.
2021-07-28 16:16:54 -04:00
Alexandra Betouni d327c51521 fix(StatusAppThreePanelLayout): limit right panel width to 300px
Also added handle in DemoApp as well as hiding text when in minimum
width for right and left panels
2021-07-26 16:49:53 +02:00
Alexandra Betouni 762ff87bcc fix(StatusAppThreePanelLayout): limit center panel width to 300px 2021-07-26 15:07:06 +02:00
Pascal Precht 731a0f8c8f feat(sandbox): make use of `StatusInput` in chat view 2021-07-26 15:03:54 +02:00
Pascal Precht c8e903496c feat(StatusBaseInput): add icon support
Usage:

```qml
StatusBaseInput {
    icon.name: "..."
}
```

Closes #242
2021-07-26 15:03:54 +02:00
Pascal Precht f16e857c72 fix(StatusBaseInput): some minor style adjustment to adhere to design 2021-07-26 15:03:54 +02:00
Pascal Precht 3cf53d0233 feat(StatusInput): implement error message and charlimit APIs
Usage:

```qml
StatusInput {
  label: "Fieldname"
  charLimit: 30
  errorMessage: "Some error occured"

  input.valid: false
  input.text: "Some invalid value"
  input.valid: false
}
```

Closes #289, #290
2021-07-26 15:03:54 +02:00
Pascal Precht 646c00bd3a feat(Controls): introduce `StatusInput`
`StatusInput` is a wrapper around `StatusBaseInput` to provide additional
component composition for labels, error messages and alike

Closes #288
2021-07-26 15:03:54 +02:00
Pascal Precht ab3035930b fix(StatusBaseInput): ensure input text is selectable with mouse
This also sets the correcrt selection and selected text color.
2021-07-26 15:03:54 +02:00
Pascal Precht e8cce72c25 feat(StatusBaseInput): add visual validity state
Closes #287
2021-07-26 15:03:54 +02:00
Pascal Precht de1cec7e51 fix(StatusBaseInput): ensure clear button has the correct color
Also only render clear button when input has active focus.

Closes #286
2021-07-26 15:03:54 +02:00
Pascal Precht e1ebdaae2c feat(StatusBaseInput): add hover state visuals
Closes #285
2021-07-26 15:03:54 +02:00
Pascal Precht 35f20e33df fix(StatusBaseInput): add visuals for disabled state
Closes #284
2021-07-26 15:03:54 +02:00
Pascal Precht a2d48a5827 refactor(StatusBaseInput): change implicitWidth to adhere to design 2021-07-26 15:03:54 +02:00
Pascal Precht 116ddfbb4d fix(StatusBaseInput): expose text prop alias 2021-07-26 15:03:54 +02:00
Alexandra Betouni 6170599060 fix(StatusAppThreePanelLayout): hide right panel when closed
Brought back opacity condition deleted by mistake
2021-07-26 11:27:34 +02:00
Alexandra Betouni ffc6fcb429 feat(StatusQ.Layout): introducing StatusAppThreePanelLayout
Added new component to support a 3 column view

Closes #272
2021-07-23 11:06:41 +02:00
Pascal Precht e3f7931442
fix(StatusListItem): ensure title area wraps text 2021-07-23 10:54:44 +02:00
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
Pascal Precht 246bec0d97 feat(Popups): introduce `StatusMenuHeadline` component
This component can be used to group different sections within a popup menu.

Usage:

```qml
StatusPopupMenu {

    StatusMenuItem {
        text: "One"
        icon.name: "info"
    }

    StatusMenuHeadline {
        text: "Some text"
    }

    StatusMenuItem {
        text: "Two"
        icon.name: "info"
    }
}
```
2021-07-22 07:29:59 +02:00
Pascal Precht baefedb895 fix(StatusChatInfoButton): ensure pin icon button is always rendered
Closes #278
2021-07-22 07:29:34 +02:00
Pascal Precht e4e7ebe3cd
fix(StatusModal): reset image/identicon width when loader state has changed 2021-07-21 11:46:22 +02:00
Pascal Precht 51b7c71dce feat(StatusToolTip): expose `arrow` for fine-grain control
There's cases where the arrow on the tooltip needs to be repositioned, for example
when the tooltip doesn't fit into the viewport anymore but is centered below a button.
2021-07-21 09:57:27 +02:00
Pascal Precht 031319968d feat(StatusListItem): support tertiaryTitle
Usage:

```qml
StatusListItem {
    title: ...
    subTitle: ...
    tertiaryTitle: ...
}
```

Closes #275
2021-07-21 09:57:15 +02:00
Pascal Precht fda9b71f7b feat(StatusModal): introduce support for identicons and letter identicons
Usage:

```qml
StatusModal {

    header.image.isIdenticon: ...

    // or

    header.icon.isLetterIdenticon: ...
    header.icon.background.color: ...
}
```

Closes #269
2021-07-21 09:57:03 +02:00
Pascal Precht 6775460356 chore: add thumbs up/down icons 2021-07-21 09:56:54 +02:00
Pascal Precht d1f8e3e5f0 fix(StatusPopupMenu): ensure menu items elide 2021-07-20 12:40:25 +02:00
Pascal Precht 18dbaadd43 feat(StatusModal): render header and footer border by default
This adds a `StatusModalDivider` to the header and footer so they don't
have to be put into `content` and therefore won't scroll out of the viewport
if the content exceeds the modal height.

The footer divider is only rendered when there's indeed action buttons
provided.

Closes #265
2021-07-16 13:40:09 +02:00
Anthony Laibe 52cb97e409 fix(StatusChatListCategory): ensures showActionButtons is taken into account
when showing the menu button and right click
2021-07-16 13:39:33 +02:00
Anthony Laibe 9cfcdace21 feat(StatusChatListAndCategories): new API showPopupMenu 2021-07-16 13:39:33 +02:00
Anthony Laibe 38c04cb91c feat(StatusChatInfoToolBar): make statusMenuButton public 2021-07-16 13:39:33 +02:00
Pascal Precht 214ef6b021 feat(StatusListItem): add identicon support
Closes #261
2021-07-16 08:55:48 +02:00
Pascal Precht a404ba0782 feat(StatusChatListItem): introduce muted badge visuals
Also ensure title font weight stays `normal` when item is `muted`.

Closes #258, #259
2021-07-16 08:55:34 +02:00
Pascal Precht 58e8f1cd23 feat(StatusFlatRoundButton): introduce `highlighted` color for secondary type
Closes #245
2021-07-15 13:00:58 +02:00
B.Melnik 193498815f feat(StatusBaseInput): Add focused state
Closes: #240
2021-07-13 10:12:56 +02:00
Pascal Precht 86da901e88
feat(StatusChatToolBar): add tooltips to action buttons
Closes #244
2021-07-12 14:17:40 +02:00
Pascal Precht e93dab2ba0 feat(StatusChatToolBar): add members and search button
This commit adds the members and search button which are needed for certain
features in Status Desktop. In views where these aren't needed, each button
can be set `visible: false` individually:

```qml
StatusChatToolBar {
    ...
    membersButton.visible: false
    searchButton.visible: false
}
```

Closes #243
2021-07-12 13:18:58 +02:00
Pascal Precht ac5c84529e
fix(StatusChatList): ensure badge is also shown for one to one messages 2021-07-09 16:08:02 +02:00
Pascal Precht 096d4148cd chore: ensure `StatusChatList` receives the proper value for mentions
This is due to a change in how mentions and unread messages are indicated.
See 7fbccec227 for more information.
2021-07-09 14:56:24 +02:00
B.Melnik f2d36d3d80 fix(StatusBaseInput): Fix focus area
Closes: #241
2021-07-09 11:40:35 +02:00
Pascal Precht 8155d9a218
feat(StatusListItem): add `Danger` type support
Usage:

```qml
StatusListItem {
    title: "Some title"
    icon.name: "delete"
    type: StatusListItem.Type.Danger
}
```

Closes #248
2021-07-09 11:38:05 +02:00
Pascal Precht 70043c5be4 feat(StatusRoundIcon): enable `icon.color` support 2021-07-09 11:34:39 +02:00
Pascal Precht 531e54f238 feat(StatusListItem): support letter identicons
This adds support for letter identicons by using the `icon.isLetterIdenticon`
flag:

```qml
StatusListItem {
    title: "Some name"
    icon.isLetterIdenticon: true
    icon.background.color: "orange"
}
```

Closes #239
2021-07-09 11:34:25 +02:00
Alexandra Betouni 51a345866a [#202] Added Picker button
Adding picker button
* As an example it opens Qt's ColorDialog, as soon as
  a color is selected there, the button is colored
  with that. Final color picker to be implemented in
  a seperate task.

Also minor improvements in main.qml and sandbox.pro

Closes #202
2021-07-09 11:16:04 +02:00
Pascal Precht bd383e8746 feat(StatusModal): expose loaded content
As discussed in #237, this is needed for consumers to access content
children from outside `content`.

Usage:

```qml
StatusModal {
  id: modal
  content: StatusBaseText {
      text: "Foo"
  }

  rightButtons: [
      StatusButton {
          text: "Change text"
          onClicked: {
              modal.contentComponent.text = "Bar"
          }
      }
  ]
}
```

Fixes #237
2021-07-08 11:42:08 +02:00
B.Melnik 1321760442
feat(Controls): introduce StatusBaseInput
Usage: The same interface like TextField

Closes: #106
2021-07-08 11:30:31 +02:00
Pascal Precht 0072154f9f
chore: add safety to satisfy QML 2021-07-06 12:30:00 +02:00
Pascal Precht 7dcec0cace fix(StatusChatInfoButton): make component identicon aware
Closes #228
2021-07-06 11:48:36 +02:00
Pascal Precht 144ac69d31 fix(StatusChatInfoButton): prefix chat name with "#" if needed
Closes #229
2021-07-06 11:48:20 +02:00
Pascal Precht 7b2030c6ab fix(StatusChatInfoButton): vertically center title if no subtitle is provided
Closes #230
2021-07-06 11:48:07 +02:00
Pascal Precht f7e38c9c72 fix(StatusChatInfoButton): disable hover effects when sensor is disabled
Closes #231
2021-07-06 11:47:52 +02:00
Pascal Precht cbdaf12814 fix(StatusChatListCategory): only try open popup when supplied
Closes #220
2021-07-02 14:28:40 +02:00
Pascal Precht 53d63a9b01 fix(StatusChatListAndCategories): make chat list visibily flag work
Closes #217
2021-07-02 14:28:29 +02:00
Pascal Precht 722d92c012 fix(StatusChatList): ensure popupMenu closeHandler don't break
These broke because we were referring to a `highlighted` property that
was wrongly scoped.

Fixes #216
2021-07-02 14:28:17 +02:00
Pascal Precht a9ae426cf5 fix(StatusChatListAndCategories): ensure chatItemUnmuted event is propagated
Closes #219
2021-07-02 14:28:05 +02:00
Pascal Precht 23ddbc2e0d fix(StatusChatListAndCategories): ensure chat list receives popup menu
Closes #218
2021-07-02 14:27:56 +02:00
Pascal Precht a664f635a7
feat(StatusChatList): expose hook to lazily calculate chat item names 2021-06-30 16:12:21 +02:00
Pascal Precht fd7a5530cf fix(StatusMenuSeparator): ensure height is 0 when invisible or disabled
Closes #212
2021-06-30 13:38:21 +02:00
Pascal Precht f7f217ed22 fix(StatusChatList): use fallback property to determine unread message count 2021-06-30 13:38:12 +02:00
B.Melnik f4e6b3da8a bug(StatusLoadingIndicator): Change Animator to Animation
Closes: #188
2021-06-29 09:46:23 +02:00
Pascal Precht 34df0f0dab fix(StatusChatListItem): ensure chat name elides when it's too long
Closes #151
2021-06-29 09:46:08 +02:00
Pascal Precht 141872c2a5 fix(StatusChatListItem): ensure public chat names are prefixed with '#'
Closes #191
2021-06-25 12:42:19 +02:00
Pascal Precht a98bae48dd refactor(StatusPopupMenu): expose category and chat id via open handler
Closes #192
2021-06-25 12:42:08 +02:00
Pascal Precht 7a2648f69f feat(StatusRoundedImage): introduce identicon support
This just introduces a new `StatusImageSettings` property `isIdenticon`
which can be used to determine whether a `StatusRoundedImage` should
render with a background + border (which is the case for identicons).

It also updates the `StatusChatList` delegate to consider that property
and have it properly decide how to render the UI.

Closes #173
2021-06-24 16:27:25 +02:00
Pascal Precht cfacd5be6d feat(StatusChatList): introduce `profileImageFn` property
This property enables users to pass as factory function to `StatusChatList`
component that determines the profile image of a given chat id.

Usage:

```qml
import StatusQ.Components 0.1

StatusChatList {
    ...
    profileImageFn: function (id) {
        // `id` is the model id of the current chat item iterator
        return ... // has to return a profile image url
    }
}
```

In addition to this property, this commit also makes the component
expect an optional `model.identityImage` in case it's already provided.
That way, `profileImageFn` can be omitted.

Closes #174
2021-06-24 16:17:06 +02:00
Pascal Precht baa663cea6 feat(Components): introduce `StatusContactRequestsIndicatorListItem`
Usage:

```qml
import StatusQ.Components 0.1

StatusContactRequestsIndicatorListItem {
    title: "Contact requests"
    requestsCount: 3
    sensor.onClicked: ...
}
```

Closes #175
2021-06-24 16:09:58 +02:00
Pascal Precht 8ef2d0ee47 refactor: make chat component enum variants match protocol values
Closes #183
2021-06-24 16:02:17 +02:00
Pascal Precht a6262f0a34 feat(StatusChatList): introduce `popupMenu` property
Chat list items can open a context on right click as well, so `StatusChatList`
needs to provide an API for users to pass down a `StatusPopupMenu` accordingly.

This is now possible with a dedicated `popupMenu` proporty that can be
used as follows:

```qml
StatusChatList {
    ...
    popupMenu: StatusPopupMenu {

        property string chatId

        openHandler: function () {
            ...
        }

        StatusMenuItem {
            ...
        }
        ...
    }
}
```

As will all `popupMenu` properties in StatusQ component, having this explicit API
option enables us to have control over how triggering components (in this case chat
list items) behave when they open a context menu (e.g. keeping them highlighted as long
as the menu is active).

When defining a `chatId` property, `StatusChatList` will hydrate it with the id of
the chat list item that has triggered the menu.

If there's more logic to be executed upon opening the menu, `openHandler` serves
as a hook similar to other popup menus. Inside the hook, users have access to the
specific `chatId`.

Closes #171
2021-06-24 16:01:47 +02:00
Pascal Precht 75b2f508b3 fix(StatusModalHeader): ensure header has enough height for children
Closes #185
2021-06-24 16:00:30 +02:00
Pascal Precht 3d0688b778 fix(StatusRoundedImage): ensure images are scaled and positioned properly
Closes #172
2021-06-24 16:00:05 +02:00
Pascal Precht 70332a3f41 fix(StatusChatList): expect `model.color` instead of `iconColor` prop 2021-06-24 15:59:45 +02:00
Pascal Precht 300536bc5d fix(StatusChatList): ensure component provide default `width`
Closes #176
2021-06-24 15:59:21 +02:00
Pascal Precht 44343d3857 feat(StatusChatListItem): add `highlighted` property
Similar to other controls and components, chat list items can be in a
`highlighted` state, for example when popup menus are active.

Closes #178
2021-06-24 15:58:59 +02:00
Pascal Precht 34b35318bc fix(StatusListItem): ensure icon background in secondary type works correctly 2021-06-24 15:58:28 +02:00
Pascal Precht de2c36d0e9 fix(StatusModal): ensure modal footer uses correct theme color 2021-06-24 15:58:04 +02:00
B.Melnik 7bc7df8d1c feat(StatusIcon): Improvement of Icons 2021-06-22 11:02:06 +02:00
Pascal Precht 8a684a7d8a
refactor: don't make StatusChatList scrollable by default
This is because we ran into issues where some component compositions
caused scrollviews to be nested which rendered them non-functional.

For now we're rolling back the idea of components being smart enough
to become scrollable by themselves and have StatusQ consumers handle
scroll behaviour.
2021-06-22 10:37:59 +02:00
B.Melnik e49b58b94d
feat(Popups): Add StatusModal 2021-06-21 13:04:34 +02:00
Pascal Precht 148c30b991
feat(Popups): introduce StatusModalDivider 2021-06-21 13:04:34 +02:00
B.Melnik 9c2a5830f3
feat(Popups): Add StatusModalFooter 2021-06-21 13:04:30 +02:00
B.Melnik fa9bb7adc6
feat(Popups): Add status modal header 2021-06-21 12:58:00 +02:00
Pascal Precht 146218e0bb
feat(StatusListItem): introduce primary and secondary types
Also enable `icon.rotation` via `StatusIconSettings.
2021-06-21 12:57:59 +02:00
Pascal Precht 507703af18 feat(Components): introduce `StatusListSectionHeadline`
Usage:

```qml
import StatusQ.Components 0.1

StatusListSectionHeadline {
    text: "Settings"
}
```

Closes #164
2021-06-18 12:12:04 +02:00
Pascal Precht 40617cd710 feat(Components): introduce `StatusNavigationPanelHeadline`
Component to render navigation panel headlines.

Usage:

```qml
import StatusQ.Components 0.1

StatusNavigationPanelHeadline {
    text: "Profile"
}
```

Closes #162
2021-06-18 12:11:50 +02:00
Pascal Precht 05fc97ca2f
fix(StatusChatListCategoryItem): don't render menubutton with no popup
Fixes #153
2021-06-16 11:27:31 +02:00
Pascal Precht 7bca27455f
feat(Components): introduce `StatusChatListAndCategories` component
This is a wrapping component that can be used to render community chat
lists and categories. It takes care of rendering categories, the top
chat list, as well as becominng scrollable in case the content outgrows
the available space.

Usage:

```qml
import StatusQ.Components 0.1

StatusChatListAndCategories {

    chatList.model: ... // non-categorized chat items, pass all chat items here, the component will take care of filtering categorized items out
    categoryListModel: ... // available categories (need to have `id` and `name`)

    selectedChatId: ...

    showCategoryActionButtons: true // default `false` - useful when only admin users can create and mutate categories/channels

    onChatItemSelected: ... // `id` is available for selected chat id

    categoryPopupMenu: StatusPopupMenu { // optional popup menu for category items

        property string categoryId // define this property to have it hydrated with correct id and make it available inside menu items
        ...
    }

    popupMenu: StatusPopupMenu { ... } // optional popup menu for whole list, will be triggered with right-click
}
```

Closes #133
2021-06-16 11:24:18 +02:00
Pascal Precht 4577551873 feat(StatusChatListCategory): apply chat list filter and expose category id in popup menu
This uses the newly introduced `filterFn` in `StatusChatList` to hide chat items
that don't belong to a given category.

It also optionally exposes the `categoryId` on the provided popup menu, so it has
access to it inside menu item triggers.
2021-06-16 11:12:50 +02:00
Pascal Precht cb07813444 feat(StatusChatList): introduce `filterFn` and `categoryId`
Chat lists can belong to a category inside of communities, so they should
hold a property `categoryId` that represents that. In addition,
this commit introduces a `filterFn` function that can be used to conditionally
show/hide chat list items.

Closes #154
2021-06-16 11:12:26 +02:00
Pascal Precht 2427fa2dee feat(StatusPopupMenu): introduce `openHandler`
Similar to `closeHandler`, StatusPopupMenu can now have a customized `openHandler`
to run custom logic on open.
2021-06-16 11:11:54 +02:00
Pascal Precht 9982c3df52 feat(StatusChatListCategory): introduce flag to show/hide buttons
This commit introduces a `showActionButtons` flag that defaults to `false`
and can be used to render the action buttons provided in the chat list category.

This is useful for cases where only admin users should have the right to
create channels inside categories or mutate a category's state.

Settings `showActionButtons: true` will then render the buttons.

Closes #150
2021-06-16 11:11:34 +02:00
Pascal Precht 454e73a838 feat(Components): introduce `StatusChatInfoToolBar` component
Usage:

```qml
import StatusQ.Components 0.1

StatusChatInfoToolBar {
    chatInfoButton.title: "Cryptokitties"
    chatInfoButton.subTitle: "128 Members"
    chatInfoButton.image.source: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
    chatInfoButton.icon.color: Theme.palette.miscColor6

    popupMenu: StatusPopupMenu {

        StatusMenuItem {
            text: "Create channel"
            icon.name: "channel"
        }

        StatusMenuItem {
            text: "Create category"
            icon.name: "channel-category"
        }

        StatusMenuSeparator {}

        StatusMenuItem {
            text: "Invite people"
            icon.name: "share-ios"
        }
    }
}
```

Closes #141
2021-06-16 11:01:22 +02:00
Pascal Precht e5e96af538 fix(StatusListItem): various fixes w.r.t. sensor, icon size etc
This also exposes `statusListItemSubTitle` for more control over
it's appearance, if needed.
2021-06-15 10:48:32 +02:00
Pascal Precht 7c16a9bd3d feat(StatusRoundButton): add `highlighted` and `icon.rotation` props
These are needed for some UIs where the icon state may change based on the
user's interaction.
2021-06-15 10:47:53 +02:00
Pascal Precht 705f140207 fix(StatusNavBarTabButton): fix popup menu positioning 2021-06-14 11:24:03 +02:00
Pascal Precht 040da2a416
fix(StatusNavBarTabButton): ensure click signal is emitted when not menu is provided 2021-06-11 14:11:00 +02:00
Pascal Precht c9bc9bab11 feat(StatusPopupMenu): make menu items invisible when disabled
Closes #135
2021-06-11 13:54:08 +02:00
Pascal Precht 5e8242dfed feat(StatusNavBarTabButton): introduce `popupMenu` property
This enables users to apply a `StatusPopupMenu` to the button which automatically
positions itself and takes care of highlighting the activated button.

Usage:

```qml
StatusNavBarTabButton {
    ...
    popupMenu: StatusPopupMenu {

        StatusMenuItem {
            text: qsTr("Invite People")
            icon.name: "share-ios"
        }

        StatusMenuItem {
            text: qsTr("View Community")
            icon.name: "group"
        }

        StatusMenuItem {
            text: qsTr("Edit Community")
            icon.name: "edit"
        }
    }
}
```

Closes #137
2021-06-11 13:53:17 +02:00
Pascal Precht 175d7a195c fix(StatusAppNavBar): don't rely on `undefined` property
This turned out to be a bug. `model.count` isn't defined on `Repeater`
types.

Also, set `ScrollView` height to `0` if there are not community
tab buttons. This is needed because the columns implicit height
comes with spacing, resulting in some height.
2021-06-11 13:53:06 +02:00
Pascal Precht 1f3aa0bbd5 feat(StatusChatListItem): accept right clicks
Also triggers the context menu in `StatusChatListCategory`.

Fixes #131
2021-06-09 14:55:37 +02:00
Pascal Precht 22eaf6fa99 fix(Components): more popup menu position fine-tuning 2021-06-09 14:55:13 +02:00
Pascal Precht a0fae6ab70 fix: introduce tiny icon versions and make use of them where needed
Closes #128
2021-06-09 14:54:53 +02:00
Pascal Precht 3ea8da0593
fix(StatusChatToolBar): ensure context menu as proper position
Also expose action buttons for more custom control.
2021-06-09 10:42:04 +02:00
Pascal Precht 90bad9e312 fix(StatusChatToolBar): ensure menu button stays highlighted
This introduces a new `popupMenu` property that can be used to pass
down a `StatusPopupMenu` to `StatusChatToolBar`.

The reason this is done is so that we get control over its `onClosed`
handler, which is used to remove the menu button's `highlighted` state.

The `highlighted` state is activated inside the component as well when
it's clicked.

Existing signals like `menuButtonClicked` still exist and can be leveraged
for further logic.

Closes #125
2021-06-09 09:37:27 +02:00
Pascal Precht f4d211acbb feat(Components): introduce `StatusChatListCategory`
A component used to render chat list groups.

Usage:

```qml
import StatusQ.Components 0.1

StatusChatListCategory {
    categoryId: ...
    name: "Public"
    opened: true // default `true`

    addButton.[...]: ... // `StatusChatListCategoryItemButton`
    menuButton.[...]: ... // `StatusChatListCategoryItemButton`
    toggleButton.[...]: ... // `StatusChatListCategoryItemButton`

    chatList.chatListItems.model: ... // `chatsList` is a `StatusChatList`
    chatList.selectedChatId: ...
    chatList.onChatItemSelected: ...

    popupMenu: StatusPopupMenu {
        ...
    }
}
```

Closes #123
2021-06-08 15:34:15 +02:00
Pascal Precht 72bdd2d9af feat(StatusChatListCategoryItem): introduce `highlighted` property 2021-06-08 15:34:15 +02:00