Commit Graph

3661 Commits

Author SHA1 Message Date
Pascal Precht 4d595221eb fix(StatusModalHeader): ensure header has enough height for children
Closes #185
2022-09-21 18:20:02 +02:00
Pascal Precht 5e127c7194 fix(StatusRoundedImage): ensure images are scaled and positioned properly
Closes #172
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 c56c0b684d fix(StatusChatList): ensure component provide default `width`
Closes #176
2022-09-21 18:20:02 +02:00
Pascal Precht 7d39fee193 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
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 0d946ea4b0 fix(StatusModal): ensure modal footer uses correct theme color 2022-09-21 18:20:02 +02:00
Pascal Precht e0f09cbe8d chore(README): add StatusQ.Platforms to readme
Also adjust executable script for sandbox
2022-09-21 18:20:02 +02:00
B.Melnik 977f36ceca feat(StatusIcon): Improvement of Icons 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 78d56235af feat(Popups): introduce StatusModalDivider 2022-09-21 18:20:02 +02:00
B.Melnik 4c780c60ec feat(Popups): Add StatusModalFooter 2022-09-21 18:20:02 +02:00
B.Melnik ad90bdf020 feat(Popups): Add status modal header 2022-09-21 18:20:02 +02:00
Pascal Precht 10699d754a feat(StatusListItem): introduce primary and secondary types
Also enable `icon.rotation` via `StatusIconSettings.
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 1b30a45eb8 fix(StatusChatListCategoryItem): don't render menubutton with no popup
Fixes #153
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 4582886d90 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.
2022-09-21 18:20:02 +02:00
Pascal Precht 8081da7fa0 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
2022-09-21 18:20:02 +02:00
Pascal Precht e1a94cfd84 feat(StatusPopupMenu): introduce `openHandler`
Similar to `closeHandler`, StatusPopupMenu can now have a customized `openHandler`
to run custom logic on open.
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 9085fe72d7 fix(StatusListItem): various fixes w.r.t. sensor, icon size etc
This also exposes `statusListItemSubTitle` for more control over
it's appearance, if needed.
2022-09-21 18:20:02 +02:00
Pascal Precht 04e74609f8 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.
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 fde8d17beb fix(StatusNavBarTabButton): fix popup menu positioning 2022-09-21 18:20:02 +02:00
Pascal Precht 1c0c4fdd21 fix(StatusNavBarTabButton): ensure click signal is emitted when not menu is provided 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 b81f0ecd41 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.
2022-09-21 18:20:02 +02:00
Pascal Precht afa4739df6 feat(StatusChatListItem): accept right clicks
Also triggers the context menu in `StatusChatListCategory`.

Fixes #131
2022-09-21 18:20:02 +02:00
Pascal Precht 30956a757d fix(Components): more popup menu position fine-tuning 2022-09-21 18:20:02 +02:00
Pascal Precht 33082a761b fix: introduce tiny icon versions and make use of them where needed
Closes #128
2022-09-21 18:20:02 +02:00
Pascal Precht bd280acd83 fix(StatusChatToolBar): ensure context menu as proper position
Also expose action buttons for more custom control.
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 6ccc9625ba feat(StatusChatListCategoryItem): introduce `highlighted` property 2022-09-21 18:20:02 +02:00
Pascal Precht 6276a789c3 feat(StatusPopupMenu): introduce `closeHandler` hook
This enables us to predefine default close handlers for popup
menus.
2022-09-21 18:20:02 +02:00
Pascal Precht a1ecb77f19 feat(StatusChatListCategoryItemButton): introduce `highglighted` property 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 0fb1818f53 fix(StatusChatListItem): use proper font size for chat name 2022-09-21 18:20:02 +02:00
Pascal Precht 893f96ac88 feat(StatusFlatRoundButton): support icon rotation 2022-09-21 18:20:02 +02:00
Pascal Precht f4005ed52c feat(StatusListItem) expose content children and introduce padding properties
These properties are needed to enable more control over how a list
item implementation can look like.

Content children are exposed as follows:

```qml
StatusListItem {
    statusListItemTitle.[...]: ... // StatusBaseText
    sensor.[...]: ... // MouseArea

    rightPadding: ... // default 16
    leftPadding: .. // default 16
}
```
2022-09-21 18:20:02 +02:00
Pascal Precht ae9c1d810f fix(Core): add missing `rotation` property to `StatusIconSettings` 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 8aa421e6a6 fix(StatusQ.Core.Theme): use correct dropshadow color in dark theme 2022-09-21 18:20:02 +02:00
Pascal Precht 80dbec9fcc fix(Core): don't rotate `ColorOverlay` of `StatusIcon`
As discussed in #109, when using the `rotation` property of `StatusIcon`
it seems to just mirror the underlying image source.

It turns out that using `rotation` on the image source is enough to have
the `ColorOverlay` rotate as well. Adding a `rotation` to the overlay will
rotate the source that's already rotated, resulting in a mirrored result.

To fix this, we're removing the additional `rotation` from the overlay.

Fixes #109
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
Pascal Precht 93a0b2ae21 refactor: make use of `StatusRoundImage`'s built-in loading indicator
Closes #89
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 a13d12dcab fix(StatusNavigationListItem): make click event work again 2022-09-21 18:20:02 +02:00
Pascal Precht e54c46858b fix(Core.Theme): ensure proper nav bar colors is used 2022-09-21 18:20:02 +02:00
Pascal Precht 3784845366 fix(StatusNavBarTabButton): don't change checked state implicitly 2022-09-21 18:20:02 +02:00
Pascal Precht 39f8eae65b fix(StatusAppNavBar): don't try to render chat button if it doesn't exist 2022-09-21 18:20:02 +02:00
Pascal Precht 6c1cb965eb fix(Controls): ensure round buttons expose `hovered` state
Fixes #88
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 5b4a5d780a feat(Layout): introduce `StatusAppTwoPanelLayout`
This is a component to easily render two panel layouts used in different
view of Status Desktop. Designed to be used with `StatusAppLayout`

Usage:

```qml
import StatusQ.Layout 0.1

