1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-27 02:03:24 +02:00

mainview: ui fixes

1. GeneralMenuSeparator style
2. MessageBarTextArea style
3. SidePanelTabBar clickable area
4. SmartListItemDelegate CallStatus text position
5. ParticipantCallInStatus button/text size

Change-Id: I9f974783e100a2ed3bf0d30353e071230b211167
This commit is contained in:
Ming Rui Zhang 2021-09-23 15:18:51 -04:00 committed by Sébastien Blin
parent 5b267c9a46
commit aa04677cf3
9 changed files with 28 additions and 38 deletions

View file

@ -121,7 +121,7 @@ ComboBox {
contentItem: JamiListView { contentItem: JamiListView {
id: listView id: listView
implicitHeight: popup.contentHeight implicitHeight: contentHeight
model: root.delegateModel model: root.delegateModel
} }

View file

@ -36,4 +36,8 @@ MenuSeparator {
implicitHeight: separatorPreferredHeight implicitHeight: separatorPreferredHeight
color: separatorColor color: separatorColor
} }
background: Rectangle {
color: JamiTheme.backgroundColor
}
} }

View file

@ -240,7 +240,7 @@ Item {
property real participantCallInStatusOpacity: 0.77 property real participantCallInStatusOpacity: 0.77
property int participantCallInAvatarSize: 60 property int participantCallInAvatarSize: 60
property int participantCallInNameFontSize: 11 property int participantCallInNameFontSize: 11
property int participantCallInStatusFontSize: 7 property int participantCallInStatusFontSize: 8
property int participantCallInStatusTextWidthLimit: 80 property int participantCallInStatusTextWidthLimit: 80
property int participantCallInStatusTextWidth: 40 property int participantCallInStatusTextWidth: 40
property int mosaicButtonRadius: 5 property int mosaicButtonRadius: 5

View file

@ -28,7 +28,6 @@ import "../../commoncomponents"
TabButton { TabButton {
id: root id: root
property var tabBar: undefined
property alias labelText: label.text property alias labelText: label.text
property alias acceleratorSequence: accelerator.sequence property alias acceleratorSequence: accelerator.sequence
property alias badgeCount: badge.count property alias badgeCount: badge.count
@ -37,18 +36,18 @@ TabButton {
hoverEnabled: true hoverEnabled: true
onClicked: selected() onClicked: selected()
Rectangle { Rectangle {
id: rect id: contentRect
anchors.fill: root
width: tabBar.width / 2 + 1
height: tabBar.height
color: root.hovered ? color: root.hovered ?
JamiTheme.hoverColor : JamiTheme.hoverColor :
JamiTheme.backgroundColor JamiTheme.backgroundColor
RowLayout { RowLayout {
anchors.horizontalCenter: rect.horizontalCenter anchors.horizontalCenter: contentRect.horizontalCenter
anchors.verticalCenter: rect.verticalCenter anchors.verticalCenter: contentRect.verticalCenter
Text { Text {
id: label id: label
@ -70,8 +69,8 @@ TabButton {
} }
Rectangle { Rectangle {
width: rect.width width: contentRect.width
anchors.bottom: rect.bottom anchors.bottom: contentRect.bottom
height: 2 height: 2
color: root.down ? JamiTheme.textColor : "transparent" color: root.down ? JamiTheme.textColor : "transparent"
} }
@ -79,7 +78,7 @@ TabButton {
Shortcut { Shortcut {
id: accelerator id: accelerator
context: Qt.ApplicationShortcut context: Qt.ApplicationShortcut
enabled: rect.visible enabled: contentRect.visible
onActivated: selected() onActivated: selected()
} }
} }

View file

@ -57,23 +57,16 @@ JamiFlickable {
} }
} }
contentWidth: width
contentHeight: textArea.implicitHeight
interactive: true interactive: true
attachedFlickableMoving: contentHeight > height || root.moving attachedFlickableMoving: contentHeight > height || root.moving
function ensureVisible(r) {
if (contentY >= r.y)
contentY = r.y
else if (contentY + height <= r.y + r.height)
contentY = r.y + r.height - height
}
TextArea.flickable: TextArea { TextArea.flickable: TextArea {
id: textArea id: textArea
padding: 0 leftPadding: JamiTheme.scrollBarHandleSize
rightPadding: JamiTheme.scrollBarHandleSize
topPadding: 0
bottomPadding: 0
verticalAlignment: TextEdit.AlignVCenter verticalAlignment: TextEdit.AlignVCenter
@ -81,7 +74,6 @@ JamiFlickable {
font.hintingPreference: Font.PreferNoHinting font.hintingPreference: Font.PreferNoHinting
color: JamiTheme.textColor color: JamiTheme.textColor
renderType: Text.NativeRendering
wrapMode: TextEdit.Wrap wrapMode: TextEdit.Wrap
selectByMouse: true selectByMouse: true
selectionColor: JamiTheme.placeholderTextColor selectionColor: JamiTheme.placeholderTextColor
@ -109,13 +101,14 @@ JamiFlickable {
} }
} }
} }
background: Rectangle { background: Rectangle {
border.width: 0 border.width: 0
color: JamiTheme.transparentColor color: JamiTheme.transparentColor
} }
onReleased: function (event) { onReleased: function (event) {
if (event.button == Qt.RightButton) if (event.button === Qt.RightButton)
textAreaContextMenu.openMenuAt(event) textAreaContextMenu.openMenuAt(event)
} }
@ -142,7 +135,5 @@ JamiFlickable {
} }
} }
} }
onCursorRectangleChanged: root.ensureVisible(cursorRectangle)
} }
} }

View file

@ -120,10 +120,7 @@ SpinningAnimation {
anchors.rightMargin: 10 anchors.rightMargin: 10
anchors.verticalCenter: contentRect.verticalCenter anchors.verticalCenter: contentRect.verticalCenter
width: 40 preferredSize: 40
height: 40
// To control the size of the svg
preferredSize: 50
pressedColor: JamiTheme.refuseRed pressedColor: JamiTheme.refuseRed
hoveredColor: JamiTheme.refuseRed hoveredColor: JamiTheme.refuseRed

View file

@ -94,6 +94,7 @@ Rectangle {
anchors.topMargin: visible ? 10 : 0 anchors.topMargin: visible ? 10 : 0
width: sidePanelRect.width width: sidePanelRect.width
height: visible ? 42 : 0 height: visible ? 42 : 0
contentHeight: visible ? 42 : 0
} }
Rectangle { Rectangle {
@ -145,7 +146,7 @@ Rectangle {
id: searchResultsListView id: searchResultsListView
visible: count visible: count
opacity: visible ? 1 :0 opacity: visible ? 1 : 0
Layout.topMargin: 10 Layout.topMargin: 10
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop

View file

@ -28,8 +28,6 @@ import "../../commoncomponents"
TabBar { TabBar {
id: tabBar id: tabBar
currentIndex: 0
enum TabIndex { enum TabIndex {
Conversations, Conversations,
Requests Requests
@ -39,11 +37,12 @@ TabBar {
ConversationsAdapter.filterRequests = (idx === SidePanelTabBar.Requests) ConversationsAdapter.filterRequests = (idx === SidePanelTabBar.Requests)
} }
currentIndex: 0
FilterTabButton { FilterTabButton {
id: conversationsTabButton id: conversationsTabButton
down: !ConversationsAdapter.filterRequests down: !ConversationsAdapter.filterRequests
tabBar: parent
labelText: JamiStrings.conversations labelText: JamiStrings.conversations
onSelected: selectTab(SidePanelTabBar.Conversations) onSelected: selectTab(SidePanelTabBar.Conversations)
badgeCount: ConversationsAdapter.totalUnreadMessageCount badgeCount: ConversationsAdapter.totalUnreadMessageCount
@ -54,7 +53,6 @@ TabBar {
id: requestsTabButton id: requestsTabButton
down: !conversationsTabButton.down down: !conversationsTabButton.down
tabBar: parent
labelText: JamiStrings.invitations labelText: JamiStrings.invitations
onSelected: selectTab(SidePanelTabBar.Requests) onSelected: selectTab(SidePanelTabBar.Requests)
badgeCount: ConversationsAdapter.pendingRequestCount badgeCount: ConversationsAdapter.pendingRequestCount

View file

@ -130,13 +130,13 @@ ItemDelegate {
} }
ColumnLayout { ColumnLayout {
visible: (InCall || UnreadMessagesCount) && !ReadOnly
Layout.preferredWidth: childrenRect.width
Layout.fillHeight: true Layout.fillHeight: true
spacing: 2 spacing: 2
// call status // call status
Text { Text {
id: callStatusText
Layout.preferredHeight: 20 Layout.preferredHeight: 20
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
text: InCall ? UtilsAdapter.getCallStatusStr(CallState) : "" text: InCall ? UtilsAdapter.getCallStatusStr(CallState) : ""