diff --git a/images/icons/delete-24px.svg b/images/icons/delete-24px.svg
new file mode 100644
index 00000000..3acec0ad
--- /dev/null
+++ b/images/icons/delete-24px.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/images/icons/settings_backup_restore-24px.svg b/images/icons/settings_backup_restore-24px.svg
new file mode 100644
index 00000000..8f3f1bde
--- /dev/null
+++ b/images/icons/settings_backup_restore-24px.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/qml.qrc b/qml.qrc
index 3afafbac..640897b0 100644
--- a/qml.qrc
+++ b/qml.qrc
@@ -52,7 +52,6 @@
src/settingsview/components/NameRegistrationDialog.qml
src/settingsview/components/LinkDeviceDialog.qml
src/settingsview/components/RevokeDevicePasswordDialog.qml
- src/commoncomponents/HoverableRadiusButton.qml
src/commoncomponents/PasswordDialog.qml
src/commoncomponents/InfoLineEdit.qml
src/commoncomponents/MaterialLineEdit.qml
diff --git a/resources.qrc b/resources.qrc
index 51a1b2ec..82877ee5 100644
--- a/resources.qrc
+++ b/resources.qrc
@@ -134,5 +134,7 @@
images/icons/arrow_drop_down-24px.svg
images/icons/expand_less-24px.svg
images/icons/expand_more-24px.svg
+ images/icons/delete-24px.svg
+ images/icons/settings_backup_restore-24px.svg
diff --git a/src/commoncomponents/HoverableRadiusButton.qml b/src/commoncomponents/HoverableRadiusButton.qml
deleted file mode 100644
index 2f69b88e..00000000
--- a/src/commoncomponents/HoverableRadiusButton.qml
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2020 by Savoir-faire Linux
- * Author: Mingrui Zhang
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-import QtQuick 2.15
-import QtQuick.Controls 2.14
-import net.jami.Models 1.0
-
-
-// HoverableButton contains the following configurable properties:
-// 1. Color changes on different button state
-// 2. Radius control (rounded)
-// 3. Text content or image content
-// 4. Can use OnClicked slot to implement some click logic
-
-Button {
- id: root
- property int fontPointSize: 9
- property int buttonImageHeight: hoverableButtonBackground.height - 10
- property int buttonImageWidth: hoverableButtonBackground.width - 10
- property string backgroundColor: JamiTheme.normalButtonColor
- property string onPressColor: JamiTheme.pressColor
- property string onReleaseColor: backgroundColor
- property string onEnterColor: JamiTheme.hoverColor
- property string onExitColor: backgroundColor
- property alias radius: hoverableButtonBackground.radius
- property alias source: hoverableButtonImage.source
- property string toolTipText: ""
- radius: height / 2
- function enterBtn(){
- btnMouseArea.entered()
- }
- function exitBtn(){
- btnMouseArea.exited()
- }
- function pressBtn(){
- btnMouseArea.pressed()
- }
- function releaseBtn(){
- btnMouseArea.released()
- }
-
- ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
- ToolTip.visible: hovered && (toolTipText.length > 0)
- ToolTip.text: toolTipText
-
- font.pointSize: fontPointSize
- font.kerning: true
- hoverEnabled: true
- background: Rectangle {
- id: hoverableButtonBackground
- color: backgroundColor
- Image {
- id: hoverableButtonImage
- anchors.centerIn: hoverableButtonBackground
- height: buttonImageHeight
- width: buttonImageWidth
- fillMode: Image.PreserveAspectFit
- mipmap: true
- asynchronous: true
- }
- MouseArea {
- id: btnMouseArea
- anchors.fill: parent
- hoverEnabled: true
- onPressed: {
- hoverableButtonBackground.color = onPressColor
- }
- onReleased: {
- hoverableButtonBackground.color = onReleaseColor
- root.clicked()
- }
- onEntered: {
- hoverableButtonBackground.color = onEnterColor
- }
- onExited: {
- hoverableButtonBackground.color = onExitColor
- }
- }
- }
-}
diff --git a/src/commoncomponents/PreferenceItemDelegate.qml b/src/commoncomponents/PreferenceItemDelegate.qml
index 8b83b08c..17d2593e 100644
--- a/src/commoncomponents/PreferenceItemDelegate.qml
+++ b/src/commoncomponents/PreferenceItemDelegate.qml
@@ -61,7 +61,7 @@ ItemDelegate {
btnPreferenceClicked()
break
case PreferenceItemDelegate.PATH:
- if(index == 0){
+ if(index === 0){
preferenceFilePathDialog.title = qsTr("Select An Image to " + preferenceName)
preferenceFilePathDialog.nameFilters = fileFilters
preferenceFilePathDialog.open()
@@ -101,35 +101,27 @@ ItemDelegate {
ToolTip.text: preferenceSummary
}
- HoverableRadiusButton {
+ PushButton {
id: btnPreference
+
visible: preferenceType === PreferenceItemDelegate.DEFAULT
- backgroundColor: "white"
+ normalColor: JamiTheme.primaryBackgroundColor
Layout.alignment: Qt.AlignRight | Qt.AlingVCenter
- Layout.rightMargin: 7
- Layout.preferredWidth: 30
- Layout.preferredHeight: 30
+ Layout.rightMargin: 8
+ Layout.preferredWidth: preferredSize
+ Layout.preferredHeight: preferredSize
- buttonImageHeight: 20
- buttonImageWidth: 20
+ source: "qrc:/images/icons/round-settings-24px.svg"
- source: {
- return "qrc:/images/icons/round-settings-24px.svg"
- }
+ toolTipText: qsTr("Edit preference")
- ToolTip.visible: hovered
- ToolTip.text: {
- return qsTr("Edit preference")
- }
-
- onClicked: {
- btnPreferenceClicked()
- }
+ onClicked: btnPreferenceClicked()
}
SettingParaCombobox {
id: listPreferenceComboBox
+
visible: preferenceType === PreferenceItemDelegate.LIST
Layout.preferredWidth: root.width / 2 - 8
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
@@ -147,23 +139,22 @@ ItemDelegate {
}
}
- HoverableRadiusButton {
+ PushButton {
id: pathPreferenceButton
+
visible: preferenceType === PreferenceItemDelegate.PATH
- Layout.preferredWidth: root.width / 2 - 16
Layout.maximumWidth: root.width / 2 - 16
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.rightMargin: 30
- Layout.preferredHeight: 30
- radius: height / 2
+ width: root.width / 2 - 16
+ Layout.preferredWidth: width
+ Layout.preferredHeight: 32
- icon.source: "qrc:/images/icons/round-folder-24px.svg"
- icon.height: 24
- icon.width: 24
+ source: "qrc:/images/icons/round-folder-24px.svg"
toolTipText: JamiStrings.chooseImageFile
- text: UtilsAdapter.fileName(preferenceCurrentValue)
+ buttonText: UtilsAdapter.fileName(preferenceCurrentValue)
fontPointSize: JamiTheme.buttonFontSize
onClicked: {
diff --git a/src/commoncomponents/PushButton.qml b/src/commoncomponents/PushButton.qml
index 821ce1dd..c12fedc8 100644
--- a/src/commoncomponents/PushButton.qml
+++ b/src/commoncomponents/PushButton.qml
@@ -71,6 +71,7 @@ AbstractButton {
checkable: true
checked: false
hoverEnabled: true
+ focusPolicy: Qt.TabFocus
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.visible: hovered && (toolTipText.length > 0)
diff --git a/src/mainview/components/MediaHandlerItemDelegate.qml b/src/mainview/components/MediaHandlerItemDelegate.qml
index 6b4b4aae..9650ebe6 100644
--- a/src/mainview/components/MediaHandlerItemDelegate.qml
+++ b/src/mainview/components/MediaHandlerItemDelegate.qml
@@ -42,7 +42,7 @@ ItemDelegate {
RowLayout{
anchors.fill: parent
- Label{
+ Label {
Layout.leftMargin: 8
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
@@ -58,7 +58,7 @@ ItemDelegate {
}
}
- Label{
+ Label {
id: labelDeviceId
Layout.leftMargin: 8
Layout.fillWidth: true
@@ -110,30 +110,18 @@ ItemDelegate {
}
}
- HoverableRadiusButton{
+ PushButton {
id: btnPreferencesMediaHandler
- backgroundColor: "white"
-
Layout.alignment: Qt.AlingVCenter | Qt.AlignRight
Layout.rightMargin: 8
- Layout.preferredHeight: 25
- buttonImageHeight: height
- buttonImageWidth: height
+ normalColor: JamiTheme.primaryBackgroundColor
+ source: "qrc:/images/icons/round-settings-24px.svg"
- source:{
- return "qrc:/images/icons/round-settings-24px.svg"
- }
+ toolTipText: qsTr(pluginId)
- ToolTip.visible: hovered
- ToolTip.text: {
- return qsTr(pluginId)
- }
-
- onClicked: {
- openPreferences()
- }
+ onClicked: openPreferences()
}
}
}
diff --git a/src/mainview/components/RecordBox.qml b/src/mainview/components/RecordBox.qml
index 4e6737f6..fac61a0c 100644
--- a/src/mainview/components/RecordBox.qml
+++ b/src/mainview/components/RecordBox.qml
@@ -262,106 +262,82 @@ Rectangle {
anchors.verticalCenterOffset: (isVideo ? 0 : -100)
}
- HoverableRadiusButton {
+ PushButton {
id: recordButton
- width: btnSize
- height: btnSize
+ preferredSize: btnSize
anchors.horizontalCenter: recBox.horizontalCenter
anchors.bottom: recBox.bottom
anchors.bottomMargin: 5
- buttonImageHeight: height
- buttonImageWidth: height
- backgroundColor: isVideo? "#000000cc" : "white"
+ normalColor: isVideo? "#000000cc" : "white"
- radius: height / 2
+ source: "qrc:/images/icons/av_icons/fiber_manual_record-24px.svg"
+ imageColor: "#dc2719"
- icon.source: "qrc:/images/icons/av_icons/fiber_manual_record-24px.svg"
- icon.height: 24
- icon.width: 24
- icon.color: "#dc2719"
onClicked: {
updateState(RecordBox.States.RECORDING)
startRecording()
}
}
- HoverableRadiusButton {
+ PushButton {
id: btnStop
- width: btnSize
- height: btnSize
+ preferredSize: btnSize
anchors.horizontalCenter: recBox.horizontalCenter
anchors.bottom: recBox.bottom
anchors.bottomMargin: 5
- buttonImageHeight: height
- buttonImageWidth: height
- backgroundColor: isVideo? "#000000cc" : "white"
+ normalColor: isVideo? "#000000cc" : "white"
- radius: height / 2
+ source: "qrc:/images/icons/av_icons/stop-24px-red.svg"
+ imageColor: isVideo? "white" : "black"
- icon.source: "qrc:/images/icons/av_icons/stop-24px-red.svg"
- icon.height: 24
- icon.width: 24
- icon.color: isVideo? "white" : "black"
onClicked: {
stopRecording()
updateState(RecordBox.States.REC_SUCCESS)
}
}
- HoverableRadiusButton {
+ PushButton {
id: btnRestart
- width: btnSize
- height: btnSize
+ preferredSize: btnSize
anchors.horizontalCenter: recBox.horizontalCenter
anchors.horizontalCenterOffset: -25
anchors.bottom: recBox.bottom
anchors.bottomMargin: 5
- buttonImageHeight: height
- buttonImageWidth: height
- backgroundColor: isVideo? "#000000cc" : "white"
+ normalColor: isVideo? "#000000cc" : "white"
- radius: height / 2
+ source: "qrc:/images/icons/av_icons/re-record-24px.svg"
+ imageColor: isVideo? "white" : "black"
- icon.source: "qrc:/images/icons/av_icons/re-record-24px.svg"
- icon.height: 24
- icon.width: 24
- icon.color: isVideo? "white" : "black"
onClicked: {
stopRecording()
updateState(RecordBox.States.INIT)
}
}
- HoverableRadiusButton {
+ PushButton {
id: btnSend
- width: btnSize
- height: btnSize
+ preferredSize: btnSize
anchors.horizontalCenter: recBox.horizontalCenter
anchors.horizontalCenterOffset: 25
anchors.bottom: parent.bottom
anchors.bottomMargin: 5
- buttonImageHeight: height
- buttonImageWidth: height
- backgroundColor: isVideo? "#000000cc" : "white"
+ normalColor: isVideo? "#000000cc" : "white"
- radius: height / 2
+ source: "qrc:/images/icons/av_icons/send-24px.svg"
+ imageColor: isVideo? "white" : "black"
- icon.source: "qrc:/images/icons/av_icons/send-24px.svg"
- icon.height: 24
- icon.width: 24
- icon.color: isVideo? "white" : "black"
onClicked: {
stopRecording()
sendRecord()
diff --git a/src/mainview/components/WelcomePage.qml b/src/mainview/components/WelcomePage.qml
index ab265180..7693ee65 100644
--- a/src/mainview/components/WelcomePage.qml
+++ b/src/mainview/components/WelcomePage.qml
@@ -126,11 +126,13 @@ Rectangle {
PushButton {
id: copyRegisterednameButton
+ Layout.alignment: Qt.AlignCenter
+
preferredSize: 34
imagePadding: 4
- Layout.alignment: Qt.AlignCenter
source: "qrc:/images/icons/content_copy-24px.svg"
+
onClicked: {
UtilsAdapter.setText(
textMetricsjamiRegisteredNameText.text)
diff --git a/src/settingsview/components/BannedItemDelegate.qml b/src/settingsview/components/BannedItemDelegate.qml
index e71f7199..e0123d9e 100644
--- a/src/settingsview/components/BannedItemDelegate.qml
+++ b/src/settingsview/components/BannedItemDelegate.qml
@@ -36,22 +36,6 @@ ItemDelegate {
signal btnReAddContactClicked
- function btnReAddContactEnter(){
- btnReAddContact.enterBtn()
- }
-
- function btnReAddContactExit(){
- btnReAddContact.exitBtn()
- }
-
- function btnReAddContactPress(){
- btnReAddContact.pressBtn()
- }
-
- function btnReAddContactRelease(){
- btnReAddContact.releaseBtn()
- }
-
highlighted: ListView.isCurrentItem
RowLayout {
@@ -130,32 +114,19 @@ ItemDelegate {
}
}
- HoverableRadiusButton{
+ PushButton{
id: btnReAddContact
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
- Layout.rightMargin: 8
-
+ Layout.rightMargin: 16
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
- buttonImageHeight: height - 8
- buttonImageWidth: width - 8
-
source: "qrc:/images/icons/person_add-24px.svg"
- radius: height / 2
- width: 25
- height: 25
+ toolTipText: JamiStrings.reinstateContact
- backgroundColor: "transparent"
-
- ToolTip.visible: hovered
- ToolTip.text: JamiStrings.reinstateContact
-
- onClicked: {
- btnReAddContactClicked()
- }
+ onClicked: btnReAddContactClicked()
}
}
}
diff --git a/src/settingsview/components/DeviceItemDelegate.qml b/src/settingsview/components/DeviceItemDelegate.qml
index a651ef43..101e9656 100644
--- a/src/settingsview/components/DeviceItemDelegate.qml
+++ b/src/settingsview/components/DeviceItemDelegate.qml
@@ -120,7 +120,7 @@ ItemDelegate {
id: btnEditDevice
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
- Layout.rightMargin: 8
+ Layout.rightMargin: 16
Layout.preferredWidth: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
diff --git a/src/settingsview/components/PluginItemDelegate.qml b/src/settingsview/components/PluginItemDelegate.qml
index fd4ca4cf..9e864a0f 100644
--- a/src/settingsview/components/PluginItemDelegate.qml
+++ b/src/settingsview/components/PluginItemDelegate.qml
@@ -103,24 +103,15 @@ ItemDelegate {
}
}
- HoverableRadiusButton{
+ PushButton {
id: btnPreferencesPlugin
- backgroundColor: "white"
-
Layout.alignment: Qt.AlingVCenter | Qt.AlignRight
Layout.rightMargin: 8
- Layout.preferredHeight: 25
- buttonImageHeight: height
- buttonImageWidth: height
-
- source:{
- return "qrc:/images/icons/round-settings-24px.svg"
- }
-
- ToolTip.visible: hovered
- ToolTip.text: JamiStrings.showHidePrefs
+ source: "qrc:/images/icons/round-settings-24px.svg"
+ normalColor: JamiTheme.primaryBackgroundColor
+ toolTipText: JamiStrings.showHidePrefs
onClicked: btnPreferencesPluginClicked()
}
diff --git a/src/settingsview/components/PluginListPreferencesView.qml b/src/settingsview/components/PluginListPreferencesView.qml
index 54c88078..39e8e64d 100644
--- a/src/settingsview/components/PluginListPreferencesView.qml
+++ b/src/settingsview/components/PluginListPreferencesView.qml
@@ -110,8 +110,9 @@ Rectangle {
Image {
anchors.centerIn: parent
source: pluginIcon === "" ? "" : "file:" + pluginIcon
- height: 35
- width: 35
+ height: 36
+ width: 36
+ mipmap: true
}
}
}
@@ -132,38 +133,26 @@ Rectangle {
Layout.topMargin: 10
height: 30
- HoverableRadiusButton {
+ PushButton {
id: resetButton
+
Layout.fillWidth: true
- radius: height / 2
-
- icon.source: "qrc:/images/icons/settings_backup_restore-black-18dp.svg"
- icon.height: 24
- icon.width: 24
-
- text: JamiStrings.reset
+ source: "qrc:/images/icons/settings_backup_restore-24px.svg"
+ buttonText: JamiStrings.reset
fontPointSize: JamiTheme.settingsFontSize
- font.kerning: true
- onClicked: {
- resetPluginSlot()
- }
+ onClicked: resetPluginSlot()
}
- HoverableRadiusButton {
+ PushButton {
id: uninstallButton
+
Layout.fillWidth: true
- radius: height / 2
-
- icon.source: "qrc:/images/icons/ic_delete_black_18dp_2x.png"
- icon.height: 24
- icon.width: 24
-
- text: qsTr("Uninstall")
+ source: "qrc:/images/icons/delete-24px.svg"
+ buttonText: qsTr("Uninstall")
fontPointSize: JamiTheme.settingsFontSize
- font.kerning: true
onClicked: uninstallPluginSlot()
}
@@ -178,7 +167,7 @@ Rectangle {
model: PluginAdapter.getPluginPreferencesModel(pluginId)
- delegate: PreferenceItemDelegate{
+ delegate: PreferenceItemDelegate {
id: preferenceItemDelegate
width: pluginPreferenceView.width