StatusAppLayout {
    ...
    appView: StackView {
        anchors.fill: parent

        initialItem: Component {

            StatusAppTwoPanelLayout {

                leftPanel: Component {...}
                rightPanel: Component {...}
            }
        }
    }
}
```

Closes: #78
2022-09-21 18:20:02 +02:00
Pascal Precht ce2ec48665 feat(Layout): introduce StatusAppLayout component
This introduces a layout component to quickly scaffold a Status Desktop
ui layout.

Usage:

```qml
import StatusQ.Layout 0.1

StatusAppLayout {
    appNavBar: StatusAppNavBar { ... }
    appView: StackView {
        anchors.fill: parent
        initialItem: Component { ... }
    }
}
```

Closes: #77
2022-09-21 18:20:02 +02:00
B.Melnik 4b9f996d06 feat(StatusRoundedImage): add loading indicator option
Closes #56
2022-09-21 18:20:02 +02:00
Pascal Precht 106936a930 fix(StatusFlatRoundButton): use correct hover color 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 98e64d8eec fix(StatusBadge): use medium font weight for badge text 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 419820cb3d feat(Core): introduce StatusIconBackgroundSettings
This is a settings object to complement the existing `StatusIconSettings`.
Some components, like `StatusRoundIcon` need to be able to configure the
surroundings of the icon their rendering.

In such cases, `StatusIconBackgroundSettings` expose an API that give consumers
a way to configure things like background color, width, height and radius.
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
Pascal Precht 359787835d fix(Core): disable StatusIcon ColorOverlay if no color is supplied
This is needed to have the underlying SVG's color bleed through and
make use of the image's opacity at the same time.

Using `ColorOverlay` together with (half) transparent colors doesn't
work very well as it makes the underlying SVG color come through,
result in wrong colors.

Applying `opacity` on the image itself cause the `ColorOverlay` to
reduce in opacity as well. So in order to work with transparent
colors, we need a way to turn of the ColorOverlay and work with the
Image's opacity, which is what this change enables.
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
B.Melnik 6dc77f2ec3 fix: hover effect for StatusFlatRoundButton
Closes: #58
2022-09-21 18:20:02 +02:00
Pascal Precht fcb6847cc9 feat(Components): introduce `StatusListItem` component
This introduces a base list item component that is used in many different
places across Status Desktop. The component is configurable and allows for
child component customization.

Usage:

```qml
StatusListItem {
    title: "Title"
}

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

