1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-09 19:43:31 +02:00

qt6: fix misplacements and some warnings

Change-Id: I4ff37c5dd109ed51de3946d9a6337273e1812c64
This commit is contained in:
Sébastien Blin 2023-05-05 11:33:25 -04:00
parent 9207dfcd5b
commit 2ce880670d
3 changed files with 91 additions and 89 deletions

View file

@ -74,6 +74,8 @@ Rectangle {
id: messagingHeaderRectRowLayout id: messagingHeaderRectRowLayout
anchors.fill: parent anchors.fill: parent
anchors.rightMargin: 8
spacing: 16
PushButton { PushButton {
id: backToWelcomeViewButton id: backToWelcomeViewButton
@ -146,115 +148,108 @@ Rectangle {
} }
} }
RowLayout { Searchbar {
id: headerButtons id: rowSearchBar
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.rightMargin: 8 Layout.preferredHeight: 30
spacing: 16 Layout.preferredWidth: 30 + (isOpen? JamiTheme.searchbarSize : 0)
Layout.fillWidth: true
Searchbar { visible: root.swarmDetailsVisibility
id: rowSearchBar
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Shortcut {
spacing: headerButtons.spacing sequence: "Ctrl+Shift+F"
visible: root.swarmDetailsVisibility context: Qt.ApplicationShortcut
enabled: rowSearchBar.visible
Shortcut { onActivated: {
sequence: "Ctrl+Shift+F" rowSearchBar.openSearchBar();
context: Qt.ApplicationShortcut
enabled: rowSearchBar.visible
onActivated: {
rowSearchBar.openSearchBar();
}
} }
} }
}
PushButton { PushButton {
id: startAAudioCallButton id: startAAudioCallButton
visible: interactionButtonsVisibility && (!addMemberVisibility || UtilsAdapter.getAppValue(Settings.EnableExperimentalSwarm)) visible: interactionButtonsVisibility && (!addMemberVisibility || UtilsAdapter.getAppValue(Settings.EnableExperimentalSwarm))
source: JamiResources.place_audiocall_24dp_svg source: JamiResources.place_audiocall_24dp_svg
toolTipText: JamiStrings.placeAudioCall toolTipText: JamiStrings.placeAudioCall
normalColor: JamiTheme.chatviewBgColor normalColor: JamiTheme.chatviewBgColor
imageColor: JamiTheme.chatviewButtonColor imageColor: JamiTheme.chatviewButtonColor
onClicked: CallAdapter.placeAudioOnlyCall() onClicked: CallAdapter.placeAudioOnlyCall()
}
PushButton {
id: startAVideoCallButton
visible: CurrentAccount.videoEnabled_Video && interactionButtonsVisibility && (!addMemberVisibility || UtilsAdapter.getAppValue(Settings.EnableExperimentalSwarm))
source: JamiResources.videocam_24dp_svg
toolTipText: JamiStrings.placeVideoCall
normalColor: JamiTheme.chatviewBgColor
imageColor: JamiTheme.chatviewButtonColor
onClicked: {
CallAdapter.placeCall();
} }
}
PushButton { PushButton {
id: startAVideoCallButton id: addParticipantsButton
visible: CurrentAccount.videoEnabled_Video && interactionButtonsVisibility && (!addMemberVisibility || UtilsAdapter.getAppValue(Settings.EnableExperimentalSwarm)) source: JamiResources.add_people_24dp_svg
source: JamiResources.videocam_24dp_svg toolTipText: JamiStrings.addParticipants
toolTipText: JamiStrings.placeVideoCall
normalColor: JamiTheme.chatviewBgColor normalColor: JamiTheme.chatviewBgColor
imageColor: JamiTheme.chatviewButtonColor imageColor: JamiTheme.chatviewButtonColor
onClicked: { visible: interactionButtonsVisibility && addMemberVisibility
CallAdapter.placeCall();
}
}
PushButton { onClicked: addToConversationClicked()
id: addParticipantsButton }
source: JamiResources.add_people_24dp_svg PushButton {
toolTipText: JamiStrings.addParticipants id: selectPluginButton
normalColor: JamiTheme.chatviewBgColor visible: PluginAdapter.isEnabled && PluginAdapter.chatHandlersListCount && interactionButtonsVisibility
imageColor: JamiTheme.chatviewButtonColor
visible: interactionButtonsVisibility && addMemberVisibility source: JamiResources.plugins_24dp_svg
toolTipText: JamiStrings.showPlugins
onClicked: addToConversationClicked() normalColor: JamiTheme.chatviewBgColor
} imageColor: JamiTheme.chatviewButtonColor
PushButton { onClicked: pluginSelector()
id: selectPluginButton }
visible: PluginAdapter.isEnabled && PluginAdapter.chatHandlersListCount && interactionButtonsVisibility PushButton {
id: sendContactRequestButton
source: JamiResources.plugins_24dp_svg visible: CurrentConversation.isTemporary || CurrentConversation.isBanned
toolTipText: JamiStrings.showPlugins
normalColor: JamiTheme.chatviewBgColor source: JamiResources.add_people_24dp_svg
imageColor: JamiTheme.chatviewButtonColor toolTipText: JamiStrings.addToConversations
onClicked: pluginSelector() normalColor: JamiTheme.chatviewBgColor
} imageColor: JamiTheme.chatviewButtonColor
PushButton { onClicked: CurrentConversation.isBanned ? MessagesAdapter.unbanConversation(CurrentConversation.id) : MessagesAdapter.sendConversationRequest()
id: sendContactRequestButton }
visible: CurrentConversation.isTemporary || CurrentConversation.isBanned PushButton {
id: detailsButton
source: JamiResources.add_people_24dp_svg visible: interactionButtonsVisibility && (swarmDetailsVisibility || LRCInstance.currentAccountType === Profile.Type.SIP) // TODO if SIP not a request
toolTipText: JamiStrings.addToConversations
normalColor: JamiTheme.chatviewBgColor source: JamiResources.swarm_details_panel_svg
imageColor: JamiTheme.chatviewButtonColor toolTipText: JamiStrings.details
onClicked: CurrentConversation.isBanned ? MessagesAdapter.unbanConversation(CurrentConversation.id) : MessagesAdapter.sendConversationRequest() normalColor: JamiTheme.chatviewBgColor
} imageColor: JamiTheme.chatviewButtonColor
PushButton { onClicked: showDetailsClicked()
id: detailsButton
visible: interactionButtonsVisibility && (swarmDetailsVisibility || LRCInstance.currentAccountType === Profile.Type.SIP) // TODO if SIP not a request
source: JamiResources.swarm_details_panel_svg
toolTipText: JamiStrings.details
normalColor: JamiTheme.chatviewBgColor
imageColor: JamiTheme.chatviewButtonColor
onClicked: showDetailsClicked()
}
} }
} }

