diff --git a/src/icons/light-thin/room-send-invite.svg b/src/icons/light-thin/room-send-invite.svg new file mode 100644 index 00000000..bd5fb4d1 --- /dev/null +++ b/src/icons/light-thin/room-send-invite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/qml/Base/HAvatar.qml b/src/qml/Base/HAvatar.qml index fd44214c..dd3ddddb 100644 --- a/src/qml/Base/HAvatar.qml +++ b/src/qml/Base/HAvatar.qml @@ -50,9 +50,7 @@ HRectangle { fillMode: Image.PreserveAspectCrop source: Qt.resolvedUrl(imageUrl) - HoverHandler { - id: hoverHandler - } + HoverHandler { id: hoverHandler } HToolTip { id: avatarToolTip @@ -65,17 +63,10 @@ HRectangle { height: width delay: 1000 - background: HRectangle { - id: background - border.color: "black" - border.width: 2 - } - HImage { id: avatarToolTipImage - anchors.centerIn: parent - sourceSize.width: parent.width - background.border.width * 2 - sourceSize.height: parent.height - background.border.width * 2 + sourceSize.width: parent.width + sourceSize.height: parent.height width: sourceSize.width height: sourceSize.width fillMode: Image.PreserveAspectCrop diff --git a/src/qml/Base/HButton.qml b/src/qml/Base/HButton.qml index fe81affa..a730486c 100644 --- a/src/qml/Base/HButton.qml +++ b/src/qml/Base/HButton.qml @@ -21,6 +21,11 @@ Button { property bool loading: false property bool circle: false + property HToolTip toolTip: HToolTip { + id: toolTip + visible: text && hovered + } + background: HButtonBackground { button: button diff --git a/src/qml/Base/HMenuItem.qml b/src/qml/Base/HMenuItem.qml index 7be5ee4b..02cf67d2 100644 --- a/src/qml/Base/HMenuItem.qml +++ b/src/qml/Base/HMenuItem.qml @@ -5,9 +5,9 @@ MenuItem { id: menuItem spacing: theme.spacing leftPadding: spacing - rightPadding: spacing + rightPadding: leftPadding topPadding: spacing / 1.75 - bottomPadding: spacing / 1.75 + bottomPadding: topPadding height: visible ? implicitHeight : 0 diff --git a/src/qml/Base/HToolTip.qml b/src/qml/Base/HToolTip.qml index a1c034f3..03fd2372 100644 --- a/src/qml/Base/HToolTip.qml +++ b/src/qml/Base/HToolTip.qml @@ -2,12 +2,25 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 ToolTip { - // Be sure to have a width and height set, to prevent the tooltip from - // going out of the window's boundaries - id: toolTip - delay: 150 - padding: 0 + delay: theme.controls.toolTip.delay + padding: background.border.width + + background: HRectangle { + id: background + color: theme.controls.toolTip.background + border.color: theme.controls.toolTip.border + border.width: theme.controls.toolTip.borderWidth + } + + contentItem: HLabel { + color: theme.controls.toolTip.text + text: toolTip.text + leftPadding: theme.spacing / 1.5 + rightPadding: leftPadding + topPadding: theme.spacing / 2 + bottomPadding: topPadding + } enter: Transition { HNumberAnimation { property: "opacity"; from: 0.0; to: 1.0 } @@ -21,6 +34,6 @@ ToolTip { } HoverHandler { - onHoveredChanged: if (!hovered) { toolTip.hide() } + onHoveredChanged: if (! hovered) toolTip.hide() } } diff --git a/src/qml/Chat/RoomHeader.qml b/src/qml/Chat/RoomHeader.qml index 02276eee..0cae953d 100644 --- a/src/qml/Chat/RoomHeader.qml +++ b/src/qml/Chat/RoomHeader.qml @@ -80,6 +80,10 @@ HRectangle { height: parent.height autoExclusive: true checked: activeButton == modelData + enabled: modelData == "members" + toolTip.text: qsTr( + modelData.charAt(0).toUpperCase() + modelData.slice(1) + ) onClicked: activeButton = activeButton == modelData ? null : modelData } diff --git a/src/qml/Chat/RoomSidePane/MembersView.qml b/src/qml/Chat/RoomSidePane/MembersView.qml index ad6e71a3..29132511 100644 --- a/src/qml/Chat/RoomSidePane/MembersView.qml +++ b/src/qml/Chat/RoomSidePane/MembersView.qml @@ -40,15 +40,29 @@ HColumnLayout { } } - HTextField { - id: filterField - placeholderText: qsTr("Filter members") - backgroundColor: theme.sidePane.filterRooms.background - bordered: false + HRowLayout { + Layout.minimumHeight: theme.baseElementsHeight + Layout.maximumHeight: Layout.minimumHeight - onTextChanged: filterLimiter.requestFire() + HTextField { + id: filterField + placeholderText: qsTr("Filter members") + backgroundColor: theme.chat.roomSidePane.filterMembers.background + bordered: false - Layout.fillWidth: true - Layout.preferredHeight: theme.baseElementsHeight + onTextChanged: filterLimiter.requestFire() + + Layout.fillWidth: true + Layout.fillHeight: true + } + + HButton { + icon.name: "room-send-invite" + iconItem.dimension: parent.height + toolTip.text: qsTr("Invite to this room") + backgroundColor: theme.chat.roomSidePane.inviteButton.background + + Layout.fillHeight: true + } } } diff --git a/src/qml/SidePane/DelegateAccount.qml b/src/qml/SidePane/DelegateAccount.qml index 59f95600..6d065ad6 100644 --- a/src/qml/SidePane/DelegateAccount.qml +++ b/src/qml/SidePane/DelegateAccount.qml @@ -58,6 +58,7 @@ HTileDelegate { backgroundColor: "transparent" padding: sidePane.currentSpacing / 1.5 rightPadding: leftPadding + toolTip.text: collapsed ? qsTr("Expand") : qsTr("Collapse") onClicked: accountDelegate.toggleCollapse() visible: opacity > 0 diff --git a/src/qml/SidePane/PaneToolBar.qml b/src/qml/SidePane/PaneToolBar.qml index 1fedece1..6b9a4923 100644 --- a/src/qml/SidePane/PaneToolBar.qml +++ b/src/qml/SidePane/PaneToolBar.qml @@ -9,14 +9,16 @@ HRowLayout { property alias roomFilter: filterField.text Layout.fillWidth: true - Layout.preferredHeight: theme.baseElementsHeight + Layout.minimumHeight: theme.baseElementsHeight + Layout.maximumHeight: Layout.minimumHeight HButton { icon.name: "add-account" + toolTip.text: qsTr("Add another account") backgroundColor: theme.sidePane.settingsButton.background onClicked: pageLoader.showPage("SignIn") - Layout.preferredHeight: parent.height + Layout.fillHeight: true } HTextField { @@ -26,7 +28,7 @@ HRowLayout { bordered: false Layout.fillWidth: true - Layout.preferredHeight: parent.height + Layout.fillHeight: true onTextChanged: { if (window.uiState.sidePaneFilter == text) return diff --git a/src/themes/Default.qpl b/src/themes/Default.qpl index 43e622a9..8f8b1ecd 100644 --- a/src/themes/Default.qpl +++ b/src/themes/Default.qpl @@ -136,6 +136,13 @@ controls: color background: colors.inputBackground color text: colors.text + toolTip: + int delay: 500 + color background: colors.inputBackground + color text: colors.text + color border: "black" + int borderWidth: 2 + avatar: int size: baseElementsHeight int radius: theme.radius @@ -209,6 +216,12 @@ chat: color name: colors.text color subtitle: colors.dimText + inviteButton: + color background: colors.inputBackground + + filterMembers: + color background: colors.inputBackground + eventList: int ownEventsOnRightUnderWidth: 768 color background: "transparent"