use the new backgroundcontrast effect
This commit is contained in:
parent
188e421956
commit
e0676f7501
@ -354,6 +354,11 @@ void DialogProxy::syncMainItemToSize()
|
|||||||
m_frameSvgItem->setWidth(width());
|
m_frameSvgItem->setWidth(width());
|
||||||
m_frameSvgItem->setHeight(height());
|
m_frameSvgItem->setHeight(height());
|
||||||
KWindowEffects::enableBlurBehind(winId(), true, m_frameSvgItem->frameSvg()->mask());
|
KWindowEffects::enableBlurBehind(winId(), true, m_frameSvgItem->frameSvg()->mask());
|
||||||
|
if (qGray(m_theme.color(Plasma::Theme::BackgroundColor).rgb()) > 127) {
|
||||||
|
KWindowEffects::enableBackgroundContrast(winId(), true, 0.30, 1.9, 1.7, m_frameSvgItem->frameSvg()->mask());
|
||||||
|
} else {
|
||||||
|
KWindowEffects::enableBackgroundContrast(winId(), true, 0.45, 0.45, 1.7, m_frameSvgItem->frameSvg()->mask());
|
||||||
|
}
|
||||||
|
|
||||||
if (m_mainItem) {
|
if (m_mainItem) {
|
||||||
m_mainItem.data()->setX(m_frameSvgItem->margins()->left());
|
m_mainItem.data()->setX(m_frameSvgItem->margins()->left());
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
|
|
||||||
#include <Plasma/Plasma>
|
#include <Plasma/Plasma>
|
||||||
|
#include <Plasma/Theme>
|
||||||
|
|
||||||
#include <netwm_def.h>
|
#include <netwm_def.h>
|
||||||
|
|
||||||
@ -175,6 +176,7 @@ private:
|
|||||||
WindowType m_type;
|
WindowType m_type;
|
||||||
bool m_hideOnWindowDeactivate;
|
bool m_hideOnWindowDeactivate;
|
||||||
bool m_outputOnly;
|
bool m_outputOnly;
|
||||||
|
Plasma::Theme m_theme;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -46,6 +46,11 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa
|
|||||||
setFlags(Qt::FramelessWindowHint);
|
setFlags(Qt::FramelessWindowHint);
|
||||||
|
|
||||||
KWindowEffects::enableBlurBehind(winId(), true);
|
KWindowEffects::enableBlurBehind(winId(), true);
|
||||||
|
if (qGray(m_theme.color(Plasma::Theme::BackgroundColor).rgb()) > 127) {
|
||||||
|
KWindowEffects::enableBackgroundContrast(winId(), true, 0.30, 1.9, 1.7);
|
||||||
|
} else {
|
||||||
|
KWindowEffects::enableBackgroundContrast(winId(), true, 0.45, 0.45, 1.7);
|
||||||
|
}
|
||||||
|
|
||||||
engine()->rootContext()->setContextProperty("panel", panelView);
|
engine()->rootContext()->setContextProperty("panel", panelView);
|
||||||
engine()->rootContext()->setContextProperty("configDialog", this);
|
engine()->rootContext()->setContextProperty("configDialog", this);
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <QJSValue>
|
#include <QJSValue>
|
||||||
#include <QQmlListProperty>
|
#include <QQmlListProperty>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
#include <Plasma/Theme>
|
||||||
|
|
||||||
class AppletInterface;
|
class AppletInterface;
|
||||||
class ConfigPropertyMap;
|
class ConfigPropertyMap;
|
||||||
@ -55,6 +56,7 @@ protected Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
Plasma::Containment *m_containment;
|
Plasma::Containment *m_containment;
|
||||||
PanelView *m_panelView;
|
PanelView *m_panelView;
|
||||||
|
Plasma::Theme m_theme;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // multiple inclusion guard
|
#endif // multiple inclusion guard
|
||||||
|
@ -57,6 +57,11 @@ PanelView::PanelView(ShellCorona *corona, QWindow *parent)
|
|||||||
|
|
||||||
//TODO: how to take the shape from the framesvg?
|
//TODO: how to take the shape from the framesvg?
|
||||||
KWindowEffects::enableBlurBehind(winId(), true);
|
KWindowEffects::enableBlurBehind(winId(), true);
|
||||||
|
if (qGray(m_theme.color(Plasma::Theme::BackgroundColor).rgb()) > 127) {
|
||||||
|
KWindowEffects::enableBackgroundContrast(winId(), true, 0.30, 1.9, 1.7);
|
||||||
|
} else {
|
||||||
|
KWindowEffects::enableBackgroundContrast(winId(), true, 0.45, 0.45, 1.7);
|
||||||
|
}
|
||||||
|
|
||||||
//Screen management
|
//Screen management
|
||||||
connect(this, &QWindow::screenChanged,
|
connect(this, &QWindow::screenChanged,
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <plasmaquickview.h>
|
#include <plasmaquickview.h>
|
||||||
#include "panelconfigview.h"
|
#include "panelconfigview.h"
|
||||||
#include <QtCore/qpointer.h>
|
#include <QtCore/qpointer.h>
|
||||||
|
#include <Plasma/Theme>
|
||||||
|
|
||||||
class ShellCorona;
|
class ShellCorona;
|
||||||
|
|
||||||
@ -108,6 +109,7 @@ private:
|
|||||||
ShellCorona *m_corona;
|
ShellCorona *m_corona;
|
||||||
QTimer *m_strutsTimer;
|
QTimer *m_strutsTimer;
|
||||||
VisibilityMode m_visibilityMode;
|
VisibilityMode m_visibilityMode;
|
||||||
|
Plasma::Theme m_theme;
|
||||||
|
|
||||||
static const int STRUTSTIMERDELAY = 200;
|
static const int STRUTSTIMERDELAY = 200;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user