小插件接口参数类型改了,需要重新适配。
This commit is contained in:
parent
d00912d546
commit
713924b808
|
@ -25,12 +25,20 @@ AppWidget {
|
|||
}
|
||||
|
||||
function updateSearchBarColor() {
|
||||
var data = window.parseJson(window.datevalue);
|
||||
// for (var i in window.datavalue) {
|
||||
// if (i === "colorData") {
|
||||
// var data = window.parseJson(window.datavalue[i]);
|
||||
// searchBar.color = Qt.rgba(data.red, data.green, data.blue, data.alpha);
|
||||
// placeholderText.color = data.placeHolderTextColor;
|
||||
// }
|
||||
// }
|
||||
|
||||
var data = window.parseJson(window.datavalue["colorData"]);
|
||||
searchBar.color = Qt.rgba(data.red, data.green, data.blue, data.alpha);
|
||||
placeholderText.color = data.placeHolderTextColor;
|
||||
}
|
||||
|
||||
onDatevalueChanged: updateSearchBarColor();
|
||||
onDatavalueChanged: updateSearchBarColor();
|
||||
|
||||
Rectangle {
|
||||
id:searchBar
|
||||
|
@ -39,10 +47,6 @@ AppWidget {
|
|||
height: 64
|
||||
radius: searchBar.height / 2
|
||||
|
||||
Component.onCompleted: {
|
||||
window.updateSearchBarColor();
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: layout
|
||||
anchors.fill: parent
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <QApplication>
|
||||
#include <QVariantMap>
|
||||
|
||||
#define CONTROL_CENTER_PERSONALISE_GSETTINGS_ID "org.ukui.control-center.personalise"
|
||||
#define TRANSPARENCY_KEY "transparency"
|
||||
|
@ -70,12 +71,12 @@ void AppWidgetPlugin::appWidgetUpdate()
|
|||
obj.insert("alpha", QJsonValue(GlobalSettings::getInstance()->getValue(TRANSPARENCY_KEY).toDouble()));
|
||||
QString jsonData = QString(QJsonDocument(obj).toJson());
|
||||
|
||||
QDBusVariant variant;
|
||||
variant.setVariant(jsonData);
|
||||
QVariantMap dataMap;
|
||||
dataMap.insert("colorData", QVariant(jsonData));
|
||||
|
||||
// variant.setVariant(QGuiApplication::palette().color(QPalette::Window).name(QColor::HexArgb));
|
||||
if(m_manager) {
|
||||
m_manager->updateAppWidget("search", variant);
|
||||
m_manager->updateAppWidget("search", dataMap);
|
||||
qDebug() <<"==========update style and transparency successful.";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue