Skycoder42
7 years ago
No known key found for this signature in database
GPG Key ID: 8E01AD9EF0578D2B
20 changed files with
144 additions and
74 deletions
-
src/imports/mvvmdatasyncquick/ChangeRemoteView.qml
-
src/imports/mvvmdatasyncquick/ChangeRemoteView11.qml
-
src/imports/mvvmdatasyncquick/DataSyncView11.qml
-
src/imports/mvvmdatasyncquick/NetworkExchangeView11.qml
-
src/imports/mvvmquick/ColorHelper.qml
-
src/imports/mvvmquick/ContrastToolBar.qml
-
src/imports/mvvmquick/ContrastToolBar11.qml
-
src/imports/mvvmquick/DateEdit.qml
-
src/imports/mvvmquick/DecorLabel.qml
-
src/imports/mvvmquick/ListSection.qml
-
src/imports/mvvmquick/SearchBar.qml
-
src/imports/mvvmquick/SettingsView.qml
-
src/imports/mvvmquick/SettingsView11.qml
-
src/imports/mvvmquick/TimeTumbler.qml
-
src/imports/mvvmquick/TintIcon.qml
-
src/imports/mvvmquick/mvvmquick.pro
-
src/imports/mvvmquick/plugins.qmltypes
-
src/imports/mvvmquick/qmldir
-
src/imports/mvvmquick/qqmlquickpresenter.cpp
-
src/imports/mvvmquick/qqmlquickpresenter.h
|
|
@ -1,7 +1,5 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Controls.Universal 2.3 |
|
|
|
import QtQuick.Layouts 1.3 |
|
|
|
import de.skycoder42.QtDataSync 4.0 |
|
|
|
import de.skycoder42.QtMvvm.Core 1.0 |
|
|
|
|
|
@ -1,7 +1,5 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Controls.Universal 2.3 |
|
|
|
import QtQuick.Layouts 1.3 |
|
|
|
import de.skycoder42.QtDataSync 4.0 |
|
|
|
import de.skycoder42.QtMvvm.Core 1.1 |
|
|
|
|
|
@ -95,6 +95,11 @@ Page { |
|
|
|
|
|
|
|
Pane { |
|
|
|
anchors.fill: parent |
|
|
|
|
|
|
|
ColorHelper { |
|
|
|
id: helper |
|
|
|
} |
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
id: _layout |
|
|
|
anchors.fill: parent |
|
|
@ -146,14 +151,7 @@ Page { |
|
|
|
Layout.fillWidth: true |
|
|
|
Layout.minimumHeight: 1 |
|
|
|
Layout.maximumHeight: 1 |
|
|
|
color: { |
|
|
|
if(QuickPresenter.currentStyle === "Material") |
|
|
|
return Material.foreground; |
|
|
|
else if(QuickPresenter.currentStyle === "Universal") |
|
|
|
return Universal.foreground; |
|
|
|
else |
|
|
|
return "black"; |
|
|
|
} |
|
|
|
color: helper.text |
|
|
|
} |
|
|
|
|
|
|
|
Label { |
|
|
|
|
|
@ -1,12 +1,11 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Controls.Universal 2.3 |
|
|
|
import QtQuick.Layouts 1.3 |
|
|
|
import de.skycoder42.QtDataSync 4.0 |
|
|
|
import de.skycoder42.QtMvvm.Core 1.1 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.1 |
|
|
|
import de.skycoder42.QtMvvm.DataSync.Core 1.1 |
|
|
|
import de.skycoder42.QtMvvm.DataSync.Quick 1.1 |
|
|
|
|
|
|
|
/*! @brief The view implementation for the QtMvvm::NetworkExchangeViewModel |
|
|
|
* |
|
|
@ -43,6 +42,11 @@ Page { |
|
|
|
|
|
|
|
Pane { |
|
|
|
anchors.fill: parent |
|
|
|
|
|
|
|
ColorHelper { |
|
|
|
id: helper |
|
|
|
} |
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
id: _layout |
|
|
|
anchors.fill: parent |
|
|
@ -90,14 +94,7 @@ Page { |
|
|
|
Layout.fillWidth: true |
|
|
|
Layout.minimumHeight: 1 |
|
|
|
Layout.maximumHeight: 1 |
|
|
|
color: { |
|
|
|
if(QuickPresenter.currentStyle === "Material") |
|
|
|
return Material.foreground; |
|
|
|
else if(QuickPresenter.currentStyle === "Universal") |
|
|
|
return Universal.foreground; |
|
|
|
else |
|
|
|
return "black"; |
|
|
|
} |
|
|
|
color: helper.text |
|
|
|
} |
|
|
|
|
|
|
|
Switch { |
|
|
|
|
|
@ -0,0 +1,28 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Controls.Universal 2.3 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.1 |
|
|
|
|
|
|
|
Control { |
|
|
|
id: _colorHelper |
|
|
|
visible: false |
|
|
|
|
|
|
|
readonly property color highlight: { |
|
|
|
if(QuickPresenter.currentStyle === "Material") |
|
|
|
return Material.accent; |
|
|
|
else if(QuickPresenter.currentStyle === "Universal") |
|
|
|
return Universal.accent; |
|
|
|
else |
|
|
|
return palette.highlight; |
|
|
|
} |
|
|
|
|
|
|
|
readonly property color text: { |
|
|
|
if(QuickPresenter.currentStyle === "Material") |
|
|
|
return Material.foreground; |
|
|
|
else if(QuickPresenter.currentStyle === "Universal") |
|
|
|
return Universal.foreground; |
|
|
|
else |
|
|
|
return palette.windowText; |
|
|
|
} |
|
|
|
} |
|
|
@ -28,7 +28,7 @@ ToolBar { |
|
|
|
* the color value is checked, too. If baseColor is easily readable, it is simply returned |
|
|
|
* as result. Otherwise the method proceeds as usual. |
|
|
|
*/ |
|
|
|
function accentTextColor(accentColor, baseColor) { //TODO move to global |
|
|
|
function accentTextColor(accentColor, baseColor) { |
|
|
|
var a = (0.299 * accentColor.r + 0.587 * accentColor.g + 0.144 * accentColor.b); |
|
|
|
if(typeof baseColor !== "undefined") { |
|
|
|
var b = (0.299 * baseColor.r + 0.587 * baseColor.g + 0.144 * baseColor.b); |
|
|
|
|
|
@ -0,0 +1,26 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.1 |
|
|
|
|
|
|
|
/*! @brief An extension of the @ref QtQuick.Controls.ToolBar "ToolBar" for better appearance |
|
|
|
* |
|
|
|
* @extends QtQuick.Controls.ToolBar |
|
|
|
* |
|
|
|
* @details This version basically adjusts size and text color of the toolbar itself and |
|
|
|
* controls within the toolbar to look better and improve contrast |
|
|
|
* |
|
|
|
* @sa ActionButton, ToolBarLabel, MenuButton |
|
|
|
*/ |
|
|
|
ToolBar { |
|
|
|
id: _contrastToolBar |
|
|
|
|
|
|
|
height: 56 |
|
|
|
|
|
|
|
// @copydoc QuickPresenter::accentTextColor |
|
|
|
function accentTextColor(accentColor, baseColor) { |
|
|
|
return QuickPresenter.accentTextColor(accentColor, baseColor); |
|
|
|
} |
|
|
|
|
|
|
|
Material.foreground: QuickPresenter.accentTextColor(Material.primary, Material.foreground) |
|
|
|
} |
|
|
@ -1,8 +1,8 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Layouts 1.3 |
|
|
|
import Qt.labs.calendar 1.0 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.1 |
|
|
|
|
|
|
|
ListView { |
|
|
|
id: _calenderList |
|
|
@ -116,12 +116,19 @@ ListView { |
|
|
|
delegate: Label { |
|
|
|
id: dayDelegate |
|
|
|
|
|
|
|
ColorHelper { |
|
|
|
id: helper |
|
|
|
} |
|
|
|
|
|
|
|
readonly property bool isCurrent: model.day === _calenderList.currentDate.getDate() && model.month === _calenderList.currentDate.getMonth() |
|
|
|
readonly property alias highlightColor: helper.highlight |
|
|
|
|
|
|
|
horizontalAlignment: Text.AlignHCenter |
|
|
|
verticalAlignment: Text.AlignVCenter |
|
|
|
opacity: model.month === grid.month ? 1 : 0.5 |
|
|
|
text: model.day |
|
|
|
font: grid.font |
|
|
|
//TODO accent text color |
|
|
|
color: isCurrent ? QuickPresenter.accentTextColor(highlightColor, palette.text) : palette.text |
|
|
|
|
|
|
|
background: Rectangle { |
|
|
|
readonly property double size: Math.max(dayDelegate.width, dayDelegate.height) * 1.2 |
|
|
@ -130,8 +137,8 @@ ListView { |
|
|
|
height: size |
|
|
|
width: size |
|
|
|
|
|
|
|
color: Material.accentColor //TODO highlight color from globally |
|
|
|
opacity: model.day === _calenderList.currentDate.getDate() && model.month === _calenderList.currentDate.getMonth() ? 1 : 0 |
|
|
|
color: dayDelegate.highlightColor |
|
|
|
opacity: dayDelegate.isCurrent ? 1 : 0 |
|
|
|
radius: size / 2 |
|
|
|
|
|
|
|
Behavior on opacity { |
|
|
|
|
|
@ -1,25 +1,18 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Controls.Universal 2.3 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.1 |
|
|
|
|
|
|
|
Label { |
|
|
|
id: _decorLabel |
|
|
|
|
|
|
|
ColorHelper { |
|
|
|
id: helper |
|
|
|
} |
|
|
|
|
|
|
|
property Item edit: _decorLabel.nextItemInFocusChain() |
|
|
|
|
|
|
|
readonly property bool editHasFocus: edit && edit.focus |
|
|
|
|
|
|
|
function highlightColor() { |
|
|
|
if(QuickPresenter.currentStyle === "Material") |
|
|
|
return Material.accentColor; |
|
|
|
else if(QuickPresenter.currentStyle === "Universal") |
|
|
|
return Universal.accent; |
|
|
|
else |
|
|
|
return palette.highlight; |
|
|
|
} |
|
|
|
|
|
|
|
color: editHasFocus ? highlightColor() : palette.text |
|
|
|
color: editHasFocus ? helper.highlight : helper.text |
|
|
|
opacity: editHasFocus ? 1 : 0.5 |
|
|
|
} |
|
|
|
|
|
@ -1,8 +1,6 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Controls.Universal 2.3 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.0 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.1 |
|
|
|
|
|
|
|
Label { |
|
|
|
property string title |
|
|
@ -14,6 +12,10 @@ Label { |
|
|
|
bottomPadding: 4 |
|
|
|
text: title + qsTr(":") |
|
|
|
|
|
|
|
ColorHelper { |
|
|
|
id: helper |
|
|
|
} |
|
|
|
|
|
|
|
background: Rectangle { |
|
|
|
anchors.fill: parent |
|
|
|
color: "transparent" |
|
|
@ -23,14 +25,7 @@ Label { |
|
|
|
anchors.bottom: parent.bottom |
|
|
|
anchors.right: parent.right |
|
|
|
height: 2 |
|
|
|
color: { |
|
|
|
if(QuickPresenter.currentStyle === "Material") |
|
|
|
return Material.accent; |
|
|
|
else if(QuickPresenter.currentStyle === "Universal") |
|
|
|
return Universal.accent; |
|
|
|
else |
|
|
|
return "black"; |
|
|
|
} |
|
|
|
color: helper.highlight |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -1,6 +1,5 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Layouts 1.3 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.1 |
|
|
|
|
|
|
|
|
|
@ -1,6 +1,5 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Layouts 1.3 |
|
|
|
import de.skycoder42.QtMvvm.Core 1.0 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.0 |
|
|
|
|
|
@ -1,6 +1,5 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Layouts 1.3 |
|
|
|
import de.skycoder42.QtMvvm.Core 1.1 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.1 |
|
|
|
|
|
@ -5,13 +5,8 @@ import de.skycoder42.QtMvvm.Quick 1.1 |
|
|
|
Tumbler { |
|
|
|
id: _timeTumbler |
|
|
|
|
|
|
|
function highlightColor() { |
|
|
|
if(QuickPresenter.currentStyle === "Material") |
|
|
|
return Material.accentColor; |
|
|
|
else if(QuickPresenter.currentStyle === "Universal") |
|
|
|
return Universal.accent; |
|
|
|
else |
|
|
|
return palette.highlight; |
|
|
|
ColorHelper { |
|
|
|
id: helper |
|
|
|
} |
|
|
|
|
|
|
|
Rectangle { |
|
|
@ -19,7 +14,7 @@ Tumbler { |
|
|
|
anchors.verticalCenterOffset: -0.5 * currentItem.height |
|
|
|
width: currentItem.width * 0.8 |
|
|
|
height: 1 |
|
|
|
color: parent.enabled ? highlightColor() : palette.text |
|
|
|
color: parent.enabled ? helper.highlight : helper.text |
|
|
|
} |
|
|
|
|
|
|
|
Rectangle { |
|
|
@ -27,6 +22,6 @@ Tumbler { |
|
|
|
anchors.verticalCenterOffset: 0.5 * currentItem.height |
|
|
|
width: currentItem.width * 0.8 |
|
|
|
height: 1 |
|
|
|
color: parent.enabled ? highlightColor() : palette.text |
|
|
|
color: parent.enabled ? helper.highlight : helper.text |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -1,8 +1,7 @@ |
|
|
|
import QtQuick 2.10 |
|
|
|
import QtQuick.Controls.Material 2.3 |
|
|
|
import QtQuick.Controls.Universal 2.3 |
|
|
|
import QtQuick.Controls 2.3 |
|
|
|
import QtGraphicalEffects 1.0 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.0 |
|
|
|
import de.skycoder42.QtMvvm.Quick 1.1 |
|
|
|
|
|
|
|
Item { |
|
|
|
id: _tintIcon |
|
|
@ -23,17 +22,14 @@ Item { |
|
|
|
visible: false |
|
|
|
} |
|
|
|
|
|
|
|
ColorHelper { |
|
|
|
id: helper |
|
|
|
} |
|
|
|
|
|
|
|
ColorOverlay { |
|
|
|
id: _overlay |
|
|
|
anchors.fill: _image |
|
|
|
source: _image |
|
|
|
color: { |
|
|
|
if(QuickPresenter.currentStyle === "Material") |
|
|
|
return Material.foreground; |
|
|
|
else if(QuickPresenter.currentStyle === "Universal") |
|
|
|
return Universal.foreground; |
|
|
|
else |
|
|
|
return "black"; |
|
|
|
} |
|
|
|
color: helper.text |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -37,6 +37,7 @@ QML_FILES += \ |
|
|
|
TintIcon.qml \ |
|
|
|
AlertDialog.qml \ |
|
|
|
ContrastToolBar.qml \ |
|
|
|
ContrastToolBar11.qml \ |
|
|
|
ToolBarLabel.qml \ |
|
|
|
ActionButton.qml \ |
|
|
|
RoundActionButton.qml \ |
|
|
@ -56,7 +57,8 @@ QML_FILES += \ |
|
|
|
MsgDelegate.qml \ |
|
|
|
TimeTumbler.qml \ |
|
|
|
TimeEdit.qml \ |
|
|
|
DateEdit.qml |
|
|
|
DateEdit.qml \ |
|
|
|
ColorHelper.qml |
|
|
|
|
|
|
|
RESOURCES += \ |
|
|
|
qtmvvmquick_plugin.qrc |
|
|
|
|
|
@ -116,6 +116,13 @@ Module { |
|
|
|
type: "QStringList" |
|
|
|
Parameter { name: "mimeTypes"; type: "QStringList" } |
|
|
|
} |
|
|
|
Method { |
|
|
|
name: "accentTextColor" |
|
|
|
revision: 1 |
|
|
|
type: "QColor" |
|
|
|
Parameter { name: "accentColor"; type: "QColor" } |
|
|
|
Parameter { name: "baseColor"; type: "QColor" } |
|
|
|
} |
|
|
|
} |
|
|
|
Component { |
|
|
|
name: "QtMvvm::QQmlViewPlaceholder" |
|
|
|
|
|
@ -18,8 +18,11 @@ internal OverviewListView OverviewListView.qml |
|
|
|
|
|
|
|
internal TimeTumbler TimeTumbler.qml |
|
|
|
|
|
|
|
ColorHelper 1.1 ColorHelper.qml |
|
|
|
|
|
|
|
AlertDialog 1.0 AlertDialog.qml |
|
|
|
ContrastToolBar 1.0 ContrastToolBar.qml |
|
|
|
ContrastToolBar 1.1 ContrastToolBar11.qml |
|
|
|
ToolBarLabel 1.0 ToolBarLabel.qml |
|
|
|
ActionButton 1.0 ActionButton.qml |
|
|
|
RoundActionButton 1.0 RoundActionButton.qml |
|
|
|
|
|
@ -57,6 +57,20 @@ QStringList QQmlQuickPresenter::mimeTypeFilters(const QStringList &mimeTypes) co |
|
|
|
return filters; |
|
|
|
} |
|
|
|
|
|
|
|
QColor QQmlQuickPresenter::accentTextColor(const QColor &accentColor, const QColor &baseColor) const |
|
|
|
{ |
|
|
|
auto a = (0.299 * accentColor.redF() + 0.587 * accentColor.greenF() + 0.144 * accentColor.blueF()); |
|
|
|
if(baseColor.isValid()) { |
|
|
|
auto b = (0.299 * baseColor.redF() + 0.587 * baseColor.greenF() + 0.144 * baseColor.blueF()); |
|
|
|
if (std::abs(a - b) >= 0.5) |
|
|
|
return baseColor; |
|
|
|
} |
|
|
|
if(a < 0.5) |
|
|
|
return Qt::white; |
|
|
|
else |
|
|
|
return Qt::black; |
|
|
|
} |
|
|
|
|
|
|
|
void QQmlQuickPresenter::toggleDrawer() |
|
|
|
{ |
|
|
|
if(!_qmlPresenter) { |
|
|
|
|
|
@ -11,6 +11,8 @@ |
|
|
|
#include <QtCore/QQueue> |
|
|
|
#include <QtCore/QSharedPointer> |
|
|
|
|
|
|
|
#include <QtGui/QColor> |
|
|
|
|
|
|
|
#include <QtQml/QQmlComponent> |
|
|
|
|
|
|
|
#include <QtMvvmCore/ViewModel> |
|
|
@ -127,6 +129,20 @@ public: |
|
|
|
//! Converts a list of mimetypes into a list of extension filters, for a file dialog
|
|
|
|
Q_INVOKABLE static QStringList mimeTypeFilters(const QStringList &mimeTypes) const; |
|
|
|
|
|
|
|
/*! @brief Calculates the optimal text color based on the background color
|
|
|
|
* |
|
|
|
* @param accentColor The color to find a contrasting text color for |
|
|
|
* @param baseColor The current default text color |
|
|
|
* @return A color for text that is easy to read when used with accentColor as |
|
|
|
* the background |
|
|
|
* |
|
|
|
* The method calculates whether the color should be light or dark and then either returns |
|
|
|
* white or black, depending on which color fits better. If baseColor is specified, then |
|
|
|
* the color value is checked, too. If baseColor is easily readable, it is simply returned |
|
|
|
* as result. Otherwise the method proceeds as usual. |
|
|
|
*/ |
|
|
|
Q_REVISION(1) Q_INVOKABLE static QColor accentTextColor(const QColor &accentColor, const QColor &baseColor) const; |
|
|
|
|
|
|
|
#ifdef DOXYGEN_RUN |
|
|
|
public: |
|
|
|
#else |
|
|
|