View file

@ -28,11 +28,15 @@ RowLayout {
property string currentConversationId: CurrentConversation.id property string currentConversationId: CurrentConversation.id
property bool isOpen: extrasPanel.isOpen(ChatView.MessagesResearchPanel) property bool isOpen: extrasPanel.isOpen(ChatView.MessagesResearchPanel)
onIsOpenChanged: if (isOpen) onIsOpenChanged: {
textArea.forceActiveFocus() if (isOpen)
textArea.forceActiveFocus()
}
PushButton { PushButton {
id: startSearchMessages id: startSearchMessages
Layout.preferredHeight: 30
Layout.preferredWidth: 30
source: JamiResources.search_svg source: JamiResources.search_svg
normalColor: JamiTheme.chatviewBgColor normalColor: JamiTheme.chatviewBgColor
@ -60,7 +64,7 @@ RowLayout {
} }
} }
Layout.preferredWidth: isOpen ? JamiTheme.searchbarSize : 0 width: isOpen ? JamiTheme.searchbarSize : 0
Behavior on Layout.preferredWidth { Behavior on Layout.preferredWidth {
NumberAnimation { NumberAnimation {
duration: 150 duration: 150

View file

@ -34,6 +34,7 @@ Rectangle {
property bool showTab: false property bool showTab: false
property bool showAlreadyHave: false property bool showAlreadyHave: false
property bool showAdvanced: false property bool showAdvanced: false
property int buttonSize: JamiTheme.wizardButtonWidth
signal showThisPage signal showThisPage
@ -58,6 +59,8 @@ Rectangle {
KeyNavigation.up: newAccountButton KeyNavigation.up: newAccountButton
KeyNavigation.down: KeyNavigation.tab KeyNavigation.down: KeyNavigation.tab
onWidthChanged: root.buttonSize = Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2)
ColumnLayout { ColumnLayout {
id: welcomePageColumnLayout id: welcomePageColumnLayout
@ -65,7 +68,7 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: Math.max(508, root.width - 100) width: 800
Item { Item {
@ -163,7 +166,7 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.topMargin: JamiTheme.wizardViewBlocMarginSize Layout.topMargin: JamiTheme.wizardViewBlocMarginSize
preferredWidth: Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2) preferredWidth: root.buttonSize
text: JamiStrings.joinJami text: JamiStrings.joinJami
toolTipText: JamiStrings.createNewJamiAccount toolTipText: JamiStrings.createNewJamiAccount
@ -181,7 +184,7 @@ Rectangle {
objectName: "alreadyHaveAccount" objectName: "alreadyHaveAccount"
primary: true primary: true
preferredWidth: Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2) preferredWidth: root.buttonSize
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
@ -219,7 +222,7 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
preferredWidth: Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2) preferredWidth: root.buttonSize
visible: false visible: false
@ -244,7 +247,7 @@ Rectangle {
visible: false visible: false
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
preferredWidth: Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2) preferredWidth: root.buttonSize
text: JamiStrings.importAccountFromBackup text: JamiStrings.importAccountFromBackup
toolTipText: JamiStrings.connectFromBackup toolTipText: JamiStrings.connectFromBackup
@ -266,7 +269,7 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.bottomMargin: newSIPAccountButton.visible ? 0 : JamiTheme.wizardViewPageBackButtonMargins Layout.bottomMargin: newSIPAccountButton.visible ? 0 : JamiTheme.wizardViewPageBackButtonMargins
preferredWidth: Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2) preferredWidth: root.buttonSize
text: JamiStrings.advancedFeatures text: JamiStrings.advancedFeatures
toolTipText: showAdvanced ? JamiStrings.hideAdvancedFeatures : JamiStrings.showAdvancedFeatures toolTipText: showAdvanced ? JamiStrings.hideAdvancedFeatures : JamiStrings.showAdvancedFeatures
@ -296,7 +299,7 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
preferredWidth: Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2) preferredWidth: root.buttonSize
visible: false visible: false
text: JamiStrings.createNewRV text: JamiStrings.createNewRV
@ -319,7 +322,7 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
preferredWidth: Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2) preferredWidth: root.buttonSize
visible: false visible: false
text: JamiStrings.connectJAMSServer text: JamiStrings.connectJAMSServer
@ -344,7 +347,7 @@ Rectangle {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
Layout.bottomMargin: JamiTheme.wizardViewPageBackButtonMargins Layout.bottomMargin: JamiTheme.wizardViewPageBackButtonMargins
preferredWidth: Math.min(JamiTheme.wizardButtonWidth, root.width - JamiTheme.preferredMarginSize * 2) preferredWidth: root.buttonSize
visible: false visible: false
text: JamiStrings.addSIPAccount text: JamiStrings.addSIPAccount