mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-01 07:05:48 +00:00
fix: brightness update, update main view slider
Log:
This commit is contained in:
parent
d1b37b045a
commit
bdb0dc3b86
@ -74,7 +74,9 @@ void BrightnessModel::onPropertyChanged(const QDBusMessage &msg)
|
||||
return;
|
||||
|
||||
QVariantMap changedProps = qdbus_cast<QVariantMap>(arguments.at(1).value<QDBusArgument>());
|
||||
if (changedProps.contains("Primary")) {
|
||||
if (changedProps.contains("Brightness")) {
|
||||
Q_EMIT monitorLightChanged();
|
||||
} else if (changedProps.contains("Primary")) {
|
||||
m_primaryScreenName = changedProps.value("Primary").toString();
|
||||
BrightMonitor *defaultMonitor = nullptr;
|
||||
for (BrightMonitor *monitor : m_monitor) {
|
||||
|
@ -27,6 +27,7 @@ public:
|
||||
Q_SIGNALS:
|
||||
void primaryChanged(BrightMonitor *);
|
||||
void screenVisibleChanged(bool);
|
||||
void monitorLightChanged();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void primaryScreenChanged(QScreen *screen);
|
||||
|
@ -69,6 +69,7 @@ void BrightnessWidget::initConnection()
|
||||
});
|
||||
|
||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &BrightnessWidget::onThemeTypeChanged);
|
||||
connect(m_model, &BrightnessModel::monitorLightChanged, this, &BrightnessWidget::updateSliderValue);
|
||||
updateSliderValue();
|
||||
}
|
||||
|
||||
|
@ -31,10 +31,10 @@ protected:
|
||||
private:
|
||||
void initUi();
|
||||
void initConnection();
|
||||
void updateSliderValue();
|
||||
void convertThemePixmap(QPixmap &pixmap);
|
||||
|
||||
private Q_SLOTS:
|
||||
void updateSliderValue();
|
||||
void onThemeTypeChanged();
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user