Changeset View
Changeset View
Standalone View
Standalone View
shell/panelconfigview.cpp
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 58 | [=]() { | |||
---|---|---|---|---|---|
62 | syncGeometry(); | 62 | syncGeometry(); | ||
63 | syncLocation(); | 63 | syncLocation(); | ||
64 | }); | 64 | }); | ||
65 | 65 | | |||
66 | KWindowSystem::setType(winId(), NET::Dock); | 66 | KWindowSystem::setType(winId(), NET::Dock); | ||
67 | KWindowSystem::setState(winId(), NET::KeepAbove); | 67 | KWindowSystem::setState(winId(), NET::KeepAbove); | ||
68 | KWindowSystem::forceActiveWindow(winId()); | 68 | KWindowSystem::forceActiveWindow(winId()); | ||
69 | 69 | | |||
70 | KWindowEffects::enableBlurBehind(winId(), true); | 70 | updateBlurBehindAndContrast(); | ||
71 | updateContrast(); | 71 | connect(&m_theme, &Plasma::Theme::themeChanged, this, &PanelConfigView::updateBlurBehindAndContrast); | ||
72 | connect(&m_theme, &Plasma::Theme::themeChanged, this, &PanelConfigView::updateContrast); | | |||
73 | 72 | | |||
74 | rootContext()->setContextProperty(QStringLiteral("panel"), panelView); | 73 | rootContext()->setContextProperty(QStringLiteral("panel"), panelView); | ||
75 | rootContext()->setContextProperty(QStringLiteral("configDialog"), this); | 74 | rootContext()->setContextProperty(QStringLiteral("configDialog"), this); | ||
76 | connect(containment, &Plasma::Containment::formFactorChanged, this, &PanelConfigView::syncGeometry); | 75 | connect(containment, &Plasma::Containment::formFactorChanged, this, &PanelConfigView::syncGeometry); | ||
77 | connect(containment, &Plasma::Containment::locationChanged, this, &PanelConfigView::syncLocation); | 76 | connect(containment, &Plasma::Containment::locationChanged, this, &PanelConfigView::syncLocation); | ||
78 | } | 77 | } | ||
79 | 78 | | |||
80 | PanelConfigView::~PanelConfigView() | 79 | PanelConfigView::~PanelConfigView() | ||
81 | { | 80 | { | ||
82 | } | 81 | } | ||
83 | 82 | | |||
84 | void PanelConfigView::init() | 83 | void PanelConfigView::init() | ||
85 | { | 84 | { | ||
86 | setSource(m_containment->corona()->kPackage().fileUrl("panelconfigurationui")); | 85 | setSource(m_containment->corona()->kPackage().fileUrl("panelconfigurationui")); | ||
87 | syncGeometry(); | 86 | syncGeometry(); | ||
88 | syncLocation(); | 87 | syncLocation(); | ||
89 | } | 88 | } | ||
90 | 89 | | |||
91 | void PanelConfigView::updateContrast() | 90 | void PanelConfigView::updateBlurBehindAndContrast() | ||
92 | { | 91 | { | ||
92 | KWindowEffects::enableBlurBehind(winId(), m_theme.blurBehindEnabled()); | ||||
93 | KWindowEffects::enableBackgroundContrast(winId(), m_theme.backgroundContrastEnabled(), | 93 | KWindowEffects::enableBackgroundContrast(winId(), m_theme.backgroundContrastEnabled(), | ||
94 | m_theme.backgroundContrast(), | 94 | m_theme.backgroundContrast(), | ||
95 | m_theme.backgroundIntensity(), | 95 | m_theme.backgroundIntensity(), | ||
96 | m_theme.backgroundSaturation()); | 96 | m_theme.backgroundSaturation()); | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | void PanelConfigView::showAddWidgetDialog() | 99 | void PanelConfigView::showAddWidgetDialog() | ||
100 | { | 100 | { | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | |||||
185 | void PanelConfigView::showEvent(QShowEvent *ev) | 185 | void PanelConfigView::showEvent(QShowEvent *ev) | ||
186 | { | 186 | { | ||
187 | QQuickWindow::showEvent(ev); | 187 | QQuickWindow::showEvent(ev); | ||
188 | 188 | | |||
189 | KWindowSystem::setType(winId(), NET::Dock); | 189 | KWindowSystem::setType(winId(), NET::Dock); | ||
190 | setFlags(Qt::WindowFlags((flags() | Qt::FramelessWindowHint) & (~Qt::WindowDoesNotAcceptFocus))); | 190 | setFlags(Qt::WindowFlags((flags() | Qt::FramelessWindowHint) & (~Qt::WindowDoesNotAcceptFocus))); | ||
191 | KWindowSystem::setState(winId(), NET::KeepAbove); | 191 | KWindowSystem::setState(winId(), NET::KeepAbove); | ||
192 | KWindowSystem::forceActiveWindow(winId()); | 192 | KWindowSystem::forceActiveWindow(winId()); | ||
193 | KWindowEffects::enableBlurBehind(winId(), true); | 193 | updateBlurBehindAndContrast(); | ||
194 | updateContrast(); | | |||
195 | syncGeometry(); | 194 | syncGeometry(); | ||
196 | syncLocation(); | 195 | syncLocation(); | ||
197 | 196 | | |||
198 | //this because due to Qt xcb implementation the actual flags gets set only after a while after the window is actually visible | 197 | //this because due to Qt xcb implementation the actual flags gets set only after a while after the window is actually visible | ||
199 | m_screenSyncTimer.start(); | 198 | m_screenSyncTimer.start(); | ||
200 | 199 | | |||
201 | if (m_containment) { | 200 | if (m_containment) { | ||
202 | m_containment->setUserConfiguring(true); | 201 | m_containment->setUserConfiguring(true); | ||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |