mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-28 18:50:40 +03:00
support dialogs/background for dock settings wins
--use a different shadows manager for dialogs such as dock settings window through the Latte::Corona class. The new shadow manager is responsible to draw "dialogs/background" shadows for windows instead of the PanelShadows original class which is responsible to draw "widgets/background" shadows
This commit is contained in:
parent
9ee75ee7ee
commit
77866ebfe6
@ -96,7 +96,8 @@ Corona::Corona(bool defaultLayoutOnStartup, QString layoutNameOnStartUp, int use
|
||||
m_globalShortcuts(new GlobalShortcuts(this)),
|
||||
m_plasmaScreenPool(new PlasmaExtended::ScreenPool(this)),
|
||||
m_themeExtended(new PlasmaExtended::Theme(KSharedConfig::openConfig(), this)),
|
||||
m_layoutsManager(new Layouts::Manager(this))
|
||||
m_layoutsManager(new Layouts::Manager(this)),
|
||||
m_dialogShadows(new PanelShadows(this, QStringLiteral("dialogs/background")))
|
||||
{
|
||||
//! create the window manager
|
||||
|
||||
@ -184,6 +185,7 @@ Corona::~Corona()
|
||||
m_layoutsManager->unload();
|
||||
|
||||
m_wm->deleteLater();
|
||||
m_dialogShadows->deleteLater();
|
||||
m_globalShortcuts->deleteLater();
|
||||
m_layoutsManager->deleteLater();
|
||||
m_screenPool->deleteLater();
|
||||
@ -403,6 +405,11 @@ KActivities::Consumer *Corona::activitiesConsumer() const
|
||||
return m_activityConsumer;
|
||||
}
|
||||
|
||||
PanelShadows *Corona::dialogShadows() const
|
||||
{
|
||||
return m_dialogShadows;
|
||||
}
|
||||
|
||||
GlobalShortcuts *Corona::globalShortcuts() const
|
||||
{
|
||||
return m_globalShortcuts;
|
||||
|
@ -24,6 +24,7 @@
|
||||
// local
|
||||
#include "plasma/quick/configview.h"
|
||||
#include "layout/storage.h"
|
||||
#include "view/panelshadows_p.h"
|
||||
#include "../liblatte2/types.h"
|
||||
|
||||
// Qt
|
||||
@ -137,6 +138,8 @@ public:
|
||||
|
||||
WindowSystem::AbstractWindowInterface *wm() const;
|
||||
|
||||
PanelShadows *dialogShadows() const;
|
||||
|
||||
//! these functions are used from context menu through containmentactions
|
||||
void switchToLayout(QString layout);
|
||||
void showSettingsWindow(int page);
|
||||
@ -219,6 +222,8 @@ private:
|
||||
|
||||
WindowSystem::AbstractWindowInterface *m_wm{nullptr};
|
||||
|
||||
PanelShadows *m_dialogShadows{nullptr};
|
||||
|
||||
KWayland::Client::PlasmaShell *m_waylandCorona{nullptr};
|
||||
|
||||
friend class GlobalShortcuts;
|
||||
|
@ -130,6 +130,8 @@ PrimaryConfigView::~PrimaryConfigView()
|
||||
{
|
||||
qDebug() << "ConfigView deleting ...";
|
||||
|
||||
m_corona->dialogShadows()->removeWindow(this);
|
||||
|
||||
m_corona->wm()->unregisterIgnoredWindow(KWindowSystem::isPlatformX11() ? winId() : m_waylandWindowId);
|
||||
|
||||
deleteSecondaryWindow();
|
||||
@ -149,7 +151,7 @@ void PrimaryConfigView::init()
|
||||
|
||||
setDefaultAlphaBuffer(true);
|
||||
setColor(Qt::transparent);
|
||||
PanelShadows::self()->addWindow(this);
|
||||
m_corona->dialogShadows()->addWindow(this);
|
||||
rootContext()->setContextProperty(QStringLiteral("latteView"), m_latteView);
|
||||
rootContext()->setContextProperty(QStringLiteral("shortcutsEngine"), m_corona->globalShortcuts()->shortcutsTracker());
|
||||
rootContext()->setContextProperty(QStringLiteral("viewConfig"), this);
|
||||
@ -692,7 +694,7 @@ void PrimaryConfigView::updateEnabledBorders()
|
||||
if (m_enabledBorders != borders) {
|
||||
m_enabledBorders = borders;
|
||||
|
||||
PanelShadows::self()->addWindow(this, m_enabledBorders);
|
||||
m_corona->dialogShadows()->addWindow(this, m_enabledBorders);
|
||||
|
||||
emit enabledBordersChanged();
|
||||
}
|
||||
|
@ -112,6 +112,8 @@ SecondaryConfigView::~SecondaryConfigView()
|
||||
{
|
||||
qDebug() << "SecDockConfigView deleting ...";
|
||||
|
||||
m_corona->dialogShadows()->removeWindow(this);
|
||||
|
||||
m_corona->wm()->unregisterIgnoredWindow(KWindowSystem::isPlatformX11() ? winId() : m_waylandWindowId);
|
||||
|
||||
for (const auto &var : connections) {
|
||||
@ -125,7 +127,7 @@ void SecondaryConfigView::init()
|
||||
|
||||
setDefaultAlphaBuffer(true);
|
||||
setColor(Qt::transparent);
|
||||
PanelShadows::self()->addWindow(this);
|
||||
m_corona->dialogShadows()->addWindow(this);
|
||||
rootContext()->setContextProperty(QStringLiteral("latteView"), m_latteView);
|
||||
rootContext()->setContextProperty(QStringLiteral("viewConfig"), this);
|
||||
rootContext()->setContextProperty(QStringLiteral("plasmoid"), m_latteView->containment()->property("_plasma_graphicObject").value<QObject *>());
|
||||
@ -438,7 +440,7 @@ void SecondaryConfigView::updateEnabledBorders()
|
||||
if (m_enabledBorders != borders) {
|
||||
m_enabledBorders = borders;
|
||||
|
||||
PanelShadows::self()->addWindow(this, m_enabledBorders);
|
||||
m_corona->dialogShadows()->addWindow(this, m_enabledBorders);
|
||||
|
||||
emit enabledBordersChanged();
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ FocusScope {
|
||||
|
||||
PlasmaCore.FrameSvgItem{
|
||||
anchors.fill: parent
|
||||
imagePath: "widgets/panel-background"
|
||||
imagePath: "dialogs/background"
|
||||
enabledBorders: viewConfig.enabledBorders
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ FocusScope {
|
||||
|
||||
PlasmaCore.FrameSvgItem{
|
||||
anchors.fill: parent
|
||||
imagePath: "widgets/panel-background"
|
||||
imagePath: "dialogs/background"
|
||||
enabledBorders: viewConfig.enabledBorders
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user