Skip to content
Snippets Groups Projects
Commit 8f405575 authored by Aline Gondim Santos's avatar Aline Gondim Santos Committed by Andreas Traczyk
Browse files

settings: clean plugins UI

- standardize buttons
- remove scrolling from lists
- avoid highlights

Change-Id: I41f345d5e04a874f70e104df695e652a602df9b8
parent 1ddd3613
Branches
Tags
No related merge requests found
...@@ -134,32 +134,27 @@ ItemDelegate { ...@@ -134,32 +134,27 @@ ItemDelegate {
currentIndex: pluginListPreferenceModel.getCurrentSettingIndex() currentIndex: pluginListPreferenceModel.getCurrentSettingIndex()
textRole: "PreferenceValue" textRole: "PreferenceValue"
tooltipText: JamiStrings.select tooltipText: JamiStrings.select
onActivated: { onActivated: getNewPreferenceValueSlot(index)
getNewPreferenceValueSlot(index)
}
} }
PushButton { MaterialButton {
id: pathPreferenceButton id: pathPreferenceButton
visible: preferenceType === PreferenceItemDelegate.PATH visible: preferenceType === PreferenceItemDelegate.PATH
Layout.maximumWidth: root.width / 2 - 16
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
Layout.rightMargin: 30
width: root.width / 2 - 16 width: root.width / 2 - 16
Layout.preferredWidth: width Layout.preferredWidth: width
Layout.preferredHeight: 32 Layout.preferredHeight: 30
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
source: "qrc:/images/icons/round-folder-24px.svg" Layout.rightMargin: 30
text: UtilsAdapter.fileName(preferenceCurrentValue)
toolTipText: JamiStrings.chooseImageFile toolTipText: JamiStrings.chooseImageFile
buttonText: UtilsAdapter.fileName(preferenceCurrentValue) source: "qrc:/images/icons/round-folder-24px.svg"
fontPointSize: JamiTheme.buttonFontSize color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
onClicked: { onClicked: getNewPreferenceValueSlot(0)
getNewPreferenceValueSlot(0)
}
} }
} }
} }
...@@ -51,8 +51,10 @@ ItemDelegate { ...@@ -51,8 +51,10 @@ ItemDelegate {
Image { Image {
anchors.centerIn: parent anchors.centerIn: parent
source: "file:" + pluginIcon source: "file:" + pluginIcon
width: 30 sourceSize: Qt.size(256, 256)
height: 30 mipmap: true
width: 32
height: 32
} }
} }
} }
...@@ -74,22 +76,16 @@ ItemDelegate { ...@@ -74,22 +76,16 @@ ItemDelegate {
width: 20 width: 20
ToolTip.visible: hovered ToolTip.visible: hovered
ToolTip.text: { ToolTip.text: qsTr("Load/Unload")
return qsTr("Load/Unload")
}
checked: isLoaded checked: isLoaded
onClicked: { onClicked: btnLoadPluginToggled()
btnLoadPluginToggled()
}
background: Rectangle { background: Rectangle {
id: switchBackground id: switchBackground
MouseArea { MouseArea {
id: btnMouseArea id: btnMouseArea
hoverEnabled: true hoverEnabled: true
onPressed: {
}
onReleased: { onReleased: {
loadSwitch.clicked() loadSwitch.clicked()
} }
......
...@@ -110,8 +110,9 @@ Rectangle { ...@@ -110,8 +110,9 @@ Rectangle {
Image { Image {
anchors.centerIn: parent anchors.centerIn: parent
source: pluginIcon === "" ? "" : "file:" + pluginIcon source: pluginIcon === "" ? "" : "file:" + pluginIcon
height: 36 sourceSize: Qt.size(256, 256)
width: 36 height: 48
width: 48
mipmap: true mipmap: true
} }
} }
...@@ -119,7 +120,7 @@ Rectangle { ...@@ -119,7 +120,7 @@ Rectangle {
Label { Label {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 10 Layout.topMargin: 16
text: qsTr(pluginName + "\npreferences") text: qsTr(pluginName + "\npreferences")
font.pointSize: JamiTheme.headerFontSize font.pointSize: JamiTheme.headerFontSize
...@@ -133,26 +134,38 @@ Rectangle { ...@@ -133,26 +134,38 @@ Rectangle {
Layout.topMargin: 10 Layout.topMargin: 10
height: 30 height: 30
PushButton { MaterialButton {
id: resetButton id: resetButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true
source: "qrc:/images/icons/settings_backup_restore-24px.svg" source: "qrc:/images/icons/settings_backup_restore-24px.svg"
buttonText: JamiStrings.reset
fontPointSize: JamiTheme.settingsFontSize text: JamiStrings.reset
onClicked: resetPluginSlot() onClicked: resetPluginSlot()
} }
PushButton { MaterialButton {
id: uninstallButton id: uninstallButton
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.preferredFieldHeight
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true
source: "qrc:/images/icons/delete-24px.svg" source: "qrc:/images/icons/delete-24px.svg"
buttonText: qsTr("Uninstall")
fontPointSize: JamiTheme.settingsFontSize text: qsTr("Uninstall")
onClicked: uninstallPluginSlot() onClicked: uninstallPluginSlot()
} }
...@@ -166,12 +179,13 @@ Rectangle { ...@@ -166,12 +179,13 @@ Rectangle {
Layout.preferredHeight: childrenRect.height + 30 Layout.preferredHeight: childrenRect.height + 30
model: PluginAdapter.getPluginPreferencesModel(pluginId) model: PluginAdapter.getPluginPreferencesModel(pluginId)
interactive: false
delegate: PreferenceItemDelegate { delegate: PreferenceItemDelegate {
id: preferenceItemDelegate id: preferenceItemDelegate
width: pluginPreferenceView.width width: pluginPreferenceView.width
height: childrenRect.height height: 50
preferenceName: PreferenceName preferenceName: PreferenceName
preferenceSummary: PreferenceSummary preferenceSummary: PreferenceSummary
...@@ -188,13 +202,15 @@ Rectangle { ...@@ -188,13 +202,15 @@ Rectangle {
pluginId: PluginId pluginId: PluginId
} }
onClicked: {
pluginPreferenceView.currentIndex = index
}
onBtnPreferenceClicked: { onBtnPreferenceClicked: {
setPreference(pluginId, preferenceKey, preferenceNewValue) setPreference(pluginId, preferenceKey, preferenceNewValue)
pluginPreferenceView.model = PluginAdapter.getPluginPreferencesModel(pluginId) pluginPreferenceView.model = PluginAdapter.getPluginPreferencesModel(pluginId)
} }
background: Rectangle {
anchors.fill: parent
color: "white"
}
} }
} }
} }
......
...@@ -138,6 +138,7 @@ Rectangle { ...@@ -138,6 +138,7 @@ Rectangle {
Layout.preferredHeight: childrenRect.height Layout.preferredHeight: childrenRect.height
model: PluginAdapter.getPluginSelectableModel() model: PluginAdapter.getPluginSelectableModel()
interactive: false
delegate: PluginItemDelegate { delegate: PluginItemDelegate {
id: pluginItemDelegate id: pluginItemDelegate
...@@ -150,14 +151,17 @@ Rectangle { ...@@ -150,14 +151,17 @@ Rectangle {
pluginIcon: PluginIcon pluginIcon: PluginIcon
isLoaded: IsLoaded isLoaded: IsLoaded
onClicked: pluginListView.currentIndex = index
onBtnLoadPluginToggled: { onBtnLoadPluginToggled: {
loadPluginSlot(pluginId, isLoaded) loadPluginSlot(pluginId, isLoaded)
pluginListView.model = PluginAdapter.getPluginSelectableModel() pluginListView.model = PluginAdapter.getPluginSelectableModel()
} }
onBtnPreferencesPluginClicked: openPreferencesPluginSlot(pluginName, pluginIcon, pluginId, isLoaded) onBtnPreferencesPluginClicked: openPreferencesPluginSlot(pluginName, pluginIcon, pluginId, isLoaded)
background: Rectangle {
anchors.fill: parent
color: "white"
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment