Commit Graph

70 Commits

Author SHA1 Message Date
Pascal Precht c17383ce9c feat(StatusChatListItem): introduce muted badge visuals
Also ensure title font weight stays `normal` when item is `muted`.

Closes #258, #259
2022-09-21 18:20:03 +02:00
Pascal Precht 17d5978fe4 feat(StatusFlatRoundButton): introduce `highlighted` color for secondary type
Closes #245
2022-09-21 18:20:03 +02:00
Pascal Precht ebbc9f2739 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
2022-09-21 18:20:03 +02:00
Pascal Precht 78ed4642d6 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.
2022-09-21 18:20:03 +02:00
Pascal Precht 15b8d1e896 feat(StatusListItem): add `Danger` type support
Usage:

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

Closes #248
2022-09-21 18:20:03 +02:00
Pascal Precht 98783ee559 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
2022-09-21 18:20:03 +02:00
Alexandra Betouni dd23ef2990 [#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
2022-09-21 18:20:03 +02:00
Pascal Precht 12b35ba88c 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
2022-09-21 18:20:03 +02:00
B.Melnik 1a81ab0924 feat(Controls): introduce StatusBaseInput
Usage: The same interface like TextField

Closes: #106
2022-09-21 18:20:02 +02:00
Pascal Precht 46876b79b9 fix(StatusChatListItem): ensure chat name elides when it's too long
Closes #151
2022-09-21 18:20:02 +02:00
Pascal Precht 29782dca80 fix(StatusChatListItem): ensure public chat names are prefixed with '#'
Closes #191
2022-09-21 18:20:02 +02:00
Pascal Precht d46130b9a5 refactor(StatusPopupMenu): expose category and chat id via open handler
Closes #192
2022-09-21 18:20:02 +02:00
Pascal Precht dbb8d941a5 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
2022-09-21 18:20:02 +02:00
Pascal Precht 48146b2fcf feat(Components): introduce `StatusContactRequestsIndicatorListItem`
Usage:

```qml
import StatusQ.Components 0.1

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

Closes #175
2022-09-21 18:20:02 +02:00
Pascal Precht c2f418205f 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
2022-09-21 18:20:02 +02:00
Pascal Precht 1a14f9ebe2 fix(StatusChatList): expect `model.color` instead of `iconColor` prop 2022-09-21 18:20:02 +02:00
Pascal Precht d389196f9e fix(StatusListItem): ensure icon background in secondary type works correctly 2022-09-21 18:20:02 +02:00
Pascal Precht 11e6429068 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.
2022-09-21 18:20:02 +02:00
B.Melnik eab95c1c7b feat(Popups): Add StatusModal 2022-09-21 18:20:02 +02:00
Pascal Precht f56e3d1677 feat(sandbox): introduce first part of profile view for reference app 2022-09-21 18:20:02 +02:00
Pascal Precht 2a7c3aded7 feat(Components): introduce `StatusListSectionHeadline`
Usage:

```qml
import StatusQ.Components 0.1

StatusListSectionHeadline {
    text: "Settings"
}
```

Closes #164
2022-09-21 18:20:02 +02:00
Pascal Precht 706fe0888d feat(Components): introduce `StatusNavigationPanelHeadline`
Component to render navigation panel headlines.

Usage:

```qml
import StatusQ.Components 0.1

StatusNavigationPanelHeadline {
    text: "Profile"
}
```

Closes #162
2022-09-21 18:20:02 +02:00
Pascal Precht 209a208455 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
2022-09-21 18:20:02 +02:00
Pascal Precht 03f4b4c98b 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
2022-09-21 18:20:02 +02:00
Pascal Precht 56828b5cae chore: introduce build script for sandbox app
Closes #148
2022-09-21 18:20:02 +02:00
B.Melnik 5e0e8deba8 fix: make release build work
I add several files in .qrc file for running app in release mode (CONFIG+=release)
2022-09-21 18:20:02 +02:00
Pascal Precht f2de2642ac 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
2022-09-21 18:20:02 +02:00
Pascal Precht 524eb14512 Revert "Revert "feat: can be used on tablets (#146)""
This reverts commit 59b40c0713a9a41bd95bff0f395a796c69e46fa6.
2022-09-21 18:20:02 +02:00
Pascal Precht 9bf98a1ede Revert "feat: can be used on tablets (#146)"
This reverts commit 63be01447930494f2afc61d5212f3c84ee1509e8.
2022-09-21 18:20:02 +02:00
Boris Melnik 7e9a76dbe7 feat: can be used on tablets (#146)
Co-authored-by: B.Melnik <b.melnik@restream.rt.ru>
2022-09-21 18:20:02 +02:00
Pascal Precht 7d96ad02ca feat(StatusPopupMenu): make menu items invisible when disabled
Closes #135
2022-09-21 18:20:02 +02:00
Pascal Precht 666908d93a 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
2022-09-21 18:20:02 +02:00
Pascal Precht ce91db10fe 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
2022-09-21 18:20:02 +02:00
Pascal Precht b5bc83b871 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
2022-09-21 18:20:02 +02:00
Pascal Precht 9ae468a70b feat(Components): introduce `StatusChatListCategoryItem`
This component is used to render chat list categories.

Usage:

```qml
import StatusQ.Components 0.1

StatusChatListCategoryItem {
    title: "Public"
    onClicked: opened = !opened
    onToggleButtonClicked: opened = !opened
    onMenuButtonClicked: ...
    onAddButtonClicked: ...

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

The button components are exposed so their tooltips can be configured
with (internationalized) app messages.

Closes #117
2022-09-21 18:20:02 +02:00
Pascal Precht 52f5c31b3d feat(Components): introduce `StatusChatList`
This commit introduce a new `StautsChatList` component that can be used
to render `StatusChatListItem`s, typically for chat and community views.

The component expects a `chatListItems.model` that has the following properties:

```qml
ListModel {
		ListElement {
				chatId: "0"
				name: "#status"
				chatType: StatusChatListItem.Type.PublicChat
				muted: false
				hasUnreadMessages: false
				hasMention: false
				unreadMessagesCount: 0
				iconColor: "blue"
		}
		...
}
```

It also emits two possible signals:

- `onChatItemSelected(string id)`
- `onChatItemUnmuted(string id)`

Usage:

```qml
import StatusQ.Components 0.1

StatusChatList {
		selectedChatId: "0"
		chatListItems.model: demoChatListItems

		onChatItemSelected: ...
		onChatItemUnmuted: ...
}
```

Closes #100
2022-09-21 18:20:02 +02:00
Pascal Precht 82643816f6 feat(StatusQ.Popups): introduce StatusPopupMenu component
Usage:

```qml
import StatusQ.Popups 0.1

Button {
    onClicked: simpleMenu.popup()
}

StatusPopupMenu {
    id: simpleMenu
    StatusMenuItem {
        text: "One"
    }

    StatusMenuItem {
        text: "Two"
    }

    StatusMenuItem {
        text: "Three"
    }
}
```

Closes #96 #74
2022-09-21 18:20:02 +02:00
Pascal Precht cd2fa3d0b7 chore: add tooltip to theme switch 2022-09-21 18:20:02 +02:00
Pascal Precht aecbb443de chore: re-introduce reload button 2022-09-21 18:20:02 +02:00
B.Melnik 1acc248c79 fix: update position of window to center, add traffic lights 2022-09-21 18:20:02 +02:00
Pascal Precht 4e25f584cc feat(sandbox): introduce first version of reference app
This reference app serves as a dogfooding ground for StatusQ components.
2022-09-21 18:20:02 +02:00
B.Melnik 60d3bdaff4 feat(Components): Add StatusSlider
Closes: #13
2022-09-21 18:20:02 +02:00
Pascal Precht cea1d68308 refactor(sandbox): make use of StatusQ to layout sandbox app
Closes #41
2022-09-21 18:20:02 +02:00
Pascal Precht f2df495309 feat(Components): introduce `StatusChatToolBar`
Usage:

```qml
import StatusQ.Components 0.1

StatusChatToolBar {
    chatInfoButton.[...]: ... // StatusChatInfoButton
    notificationCount: 1 // default `0`

    onChatInfoButtonClicked: ...
    onMenuButtonClicked: ...
    onNotificationButtonClicked: ...
}
```

Closes #80
2022-09-21 18:20:02 +02:00
Pascal Precht 272752c0b8 feat(Controls): introduce `StatusChatInfoButton`
Usage:

```qml
StatusChatInfoButton {
		title: "Iuri Matias"
		subTitle: "Contact"
		icon.color: Theme.palette.miscColor7 // identicon used as fallback when image source isn't available
		image.source: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
		type: StatusChatInfoButton.Type.OneToOneChat // PublicChat | GroupChat | CommunityChat
		muted: true // default `false`
		pinnedMessagesCount: 1 // default `0`
}
```

Closes: #79
2022-09-21 18:20:02 +02:00
Pascal Precht 3b48df10b3 feat(Components): introduce `StatusDescriptionListItem`
Usage:

```
import StatusQ.Components 0.1

StatusDescriptionListItem {
    title: "Title"
    subTitle: "Subtitle"
}

StatusDescriptionListItem {
    title: "Title"
    subTitle: "Subtitle"
    tooltip.text: "Tooltip"
    icon.name: "info"
    iconButton.onClicked: tooltip.visible = !tooltip.visible
}
```

Closes: #73
2022-09-21 18:20:02 +02:00
Pascal Precht 19fc81d42f feat(StatusBadge): introduce `borderColor` and `hoverBorderColor`
`StatusBadge` uses a border with same color as its underlying component
to create "fake space" (see `StatusNavTabButton`).

The color depends on the parent component background and its state,
which the `StatusBadge` doesn't know about by itself, so the border color
has to be set explicity whereever it's desired.

This commit introduces (default) colors for the border based on where
badge is used.
2022-09-21 18:20:02 +02:00
Pascal Precht 1569a8483a feat(Components): introduce StatusNavigationListItem
This introduces the `StatusNavigationListItem` that can be used to render
menu navigation items in secondary panels, such as the profile panel.

Usage:

```
import StatusQ.Components 0.1

StatusNavigationListItem {
    title: "Menu Item"
}

StatusNavigationListItem {
    title: "Menu Item"
    icon.name: "info"
}

StatusNavigationListItem {
    title: "Menu Item"
    icon.name: "info"
    badge.value: 1
}
StatusNavigationListItem {
    title: "Menu Item (selected)"
    selected: true
    icon.name: "info"
    badge.value: 1
}
```

Closes #72
2022-09-21 18:20:02 +02:00
Pascal Precht e1c9570e89 feat(Components): introduce StatusChatListItem
This introduces the brand new `StatusChatListItem` which can be used
to render channels, one-to-one chats and community channels in Status
applications.

The component can be used as follows:

```qml
import Status.Components 0.1

StatusChatListItem {
    name: "channel-name" // name of channel or user
    type: StatusChatListItem.Type.PublicChat // GroupChat | CommunityChat | OneToOneChat
    image.source: "profile/image/source" // uses letter identicon instead of not supplied
    hasUnreadMessages: true // default `false`
    badge.value: 1 // default `0`
    muted: true // `default `false`
    selected: true // default `false`

    onUnmute: ... // signal when unmute icon is clicked
}
```

Closes #65
2022-09-21 18:20:02 +02:00
B.Melnik 770338a658 refactor(Controls): make use of newly introduced StatusIconSettings in button controls
Closes #57
2022-09-21 18:20:02 +02:00