Browse Source

added exchange actions

pull/2/head
Skycoder42 7 years ago
parent
commit
a98ce5cad0
  1. 62
      src/imports/mvvmdatasyncquick/DataSyncView.qml
  2. 74
      src/imports/mvvmdatasyncquick/SubButton.qml
  3. 4
      src/imports/mvvmdatasyncquick/icons/ic_add_white_24px.svg
  4. 4
      src/imports/mvvmdatasyncquick/icons/ic_call_made_white_24px.svg
  5. 4
      src/imports/mvvmdatasyncquick/icons/ic_call_received_white_24px.svg
  6. 4
      src/imports/mvvmdatasyncquick/icons/ic_import_export_white_24px.svg
  7. 1
      src/imports/mvvmdatasyncquick/mvvmdatasyncquick.pro
  8. 2
      src/imports/mvvmdatasyncquick/qmldir
  9. 4
      src/imports/mvvmdatasyncquick/qtmvvmdatasyncquick_plugin.qrc
  10. 3
      src/imports/mvvmquick/ActionButton.qml
  11. 2
      src/imports/mvvmquick/MsgBoxBase.qml
  12. 32
      src/imports/mvvmquick/RoundActionButton.qml
  13. 1
      src/imports/mvvmquick/mvvmquick.pro
  14. 1
      src/imports/mvvmquick/qmldir

62
src/imports/mvvmdatasyncquick/DataSyncView.qml

@ -250,4 +250,66 @@ Page {
} }
} }
} }
RoundActionButton {
id: _addButton
z: 7
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 16
checkable: true
text: qsTr("Add new devices")
icon.name: checked ? "tab-close" : "list-add"
icon.source: checked ?
"image://svg/de/skycoder42/qtmvvm/quick/icons/ic_close" :
"image://svg/de/skycoder42/qtmvvm/quick/icons/ic_add"
}
SubButton {
id: _exchangeButton
z: 3
reference: _addButton
expanded: _addButton.checked
text: qsTr("Network Exchange")
icon.name: "network-connect"
icon.source: "image://svg/de/skycoder42/qtmvvm/quick/icons/ic_exchange"
onClicked: {
viewModel.startNetworkExchange();
_addButton.checked = false;
}
}
SubButton {
id: _exportButton
z: 3
reference: _exchangeButton
expanded: _addButton.checked
text: qsTr("Export to file")
icon.name: "document-export"
icon.source: "image://svg/de/skycoder42/qtmvvm/quick/icons/ic_export"
onClicked: {
viewModel.startExport();
_addButton.checked = false;
}
}
SubButton {
id: _importButton
z: 3
reference: _exportButton
expanded: _addButton.checked
text: qsTr("Import from file")
icon.name: "document-import"
icon.source: "image://svg/de/skycoder42/qtmvvm/quick/icons/ic_import"
onClicked: {
viewModel.startImport();
_addButton.checked = false;
}
}
} }

74
src/imports/mvvmdatasyncquick/SubButton.qml

@ -0,0 +1,74 @@
import QtQuick 2.10
import QtQuick.Controls 2.3
import de.skycoder42.QtMvvm.Quick 1.0
RoundActionButton {
id: _subButton
property Item reference: parent
property real btnSpacing: 16
property bool expanded: false
highlighted: false
anchors.horizontalCenter: reference.horizontalCenter
anchors.verticalCenter: reference.verticalCenter
implicitHeight: 40 + padding
implicitWidth: 40 + padding
state: expanded ? "expanded" : "collapsed"
states: [
State {
name: "collapsed"
PropertyChanges {
target: _subButton
anchors.verticalCenterOffset: 0
visible: false
}
},
State {
name: "expanded"
PropertyChanges {
target: _subButton
anchors.verticalCenterOffset: -1 * (reference.height/2 + _subButton.height/2 + btnSpacing)
visible: true
}
}
]
transitions: [
Transition {
from: "collapsed"
to: "expanded"
SequentialAnimation {
PropertyAnimation {
target: _subButton
property: "visible"
duration: 0
}
PropertyAnimation {
target: _subButton
property: "anchors.verticalCenterOffset"
duration: 250
easing.type: Easing.OutCubic
}
}
},
Transition {
from: "expanded"
to: "collapsed"
SequentialAnimation {
PropertyAnimation {
target: _subButton
property: "anchors.verticalCenterOffset"
duration: 250
easing.type: Easing.InCubic
}
PropertyAnimation {
target: _subButton
property: "visible"
duration: 0
}
}
}
]
}

4
src/imports/mvvmdatasyncquick/icons/ic_add_white_24px.svg

@ -0,0 +1,4 @@
<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>

After

Width:  |  Height:  |  Size: 199 B

4
src/imports/mvvmdatasyncquick/icons/ic_call_made_white_24px.svg

@ -0,0 +1,4 @@
<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5z"/>
</svg>

After

Width:  |  Height:  |  Size: 207 B

4
src/imports/mvvmdatasyncquick/icons/ic_call_received_white_24px.svg

@ -0,0 +1,4 @@
<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M20 5.41L18.59 4 7 15.59V9H5v10h10v-2H8.41z"/>
</svg>

After

Width:  |  Height:  |  Size: 207 B

4
src/imports/mvvmdatasyncquick/icons/ic_import_export_white_24px.svg

@ -0,0 +1,4 @@
<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M9 3L5 6.99h3V14h2V6.99h3L9 3zm7 14.01V10h-2v7.01h-3L15 21l4-3.99h-3z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>