StatusListItem {
    title: "Title"
    subTitle: "Subtitle"
    icon.name: "info"
}

StatusListItem {
    title: "Title"
    subTitle: "Subtitle"
    image.source: "..."
}

StatusListItem {
    title: "Title"
    subTitle: "Subtitle"
    image.source: "..."
    label: "Some label"
}

StatusListItem {
    title: "Title"
    subTitle: "Subtitle"
    icon.name: "info"
    label: "Some label"
    components: [
        StatusButton {
            text: "Button"
            size: StatusBaseButton.Size.Small
        }
        ...
    ]
}
```

Closes #19
2022-09-21 18:20:02 +02:00
Pascal Precht ebb0b62005 feat(Core): introduce `StatusImageSettings`
Very similar to what we're doing with `StatusIconSettings` in https://github.com/status-im/StatusQ/pull/61,
this commit introduces `StatusImageSettings` to expose a consisten image
API across components.
2022-09-21 18:20:02 +02:00
Pascal Precht efb34ee85a fix(sandbox): make scrollview content height grow with content
This is just temporary until #40 lands, but for now it allows for
the scrollable content to be grow which is needed to make pages
with many components usable.
2022-09-21 18:20:02 +02:00
Pascal Precht 9cbdf4fa97 feat(Components): introduce `StatusRoundIcon` component
This commit introduces a `StatusRoundIcon` component which renders
a `StatusIcon` inside a rounded rectangle.

This is similar to `StatusRoundButton`, just that it isn't a clickable
component.

With these changes, we also introduce a new `StatusIconSettings` config
object that can be used across component that need icon configuration.

The configuration includes the following properties:

- `name` - Name of the icon and used to locate the asset
- `width`
- `height`

Closes #53
2022-09-21 18:20:02 +02:00
Pascal Precht 8b7911cff9 fix(Components): add proper foreground color for StatusBadge
Fixes #59
2022-09-21 18:20:02 +02:00
Pascal Precht a3525c63e3 feat(StatusIconTabButton): introduce image loading state and fallback
This commit introduces a loading indicator for cases where `icon.source`
is set (a custom image/icon) to improve UX of the component.

It also falls back to a letter identicon in case loading the image source
wasn't successful.

Usage:

```
StatusIconTabButton {
    icon.source: "SOME URL THAT CAN'T BE RESOLVED"
    icon.color: "red" // in case fallback is used, icon.color will be gray by default
    name: "Some channel" // used to generated letter identicon as fallback
}
```

Closes #37
2022-09-21 18:20:02 +02:00
Pascal Precht d7eb4ab4b3 fix(StatusRadioButton): ensure control label as correct color
Closes #51
2022-09-21 18:20:02 +02:00
Pascal Precht 9f6f36f571 refactor(sandbox): rely on global `Theme` instead of theme prop 2022-09-21 18:20:02 +02:00
Pascal Precht 6211ebcf66 chore(README): add StatusQ.Layout module to readme 2022-09-21 18:20:02 +02:00
B.Melnik d7db8dc0df chore: add StatusCheckBox
Closes: #10
2022-09-21 18:20:02 +02:00
B.Melnik 96a5b3b55a chore: add StatusRadioButton
Closes #11
2022-09-21 18:20:02 +02:00
B.Melnik f185b892ea feat: add StatusSwitch
Closes #12
2022-09-21 18:20:02 +02:00
B.Melnik 8fdd4f7e20 fix: fix crash on removing title bar 2022-09-21 18:20:02 +02:00
Pascal Precht a1e721bfc3 feat(Layout): introduce StatusAppNavBar
This commit introduces a new `StatusAppNavBar` component that can be used
to create a Status application's tab bar for dedicated tab sections such as
chat, profile, wallet etc.

The component is build in a way that it support declarative and imperative usage
where necessary.

In its most simple form, a `StatusAppNavBar` comes with a single tab button
for the chat section. Such button has to be of type `StatusNavBarTabButton`:

```qml
import StatusQ.Layout 0.1

StatusAppNavBar {
    navBarChatButton: StatusNavBarTabButton {
        icon.name: "chat"
        badge.value: 33
        badge.visible: true
        tooltip.text: "Chat"
    }
}
```

In addition, it's possible to specify a list of `StatusNavBarTabButton` for
other sections of the application using the `navBarTabButtons` property:

```qml

StatusAppNavBar {
    ...
    navBarTabButtons: [
        StatusNavBarTabButton {
            icon.name: "wallet"
            tooltip.text: "Wallet"
        },
        StatusNavBarTabButton {
            icon.name: "browser"
            tooltip.text: "Browser"
        },
        StatusNavBarTabButton {
            icon.name: "status-update"
            tooltip.text: "Timeline"
        }
    ]
}
```

Lastly, when desired to render tabs for Status community, which can grow
in size, `StatusAppNavBar` exposes a list via the `navBarCommunityTabButtons`
property that can have a `model` and a `delegate`. The `delegate` should also
be a `StatusNavBarTabButton`:

```qml

StatusAppNavBar {
    ...
    navBarCommunityTabButtons.model: someModel.communities

    navBarCommunityTabButtons.delegate: StatusNavBarTabButton {
        name: model.name
        tooltip.text: model.name
        anchors.horizontalCenter: parent.horizontalCenter
    }
}
```

The amount of community tab buttons can grow as they need until their dedicated
area becomes scrollable, at which point all `navBarTabButtons` will stick to the
bottom of `StatusAppNavBar`.

Closes #18
2022-09-21 18:20:02 +02:00
B.Melnik a3c3091c5d feat:Add buttons components 2022-09-21 18:20:02 +02:00
B.Melnik 65991fe559 chore: remove title bar example
Co-authored-by: Pascal Precht <pascal.precht@gmail.com>
2022-09-21 18:20:02 +02:00
Pascal Precht a9df397e71 feat(Controls): introduce StatusNavBarTabButton
This component is used to render application tabs in the application
nav bar that is yet to be implemented.

`StatusNavBarTabButton` is a composition of `StatusIconTabButton`, `StatusToolTip`
and `StatusBadge` and exposes each of these to enable customization.

Usage:

```
StatusNavBarTabButton {
    checked: true/false // whether or not it's 'active'
    name: "string" // used to render a `StatusLetterIdenticon`
    badge.value: 30 // `StatusBadge` is exposed as `badge`
    tooltip.text: "Some tooltip" // `StatusTooltip` is exposed as `tooltip`
    icon.name: "message" // Behaves exactly like `StatusIconTabButton.icon`
}
```

Closes #17
2022-09-21 18:20:02 +02:00
Pascal Precht cc6d28b7ce feat(Controls): introduce StatusToolTip component
This moves the `StatusToolTip` component into `StatusQ` and applies some of
the changes done by @jrainville in https://github.com/status-im/status-desktop/pull/2447.

Usage:

```
import StatusQ.Controls 0.1

Button {
    text: "Hover me!"
    StatusToolTip {
        visible: parent.hovered
        text: "Top"
        orientation: StatusToolTip.Orientation.Top // default: Top
    }
}
```

Closes #14
2022-09-21 18:20:02 +02:00