Commit Graph

3789 Commits

Author SHA1 Message Date
Khushboo-dev-cpp 315f91d737 feature(StatusSelectableText): Added a selectable text component (#431)
Features:
1. Select text and copy it
2. Custom highlight on selection
3. Highlight on links
4. Support for multiline text
2022-09-21 18:20:05 +02:00
Pascal Precht 0ca798c891 chore: cut v0.11.0 release 2022-09-21 18:20:05 +02:00
B.Melnik f0004ffc4c fix(StatusSpellcheckingMenuItems): Exact menu items order 2022-09-21 18:20:05 +02:00
Pascal Precht a30cd474d9 fix(StatusSearchPopup): use correct theme color for search result text
This used `Theme.palette.black` before which doesn't work across differen themes.
`Theme.palette.directColor1` is the correct one to use here.
2022-09-21 18:20:05 +02:00
Pascal Precht 86c1f69723 fix(StatusChatList): ensure right click popup opens in correct position
This broke because the emitted `mouse` coordinates where no longer correct
after we've moved the chat list item into a delegate model.
2022-09-21 18:20:05 +02:00
Eric Mastro fd92ad5e28 feat: add star icons (#422) 2022-09-21 18:20:05 +02:00
Eric Mastro 567983b7d8 fix: track category opened state
Category `opened` state is tracked and restored on model change.

Previously, when the model data for categories and channels was changed, all unexpanded, or collapsed categories would automatically expand. This was due to the default state of the category `opened` property being restored (which was set to true) when the model data changed.

With this change in place, the opened state of each category is tracked in the parent component (`StatusChatListAndCategories`), and on each model change, the opened state is restored.

NOTE: it was tempting to the put the changes inside of the `StatusChatListCategory` component, however this would not work as the component is used as a delegate, and all state is wiped on each model change.
2022-09-21 18:20:05 +02:00
Pascal Precht 3bdc2a4c34 chore: cut 0.10.0 release 2022-09-21 18:20:05 +02:00
B.Melnik 79769c165e feat(StatusSpellcheckingMenuItems): Add spellchecking menu
Closes: #398
2022-09-21 18:20:05 +02:00
Pascal Precht 48bd006d05 feat(StatusChatList): expose `statusChatListItems` Repeater
Ever since we've moved to `DelegateModel` which is passed to the `Repeater`
which was previously aliased as `chatListItems`, we no longer get access to the
`model.itemAt` method. This is because `DelegateModel` doesn't have such a method.

So in order to restore that access, we have to expose `Repeater` additionally.

The reason this method is needed, is so that apps like Status Desktop can update
individual chat list items based on `Connection` events
2022-09-21 18:20:05 +02:00
Pascal Precht 581dd15f14 feat(StatusInput): add support for asynchronous validators
Allows asynchronous validation, with the ability to track the validated value for use in the StatusInput as a value that is separate from the entered text.

Async operations are debounced internally to the StatusAsyncValidator.

- `validate`: the input value to this function is the value sent to `asyncComplete`, which must be called by the validator. Return true when the value from the async operation is valid.
- `asyncComplete`: signal to be called by the validator after the async operation has completed. It should contain the value returned by the async operation that should be validated in `validate`.
- `validatedValue`: This is the valid value returned from the async operation. It it tracked separately so that the input text on the `StatusInput` can remain as entered by the user. Use this property and the `onValidatedValueChanged` signal handler for the “real” value to be used by other components.

Closes #395
2022-09-21 18:20:05 +02:00
B.Melnik 540cd79618 feat(Spellchecking): Add dictionaries
Closes: #400
2022-09-21 18:20:05 +02:00
Pascal Precht 8e4b5e2c09 feat(StatusInput): introduce `leftPadding` and `rightPadding` properties 2022-09-21 18:20:04 +02:00
Pascal Precht ada657fab6 feat(StatusInput): introduce `reset` API
This can be used to reset text, error message and validity state of inputs
2022-09-21 18:20:04 +02:00
Alexandra Betouni 56212c547a fix(StatusChatListCategoryItem): Disable sensor when chevron clicked
List items' mouse area was also triggered when chevron
(sub menu) button was clicked so it was unsetting the
opened variable which is responsible for opening/closing
the chats list.
2022-09-21 18:20:04 +02:00
Alexandra Betouni 0c0d9bf919 fix(StatusChatInfoToolBar): Right anchored title in StatusChatInfoToolBar
So that elide mode in text can be activated
2022-09-21 18:20:04 +02:00
B.Melnik b9b4ecae21 feat(Spellchecker): Add Spellchecker class
Closes: #399
2022-09-21 18:20:04 +02:00
B.Melnik 556de60a8d feat(Spellchecking): Add huspell dependency
Closes: #397
2022-09-21 18:20:04 +02:00
Pascal Precht 2bb282bb2c fix(StatusQ.Controls.Validators): fix bug that addressOrEns validator isn't properly exposed in QML 2022-09-21 18:20:03 +02:00
Khushboo Mehta 45dd8147ad feat(StatusExpandableItem): Correct placement of expandable region in tertiary type 2022-09-21 18:20:03 +02:00
Pascal Precht 36b75b8beb chore: cut 0.9.0 release 2022-09-21 18:20:03 +02:00
Pascal Precht 74a88a70b3 feat(StatusBaseInput): introduce `component` property
This property enables users to load any component into the input field.
This is useful for rendering a "clearable" icon button, simple icons or
even more complex buttons.

Usage:

```qml
StatusBaseInput {
    ...
    component: StatusIcon {
        name: "cancel"
        color: Theme.palette.dangerColor1
        width: 16
    }
}
```

The `clearable` property of `StatusBaseInput` also renders and icon button
on the right hand side. With this new feature, `clearable` is just a short-hand
for:

```qml
StatusBaseInput {
    ...
    component: StatusFlatRoundButton {
        visible: edit.text.length != 0 &&
                statusBaseInput.clearable &&
                !statusBaseInput.multiline &&
                edit.activeFocus
        type: StatusFlatRoundButton.Type.Secondary
        width: 24
        height: 24
        icon.name: "clear"
        icon.width: 16
        icon.height: 16
        icon.color: Theme.palette.baseColor1
        onClicked: {
            edit.clear()
        }
    }
}
```

Closes #380
2022-09-21 18:20:03 +02:00
Pascal Precht 1b5d407e93 fix(StatusCheckbox): give checkbox label proper theme color 2022-09-21 18:20:03 +02:00
Pascal Precht ff549d2822 feat(StatusQ.Controls.Validators): introduce `StatusAddressAndEnsValidator` 2022-09-21 18:20:03 +02:00
Pascal Precht f979011323 feat(StatusQ.Controls.Validators): introduce `StatusAddressValidator` 2022-09-21 18:20:03 +02:00
Pascal Precht af8d2036f3 feat(StatusInput): introduce `ValidationMode`
This allows users to configure how validation is run. There are two modes:

1. `ValidationMode.OnlyWhenDirty`
2. `ValidationMode.Always`

By default, validation happens when the inputs value changes, or on
initial `Component.onCompleted` event. The first mode allows for not
performing validation when the input field is blank and validation.
isn't necessary (yet).
2022-09-21 18:20:03 +02:00
Pascal Precht de776e4567 feat(StatusValidator): allow validators to provide default `errorMessage`
Validators can now define a default `errorMessage` like so:

```qml
StatusValidator {
  ...
  errorMessage: "..."
}
```

Because there's no access to runtime validation errors, `errorMessage` have to
be static. However, if applications wish to provide their own `errorMessage`
they can still override it and make it dynamic:

```qml
SomeValidator {
  ...
  errorMessage: input.errors.someValidator ? "Whoopsie" : ""
}
```
2022-09-21 18:20:03 +02:00
Pascal Precht 09c0892e3c Revert "chore: replace profile icon (#312)"
This reverts commit aab59763e5ad943b61856a7394d866ea68068df7.
2022-09-21 18:20:03 +02:00
Khushboo Mehta 5c5d782605 feat(StatusExpandableItem): Refactored the StatusExpandableSettingsItem to support different types
Renamed StatusExpandableSettingsItem to StatusExpandableItem.
Added support for dofferent types of styles for the item.
Type Primary: Relates to Settings Design
Type Secondary: Relates to Collectibles Design
Type Tertiary: Relates to the Collectibles detailed view design

BREAKING CHANGE: Renamed and expanded features of the  StatusExpandableSettingsItem to StatusExpandableItem
2022-09-21 18:20:03 +02:00
Pascal Precht 782c0eecfe feat(StatusSearchPopup): introduce forceActiveFocus API
This is used to enforce focus on the search input when the popup
is opened. In fact users decide to override the search popup's
`onOpened` handler, they still get access to this API to make use of it.
2022-09-21 18:20:03 +02:00
Pascal Precht 7bd484c339 feat(Status.Core.Theme): add RobotoMono font
Closes #342
2022-09-21 18:20:03 +02:00
Pascal Precht dc96cf04a9 fix(StatusModal): don't reserve header subtitle space
Closes #378
2022-09-21 18:20:03 +02:00
Pascal Precht 40001ef7a9 fix(StatusChatListAndCategories): rely on correct tooltip settings prop
Category tooltip settings were broken in this component due to a mismatching
property name.

This commit fixes it.
2022-09-21 18:20:03 +02:00
B.Melnik 0511fade5c fix(StatusAppThreePanelLayout): Fix margin between left and center panels
This margin shows because of `handle` width incuded in `SplitView` width. Handle have `Component` type and can't accessable for getting sizes. I add `magic constant` as hotfix.

Closes: #307
2022-09-21 18:20:03 +02:00
B.Melnik d8d5048622 refactor(StatusPopupMenu): Refactor bug with reopen menu 2022-09-21 18:20:03 +02:00
Alexandra Betouni 12f6791d0c feat(StatusInput): exposed edit component
We need to be able to call forceActiveFocus, so
TextEdit component should be somehow accessible

Relates to desktop #3310
2022-09-21 18:20:03 +02:00
Pascal Precht 45ea097f3e chore: release v0.8.0 2022-09-21 18:20:03 +02:00
Pascal Precht 5f30a34161 feat(StatusBaseInput): introduce focussed property
We can't alias the property as `focus` because this is a final readonly
property, so we're introducing a `focussed` property instead.

Closes #373
2022-09-21 18:20:03 +02:00
B.Melnik 756bc6a1dc fix(StatusModal): Remove self-calculating height
Based on Qt docs `contentItem` must have `implicit` sizes.
link to rules: https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#popup-sizing
2022-09-21 18:20:03 +02:00
Alexandra Betouni faea959d63 feat(StatusInput): Introduced secondaryLabel property
Due to design updates in AddAccount modal, updates are
needed in StatusBaseInput and StatusInput

* Added the possibility of having the icon on the right
  side
* Added secondaryLabel for title
* Added examples in StatusInputPage

Closes #383
2022-09-21 18:20:03 +02:00
Khushboo Mehta fa5c50622a feat(qrc): Add new icon needed for share modal 2022-09-21 18:20:03 +02:00
Khushboo Mehta 9bb00e43a2 feat(StatusModal): Add popup menu support for StatusModal
Added logic to support a popup menu to be launched from the StatusModal header.
Added an example in sandbox to demonstrate its usage.

fixes #374
2022-09-21 18:20:03 +02:00
B.Melnik 49c9348f65 fix(StatusInput): Forward keys events to root
Closes: #372
2022-09-21 18:20:03 +02:00
Khushboo Mehta 1398b3c9d5 feat(StatusExpandableSettingsItem): Added new component for wallet settings
Also added a page in the sandbox to demonstrate its usage.
2022-09-21 18:20:03 +02:00
Pascal Precht 4c661109c6 feat(StatusQ.Controls): introduce StatusSwitchTabBar and StatusSwitchTabButton
This commit adds two new components to the StatusQ.Controls module:

- StatusSwitchTabBar
- StatusSwitchTabButton

Usage:

```qml
StatusSwitchTabBar {

    StatusSwitchTabButton {
        text: "Tab 1"
    }

    StatusSwitchTabButton {
        text: "Tab 2"
    }

    StatusSwitchTabButton {
        text: "Tab 3"
    }
}
```

Closes #365
2022-09-21 18:20:03 +02:00
B.Melnik cd72ef5f38 refactor(StatusModal): Remove custom content property
BREAKING CHANGES:
- `content` property removed
- `Loader` inside StatusModal removed
- default `contentItem` property should be used now

Closes: #306
2022-09-21 18:20:03 +02:00
B.Melnik 181ed86b95 fix(StatusBaseInput): fix one line scroll
Closes: #291
2022-09-21 18:20:03 +02:00
B.Melnik 8f83dbbca5 feat(StatusChatListAndCategories): Add tooltip settings for categories buttons
Closes: #226
2022-09-21 18:20:03 +02:00
Pascal Precht d2fd625ee5 feat(StatusSearchPopup): add function hook to allow timestamp formatting
This introduces a new API to allow users to provide a function that formats
timestamps in the search results.

```qml
StatusSearchPopup {
  formatTimestampFn: function (ts) {
      return // formatted ts
  }
}
```

Closes #363
2022-09-21 18:20:03 +02:00
Pascal Precht 1af17548ba feat: introduce bigger versions of navbar icons
Turns out the icons used in the navigation bar of the application actually
are designed to be bigger than the usual icons.

We can't just use the original source and scale them up in QML because that
will impact the stroke width of the SVGs as well, hence we need to introduce
a special set of icons that are design bigger but presever the feature ratios.
2022-09-21 18:20:03 +02:00