After

Width:  |  Height:  |  Size: 233 B

1
src/imports/mvvmdatasyncquick/mvvmdatasyncquick.pro

@ -15,6 +15,7 @@ SOURCES += \
testdummy.cpp testdummy.cpp
QML_FILES += \ QML_FILES += \
SubButton.qml \
DataSyncView.qml DataSyncView.qml
OTHER_FILES += qmldir OTHER_FILES += qmldir

2
src/imports/mvvmdatasyncquick/qmldir

@ -5,4 +5,6 @@ typeinfo plugins.qmltypes
depends de.skycoder42.QtMvvm.DataSync.Core 1.0 depends de.skycoder42.QtMvvm.DataSync.Core 1.0
depends de.skycoder42.QtMvvm.Quick 1.0 depends de.skycoder42.QtMvvm.Quick 1.0
internal SubButton SubButton.qml
DataSyncView 1.0 DataSyncView.qml DataSyncView 1.0 DataSyncView.qml

4
src/imports/mvvmdatasyncquick/qtmvvmdatasyncquick_plugin.qrc

@ -4,5 +4,9 @@
<file alias="ic_fingerprint.svg">icons/ic_fingerprint_white_24px.svg</file> <file alias="ic_fingerprint.svg">icons/ic_fingerprint_white_24px.svg</file>
<file alias="ic_more_vert.svg">icons/ic_more_vert_white_24px.svg</file> <file alias="ic_more_vert.svg">icons/ic_more_vert_white_24px.svg</file>
<file alias="ic_delete_forever.svg">icons/ic_delete_forever_white_24px.svg</file> <file alias="ic_delete_forever.svg">icons/ic_delete_forever_white_24px.svg</file>
<file alias="ic_add.svg">icons/ic_add_white_24px.svg</file>
<file alias="ic_export.svg">icons/ic_call_made_white_24px.svg</file>
<file alias="ic_import.svg">icons/ic_call_received_white_24px.svg</file>
<file alias="ic_exchange.svg">icons/ic_import_export_white_24px.svg</file>
</qresource> </qresource>
</RCC> </RCC>

3
src/imports/mvvmquick/ActionButton.qml

@ -1,6 +1,5 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.3
import de.skycoder42.QtMvvm.Quick 1.0 import de.skycoder42.QtMvvm.Quick 1.0
ToolButton { ToolButton {
@ -22,9 +21,11 @@ ToolButton {
} }
onPressAndHold: { onPressAndHold: {
if(_backToolTip.text !== "") {
QuickPresenter.hapticLongPress(); QuickPresenter.hapticLongPress();
_backToolTip.visible = true; _backToolTip.visible = true;
} }
}
onCanceled: _backToolTip.visible = false onCanceled: _backToolTip.visible = false
onReleased: _backToolTip.visible = false onReleased: _backToolTip.visible = false
} }

2
src/imports/mvvmquick/MsgBoxBase.qml

@ -87,7 +87,7 @@ Dialog {
standardButtons: msgConfig.buttons standardButtons: msgConfig.buttons
onStandardButtonsChanged: { onStandardButtonsChanged: {
for(var key in msgConfig.buttonTexts) for(var key in msgConfig.buttonTexts)
standardButton(DialogButtonBox.Ok).text = msgConfig.buttonTexts[key] standardButton(key).text = msgConfig.buttonTexts[key]
} }
onClicked: { onClicked: {

32
src/imports/mvvmquick/RoundActionButton.qml

@ -0,0 +1,32 @@
import QtQuick 2.10
import QtQuick.Controls 2.3
import de.skycoder42.QtMvvm.Quick 1.0
RoundButton {
id: _roundButton
property string toolTip: _roundButton.text
display: AbstractButton.IconOnly
highlighted: true
implicitHeight: 56 + padding
implicitWidth: 56 + padding
icon.width: 24
icon.height: 24
ToolTip {
id: _backToolTip
text: _roundButton.toolTip
}
onPressAndHold: {
if(_backToolTip.text !== "") {
QuickPresenter.hapticLongPress();
_backToolTip.visible = true;
}
}
onCanceled: _backToolTip.visible = false
onReleased: _backToolTip.visible = false
}

1
src/imports/mvvmquick/mvvmquick.pro

@ -33,6 +33,7 @@ QML_FILES += \
TintIcon.qml \ TintIcon.qml \
ContrastToolBar.qml \ ContrastToolBar.qml \
ActionButton.qml \ ActionButton.qml \
RoundActionButton.qml \
MsgBoxBase.qml \ MsgBoxBase.qml \
MsgBox.qml \ MsgBox.qml \
InputDialog.qml \ InputDialog.qml \

1
src/imports/mvvmquick/qmldir

@ -18,6 +18,7 @@ internal OverviewListView OverviewListView.qml
ContrastToolBar 1.0 ContrastToolBar.qml ContrastToolBar 1.0 ContrastToolBar.qml
ActionButton 1.0 ActionButton.qml ActionButton 1.0 ActionButton.qml
RoundActionButton 1.0 RoundActionButton.qml
PresenterProgress 1.0 PresenterProgress.qml PresenterProgress 1.0 PresenterProgress.qml
PresentingStackView 1.0 PresentingStackView.qml PresentingStackView 1.0 PresentingStackView.qml

Loading…
Cancel
Save