Commit f1350271 authored by Camilo higuita's avatar Camilo higuita

update to work wiht chnages on new mauikit #1

parent 224b3682
import QtQuick 2.9 import QtQuick 2.9
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import org.kde.mauikit 1.0 as Maui import org.kde.mauikit 1.0 as Maui
import org.kde.kirigami 2.6 as Kirigami
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import "views/contacts" import "views/contacts"
...@@ -36,7 +37,7 @@ Maui.ApplicationWindow ...@@ -36,7 +37,7 @@ Maui.ApplicationWindow
accentColor: darkTheme ? "#3c4862" : Maui.Style.highlightColor accentColor: darkTheme ? "#3c4862" : Maui.Style.highlightColor
altToolBars: false altToolBars: false
leftIcon.iconColor: footBar.visible ? highlightColor : textColor leftIcon.checked: footBar.visible
// onSearchButtonClicked: footBar.visible = !footBar.visible // onSearchButtonClicked: footBar.visible = !footBar.visible
leftIcon.visible: true leftIcon.visible: true
rightIcon.visible: false rightIcon.visible: false
...@@ -48,7 +49,7 @@ Maui.ApplicationWindow ...@@ -48,7 +49,7 @@ Maui.ApplicationWindow
property bool darkTheme : Maui.FM.loadSettings("dark", "theme", false) == "true" property bool darkTheme : Maui.FM.loadSettings("dark", "theme", false) == "true"
mainMenu: [ mainMenu: [
Maui.MenuItem MenuItem
{ {
checkable: true checkable: true
text: qsTr("Dark theme"); text: qsTr("Dark theme");
...@@ -59,66 +60,63 @@ Maui.ApplicationWindow ...@@ -59,66 +60,63 @@ Maui.ApplicationWindow
Maui.FM.saveSettings("dark", darkTheme, "theme") Maui.FM.saveSettings("dark", darkTheme, "theme")
if(isAndroid) if(isAndroid)
Maui.Android.statusbarColor(backgroundColor, !darkTheme) Maui.Android.statusbarColor(backgroundColor, !darkTheme)
} }
} }
] ]
headBar.rightContent: Maui.ToolButton headBar.rightContent: ToolButton
{ {
id: _dialerButton id: _dialerButton
iconName: "dialer-pad" icon.name: "dialer-pad"
Layout.fillHeight: true icon.color: currentView === views.dialer ? highlightColor : textColor
iconColor: currentView === views.dialer ? highlightColor : textColor
// text: qsTr("Dialer") // text: qsTr("Dialer")
// visible: isAndroid // visible: isAndroid
showIndicator: currentView === views.dialer checked: currentView === views.dialer
onClicked: currentView = views.dialer onClicked: currentView = views.dialer
} }
headBar.middleContent: [ headBar.middleContent: Kirigami.ActionToolBar
{
Maui.ToolButton
{
id: _favsButton
iconName: "draw-star"
Layout.fillHeight: true
iconColor: currentView === views.favs ? highlightColor : textColor
// text: qsTr("Favorites")
showIndicator: currentView === views.favs
onClicked: currentView = views.favs
},
Maui.ToolButton
{
id: _logButton
iconName: "view-media-recent"
Layout.fillHeight: true
iconColor: currentView === views.log ? highlightColor : textColor
// text: qsTr("Favorites")
showIndicator: currentView === views.log
onClicked: currentView = views.log
}, actions: [
Kirigami.Action
{
id: _favsButton
icon.name: "draw-star"
text: qsTr("Favorites")
icon.color: currentView === views.favs ? highlightColor : textColor
checked: currentView === views.favs
onTriggered: currentView = views.favs
},
Kirigami.Action
{
id: _logButton
icon.name: "view-media-recent"
icon.color: currentView === views.log ? highlightColor : textColor
text: qsTr("Favorites")
checked: currentView === views.log
onTriggered: currentView = views.log
},
Maui.ToolButton
{
id: _contactsButton
Layout.fillHeight: true
iconName: "view-contacts"
iconColor: currentView === views.contacts ? highlightColor : textColor
// text: qsTr("Contacts")
// height: parent.height
showIndicator: currentView === views.contacts
onClicked: currentView = views.contacts
} Kirigami.Action
] {
id: _contactsButton
Layout.fillHeight: true
icon.name: "view-contacts"
icon.color: currentView === views.contacts ? highlightColor : textColor
text: qsTr("Contacts")
checked: currentView === views.contacts
onTriggered: currentView = views.contacts
}
]
}
SwipeView SwipeView
{ {
...@@ -144,7 +142,7 @@ Maui.ApplicationWindow ...@@ -144,7 +142,7 @@ Maui.ApplicationWindow
LogsView LogsView
{ {
id: _logView id: _logView
} }
ContactsView ContactsView
...@@ -166,11 +164,12 @@ Maui.ApplicationWindow ...@@ -166,11 +164,12 @@ Maui.ApplicationWindow
color: highlightColor color: highlightColor
radius: Math.max(width, height) radius: Math.max(width, height)
Maui.ToolButton ToolButton
{ {
anchors.centerIn: parent anchors.centerIn: parent
iconName: "list-add-user" icon.name: "list-add-user"
iconColor: "white" icon.color: "white"
flat: true
onClicked: _newContactDialog.open() onClicked: _newContactDialog.open()
} }
} }
......
...@@ -4,7 +4,7 @@ import QtQuick.Layouts 1.3 ...@@ -4,7 +4,7 @@ import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import org.kde.mauikit 1.0 as Maui import org.kde.mauikit 1.0 as Maui
import org.kde.kirigami 2.2 as Kirigami import org.kde.kirigami 2.6 as Kirigami
Maui.Dialog Maui.Dialog
{ {
...@@ -19,7 +19,7 @@ Maui.Dialog ...@@ -19,7 +19,7 @@ Maui.Dialog
footBar.implicitHeight: toolBarHeight * 1.3 footBar.implicitHeight: toolBarHeight * 1.3
footBar.rightContent: Maui.Button footBar.rightContent: Button
{ {
visible: isMobile visible: isMobile
// Layout.fillHeight: visible // Layout.fillHeight: visible
...@@ -27,8 +27,8 @@ Maui.Dialog ...@@ -27,8 +27,8 @@ Maui.Dialog
icon.name: "dialer-call" icon.name: "dialer-call"
text: qsTr("Call") text: qsTr("Call")
// display: ToolButton.TextUnderIcon // display: ToolButton.TextUnderIcon
colorScheme.backgroundColor: infoColor Kirigami.Theme.backgroundColor: infoColor
colorScheme.textColor: "#fff" Kirigami.Theme.textColor: "#fff"
onClicked: onClicked:
{ {
if(isAndroid) if(isAndroid)
...@@ -36,25 +36,25 @@ Maui.Dialog ...@@ -36,25 +36,25 @@ Maui.Dialog
} }
} }
footBar.leftContent: Maui.Button footBar.leftContent: Button
{ {
visible: isMobile visible: isMobile
// Layout.fillHeight: visible // Layout.fillHeight: visible
// Layout.fillWidth: visible // Layout.fillWidth: visible
text: qsTr("Close") text: qsTr("Close")
// display: ToolButton.TextUnderIcon // display: ToolButton.TextUnderIcon
colorScheme.backgroundColor: warningColor Kirigami.Theme.backgroundColor: warningColor
colorScheme.textColor: "#fff" Kirigami.Theme.textColor: "#fff"
onClicked: control.close() onClicked: control.close()
} }
footBar.middleContent: [ footBar.middleContent: [
Maui.ToolButton ToolButton
{ {
Layout.fillHeight: true Layout.fillHeight: true
iconName: "send-email" icon.name: "send-email"
visible: contact.email visible: contact.email
// text: qsTr("Message") // text: qsTr("Message")
display: ToolButton.TextUnderIcon display: ToolButton.TextUnderIcon
...@@ -66,10 +66,10 @@ Maui.Dialog ...@@ -66,10 +66,10 @@ Maui.Dialog
}, },
Maui.ToolButton ToolButton
{ {
Layout.fillHeight: true Layout.fillHeight: true
iconName: "send-sms" icon.name: "send-sms"
visible: contact.tel visible: contact.tel
// text: qsTr("Message") // text: qsTr("Message")
...@@ -87,15 +87,15 @@ Maui.Dialog ...@@ -87,15 +87,15 @@ Maui.Dialog
headBar.drawBorder: false headBar.drawBorder: false
headBar.rightContent:[ headBar.rightContent:[
Maui.ToolButton ToolButton
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
iconName: "draw-star" icon.name: "draw-star"
text: qsTr("Fav") text: qsTr("Fav")
display: ToolButton.TextBesideIcon display: ToolButton.TextBesideIcon
iconColor: contact.fav == "1" ? "#FFD700" : textColor icon.color: contact.fav == "1" ? "#FFD700" : textColor
onClicked: onClicked:
{ {
contact["fav"] = contact.fav == "1" ? "0" : "1" contact["fav"] = contact.fav == "1" ? "0" : "1"
...@@ -105,25 +105,25 @@ Maui.Dialog ...@@ -105,25 +105,25 @@ Maui.Dialog
} }
}, },
Maui.ToolButton ToolButton
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
iconName: "document-share" icon.name: "document-share"
text: qsTr("Share") text: qsTr("Share")
display: ToolButton.TextBesideIcon display: ToolButton.TextBesideIcon
}, },
Maui.ToolButton ToolButton
{ {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
iconName: "document-edit" icon.name: "document-edit"
text: qsTr("Edit") text: qsTr("Edit")
onClicked: _editContactDialog.open() onClicked: _editContactDialog.open()
iconColor: suggestedColor icon.color: suggestedColor
display: ToolButton.TextBesideIcon display: ToolButton.TextBesideIcon
} }
...@@ -147,13 +147,13 @@ Maui.Dialog ...@@ -147,13 +147,13 @@ Maui.Dialog
} }
headBar.drawBorder: false headBar.drawBorder: false
headBar.rightContent: Maui.Button headBar.rightContent: Button
{ {
icon.name: "user-trash" icon.name: "user-trash"
// text: qsTr("Remove") // text: qsTr("Remove")
onClicked: _removeDialog.open() onClicked: _removeDialog.open()
colorScheme.backgroundColor: dangerColor Kirigami.Theme.backgroundColor: dangerColor
colorScheme.textColor: "#fff" Kirigami.Theme.textColor: "#fff"
} }
Maui.Dialog Maui.Dialog
......
...@@ -4,9 +4,7 @@ import QtQuick.Layouts 1.3 ...@@ -4,9 +4,7 @@ import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import org.kde.mauikit 1.0 as Maui import org.kde.mauikit 1.0 as Maui
import org.kde.kirigami 2.2 as Kirigami import org.kde.kirigami 2.6 as Kirigami
import FMList 1.0
Maui.Dialog Maui.Dialog
{ {
...@@ -26,20 +24,19 @@ Maui.Dialog ...@@ -26,20 +24,19 @@ Maui.Dialog
onRejected: control.close() onRejected: control.close()
footBar.leftContent: Maui.Button footBar.leftContent: Button
{ {
text: qsTr("Cancel") text: qsTr("Cancel")
colorScheme.backgroundColor: warningColor Kirigami.Theme.backgroundColor: warningColor
colorScheme.textColor: "#fff" Kirigami.Theme.textColor: "#fff"
onClicked: control.close() onClicked: control.close()
} }
footBar.rightContent: Maui.Button footBar.rightContent: Button
{ {
text: qsTr("Save") text: qsTr("Save")
colorScheme.backgroundColor: infoColor Kirigami.Theme.backgroundColor: infoColor
colorScheme.textColor: "#fff" Kirigami.Theme.textColor: "#fff"
onClicked: onClicked:
{ {
...@@ -88,7 +85,7 @@ Maui.Dialog ...@@ -88,7 +85,7 @@ Maui.Dialog
onClicked:{ onClicked:{
_fileDialog.mode = _fileDialog.modes.OPEN _fileDialog.mode = _fileDialog.modes.OPEN
_fileDialog.filterType= FMList.IMAGE _fileDialog.filterType= Maui.FMList.IMAGE
_fileDialog.show(function(paths) _fileDialog.show(function(paths)
{ {
console.log("selected image", paths) console.log("selected image", paths)
...@@ -135,12 +132,12 @@ Maui.Dialog ...@@ -135,12 +132,12 @@ Maui.Dialog
} }
} }
Maui.ToolButton ToolButton
{ {
iconName: "list-add" icon.name: "list-add"
iconColor: "white" icon.color: "white"
enabled: false enabled: false
size: iconSizes.big icon.width: iconSizes.big
anchors.centerIn: parent anchors.centerIn: parent
} }
} }
......
...@@ -27,7 +27,7 @@ GridLayout ...@@ -27,7 +27,7 @@ GridLayout
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Maui.Button Button
{ {
height: buttonSize height: buttonSize
width: height width: height
......
import QtQuick 2.9 import QtQuick 2.9
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import org.kde.mauikit 1.0 as Maui import org.kde.mauikit 1.0 as Maui
import org.kde.kirigami 2.6 as Kirigami
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import UnionModels 1.0 import UnionModels 1.0
import "../contacts" import "../contacts"
...@@ -41,7 +42,7 @@ Maui.Page ...@@ -41,7 +42,7 @@ Maui.Page
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Maui.Button Button
{ {
icon.name: "send-sms" icon.name: "send-sms"
icon.color: textColor icon.color: textColor
...@@ -64,7 +65,7 @@ Maui.Page ...@@ -64,7 +65,7 @@ Maui.Page
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Maui.Button Button
{ {
icon.name: "dialer-call" icon.name: "dialer-call"
icon.color: "white" icon.color: "white"
...@@ -72,7 +73,7 @@ Maui.Page ...@@ -72,7 +73,7 @@ Maui.Page
width: height width: height
anchors.centerIn: parent anchors.centerIn: parent
// bg.radius: Math.max(width, height) // bg.radius: Math.max(width, height)
colorScheme.backgroundColor: suggestedColor Kirigami.Theme.backgroundColor: suggestedColor
onClicked: onClicked:
{ {
...@@ -89,7 +90,7 @@ Maui.Page ...@@ -89,7 +90,7 @@ Maui.Page
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Maui.Button Button
{ {
icon.name: "edit-clear" icon.name: "edit-clear"
icon.color: textColor icon.color: textColor
...@@ -206,9 +207,5 @@ Maui.Page ...@@ -206,9 +207,5 @@ Maui.Page
anchors.centerIn: parent anchors.centerIn: parent
} }
} }
} }
} }
...@@ -26,10 +26,10 @@ Maui.Page ...@@ -26,10 +26,10 @@ Maui.Page
id: _callLogsModel id: _callLogsModel
} }
Maui.Menu Menu
{ {
id: _menu id: _menu
Maui.MenuItem MenuItem
{ {
text: qsTr("Call") text: qsTr("Call")
icon.name: "dialer-call" icon.name: "dialer-call"
...@@ -40,7 +40,7 @@ Maui.Page ...@@ -40,7 +40,7 @@ Maui.Page
} }
} }
Maui.MenuItem MenuItem
{ {
text: qsTr("Save as..") text: qsTr("Save as..")
icon.name: "list-add-user" icon.name: "list-add-user"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment