mirror of
https://github.com/KDE/latte-dock.git
synced 2025-08-29 17:49:28 +03:00
support multiple active layouts in layoutmanager
This commit is contained in:
@ -390,8 +390,8 @@ void DockConfigView::updateLaunchersForGroup(int groupInt)
|
||||
|
||||
//! when the layout/global launchers list is empty then the current dock launchers are used for them
|
||||
//! as a start point
|
||||
if (dockCorona && dockCorona->layoutManager() && dockCorona->layoutManager()->currentLayout()) {
|
||||
if ((group == Dock::LayoutLaunchers && dockCorona->layoutManager()->currentLayout()->launchers().isEmpty())
|
||||
if (dockCorona && m_dockView->managedLayout()) {
|
||||
if ((group == Dock::LayoutLaunchers && m_dockView->managedLayout()->launchers().isEmpty())
|
||||
|| (group == Dock::GlobalLaunchers && dockCorona->universalSettings()->launchers().isEmpty())) {
|
||||
|
||||
Plasma::Containment *c = m_dockView->containment();
|
||||
@ -428,7 +428,7 @@ void DockConfigView::updateLaunchersForGroup(int groupInt)
|
||||
|
||||
if (method.invoke(item, Q_RETURN_ARG(QVariant, launchers))) {
|
||||
if (group == Dock::LayoutLaunchers) {
|
||||
dockCorona->layoutManager()->currentLayout()->setLaunchers(launchers.toStringList());
|
||||
m_dockView->managedLayout()->setLaunchers(launchers.toStringList());
|
||||
} else if (group == Dock::GlobalLaunchers) {
|
||||
dockCorona->universalSettings()->setLaunchers(launchers.toStringList());
|
||||
}
|
||||
|
@ -203,9 +203,9 @@ void DockCorona::loadLatteLayout(QString layoutPath)
|
||||
//! and it forcefully becomes primary dock
|
||||
if (!m_tasksWillBeLoaded && m_firstContainmentWithTasks == containment->id()) {
|
||||
m_tasksWillBeLoaded = true; //this protects by loading more than one dock at startup
|
||||
m_layoutManager->currentLayout()->addDock(containment, true);
|
||||
m_layoutManager->addDock(containment, true);
|
||||
} else {
|
||||
m_layoutManager->currentLayout()->addDock(containment);
|
||||
m_layoutManager->addDock(containment);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -373,11 +373,11 @@ QRegion DockCorona::availableScreenRegion(int id) const
|
||||
if (!screen)
|
||||
return QRegion();
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
QRegion available(screen->geometry());
|
||||
|
||||
for (const auto *view : *dockViewsSet) {
|
||||
for (const auto *view : *views) {
|
||||
if (view && view->containment() && view->screen() == screen
|
||||
&& view->visibility() && (view->visibility()->mode() != Latte::Dock::AutoHide)) {
|
||||
int realThickness = view->normalThickness() - view->shadow();
|
||||
@ -498,9 +498,9 @@ QRect DockCorona::availableScreenRectWithCriteria(int id, QList<Dock::Visibility
|
||||
|
||||
auto available = screen->geometry();
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
for (const auto *view : *dockViewsSet) {
|
||||
for (const auto *view : *views) {
|
||||
if (view && view->containment() && view->screen() == screen
|
||||
&& ((allEdges || edges.contains(view->location()))
|
||||
&& (allModes || (view->visibility() && modes.contains(view->visibility()->mode()))))) {
|
||||
@ -544,11 +544,11 @@ QRect DockCorona::availableScreenRectWithCriteria(int id, QList<Dock::Visibility
|
||||
//! tasks plasmoid
|
||||
int DockCorona::noDocksWithTasks() const
|
||||
{
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
int result = 0;
|
||||
|
||||
foreach (auto view, *dockViewsSet) {
|
||||
foreach (auto view, *views) {
|
||||
if (view->tasksPresent()) {
|
||||
result++;
|
||||
}
|
||||
@ -597,7 +597,7 @@ void DockCorona::screenCountChanged()
|
||||
//! concerning screen changed (for multi-screen setups mainly)
|
||||
void DockCorona::syncDockViewsToScreens()
|
||||
{
|
||||
m_layoutManager->currentLayout()->syncDockViewsToScreens();
|
||||
m_layoutManager->syncDockViewsToScreens();
|
||||
}
|
||||
|
||||
int DockCorona::primaryScreenId() const
|
||||
@ -605,19 +605,14 @@ int DockCorona::primaryScreenId() const
|
||||
return m_screenPool->id(qGuiApp->primaryScreen()->name());
|
||||
}
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *DockCorona::dockViews()
|
||||
{
|
||||
return m_layoutManager->currentLayout()->dockViews();
|
||||
}
|
||||
|
||||
int DockCorona::docksCount(int screen) const
|
||||
{
|
||||
QScreen *scr = m_screenPool->screenForId(screen);
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
int docks{0};
|
||||
|
||||
for (const auto &view : *dockViewsSet) {
|
||||
for (const auto &view : *views) {
|
||||
if (view && view->screen() == scr && !view->containment()->destroyed()) {
|
||||
++docks;
|
||||
}
|
||||
@ -631,9 +626,9 @@ int DockCorona::docksCount() const
|
||||
{
|
||||
int docks{0};
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
for (const auto &view : *dockViewsSet) {
|
||||
for (const auto &view : *views) {
|
||||
if (view && view->containment() && !view->containment()->destroyed()) {
|
||||
++docks;
|
||||
}
|
||||
@ -647,9 +642,9 @@ int DockCorona::docksCount(QScreen *screen) const
|
||||
{
|
||||
int docks{0};
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
for (const auto &view : *dockViewsSet) {
|
||||
for (const auto &view : *views) {
|
||||
if (view && view->screen() == screen && !view->containment()->destroyed()) {
|
||||
++docks;
|
||||
}
|
||||
@ -680,9 +675,9 @@ void DockCorona::aboutApplication()
|
||||
|
||||
int DockCorona::noOfDocks()
|
||||
{
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
return dockViewsSet->count();
|
||||
return views->count();
|
||||
}
|
||||
|
||||
QList<Plasma::Types::Location> DockCorona::freeEdges(QScreen *screen) const
|
||||
@ -691,9 +686,9 @@ QList<Plasma::Types::Location> DockCorona::freeEdges(QScreen *screen) const
|
||||
QList<Types::Location> edges{Types::BottomEdge, Types::LeftEdge,
|
||||
Types::TopEdge, Types::RightEdge};
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
for (auto *view : *dockViewsSet) {
|
||||
for (auto *view : *views) {
|
||||
if (view && view->currentScreen() == screen->name()) {
|
||||
edges.removeOne(view->location());
|
||||
}
|
||||
@ -710,9 +705,9 @@ QList<Plasma::Types::Location> DockCorona::freeEdges(int screen) const
|
||||
|
||||
QScreen *scr = m_screenPool->screenForId(screen);
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
for (auto *view : *dockViewsSet) {
|
||||
for (auto *view : *views) {
|
||||
if (view && scr && view->currentScreen() == scr->name()) {
|
||||
edges.removeOne(view->location());
|
||||
}
|
||||
@ -743,10 +738,11 @@ int DockCorona::screenForContainment(const Plasma::Containment *containment) con
|
||||
}
|
||||
}
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
//if the panel views already exist, base upon them
|
||||
DockView *view = dockViewsSet->value(containment);
|
||||
|
||||
DockView *view = views->value(containment);
|
||||
|
||||
if (view && view->screen()) {
|
||||
return m_screenPool->id(view->screen()->name());
|
||||
@ -789,7 +785,7 @@ bool DockCorona::explicitDockOccupyEdge(int screen, Plasma::Types::Location loca
|
||||
|
||||
void DockCorona::recreateDock(Plasma::Containment *containment)
|
||||
{
|
||||
m_layoutManager->currentLayout()->recreateDock(containment);
|
||||
m_layoutManager->recreateDock(containment);
|
||||
}
|
||||
|
||||
void DockCorona::showAlternativesForApplet(Plasma::Applet *applet)
|
||||
@ -800,9 +796,9 @@ void DockCorona::showAlternativesForApplet(Plasma::Applet *applet)
|
||||
return;
|
||||
}
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_layoutManager->currentLayout()->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_layoutManager->currentDockViews();
|
||||
|
||||
DockView *dockView = (*dockViewsSet)[applet->containment()];
|
||||
DockView *dockView = (*views)[applet->containment()];
|
||||
|
||||
KDeclarative::QmlObject *qmlObj{nullptr};
|
||||
|
||||
@ -902,7 +898,7 @@ void DockCorona::loadDefaultLayout()
|
||||
emit containmentAdded(defaultContainment);
|
||||
emit containmentCreated(defaultContainment);
|
||||
|
||||
m_layoutManager->currentLayout()->addDock(defaultContainment);
|
||||
m_layoutManager->addDock(defaultContainment);
|
||||
defaultContainment->createApplet(QStringLiteral("org.kde.latte.plasmoid"));
|
||||
defaultContainment->createApplet(QStringLiteral("org.kde.plasma.analogclock"));
|
||||
}
|
||||
|
@ -89,8 +89,6 @@ public:
|
||||
int noDocksWithTasks() const;
|
||||
int screenForContainment(const Plasma::Containment *containment) const override;
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViews();
|
||||
|
||||
void recreateDock(Plasma::Containment *containment);
|
||||
|
||||
void aboutApplication();
|
||||
|
@ -495,11 +495,7 @@ void DockView::addNewDock()
|
||||
|
||||
void DockView::copyDock()
|
||||
{
|
||||
auto *dockCorona = qobject_cast<DockCorona *>(this->corona());
|
||||
|
||||
if (dockCorona) {
|
||||
dockCorona->layoutManager()->currentLayout()->copyDock(containment());
|
||||
}
|
||||
m_managedLayout->copyDock(containment());
|
||||
}
|
||||
|
||||
void DockView::removeDock()
|
||||
|
@ -256,9 +256,9 @@ void GlobalShortcuts::init()
|
||||
//! Activate launcher menu through dbus interface
|
||||
void GlobalShortcuts::activateLauncherMenu()
|
||||
{
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_corona->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_corona->layoutManager()->currentDockViews();
|
||||
|
||||
for (auto it = dockViewsSet->constBegin(), end = dockViewsSet->constEnd(); it != end; ++it) {
|
||||
for (auto it = views->constBegin(), end = views->constEnd(); it != end; ++it) {
|
||||
const auto applets = it.key()->applets();
|
||||
|
||||
for (auto applet : applets) {
|
||||
@ -333,11 +333,11 @@ void GlobalShortcuts::activateTaskManagerEntry(int index, Qt::Key modifier)
|
||||
return false;
|
||||
};
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_corona->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_corona->layoutManager()->currentDockViews();
|
||||
|
||||
// To avoid overly complex configuration, we'll try to get the 90% usecase to work
|
||||
// which is activating a task on the task manager on a panel on the primary screen.
|
||||
for (auto it = dockViewsSet->constBegin(), end = dockViewsSet->constEnd(); it != end; ++it) {
|
||||
for (auto it = views->constBegin(), end = views->constEnd(); it != end; ++it) {
|
||||
if (it.value()->screen() != qGuiApp->primaryScreen()) {
|
||||
continue;
|
||||
}
|
||||
@ -351,7 +351,7 @@ void GlobalShortcuts::activateTaskManagerEntry(int index, Qt::Key modifier)
|
||||
}
|
||||
|
||||
// we didn't find anything on primary, try all the panels
|
||||
for (auto it = dockViewsSet->constBegin(), end = dockViewsSet->constEnd(); it != end; ++it) {
|
||||
for (auto it = views->constBegin(), end = views->constEnd(); it != end; ++it) {
|
||||
if (activateTaskManagerEntryOnContainment(it.key(), index, modifier)) {
|
||||
m_hideDock = it.value();
|
||||
m_hideDock->visibility()->setBlockHiding(true);
|
||||
@ -407,10 +407,10 @@ void GlobalShortcuts::updateDockItemBadge(QString identifier, QString value)
|
||||
return false;
|
||||
};
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_corona->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_corona->layoutManager()->currentDockViews();
|
||||
|
||||
// update badges in all Latte Tasks plasmoids
|
||||
for (auto it = dockViewsSet->constBegin(), end = dockViewsSet->constEnd(); it != end; ++it) {
|
||||
for (auto it = views->constBegin(), end = views->constEnd(); it != end; ++it) {
|
||||
updateBadgeForTaskInContainment(it.key(), identifier, value);
|
||||
}
|
||||
}
|
||||
@ -462,11 +462,11 @@ void GlobalShortcuts::showDock()
|
||||
return false;
|
||||
};
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_corona->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_corona->layoutManager()->currentDockViews();
|
||||
|
||||
// To avoid overly complex configuration, we'll try to get the 90% usecase to work
|
||||
// which is activating a task on the task manager on a panel on the primary screen.
|
||||
for (auto it = dockViewsSet->constBegin(), end = dockViewsSet->constEnd(); it != end; ++it) {
|
||||
for (auto it = views->constBegin(), end = views->constEnd(); it != end; ++it) {
|
||||
if (it.value()->screen() != qGuiApp->primaryScreen()) {
|
||||
continue;
|
||||
}
|
||||
@ -480,7 +480,7 @@ void GlobalShortcuts::showDock()
|
||||
}
|
||||
|
||||
// we didn't find anything on primary, try all the panels
|
||||
for (auto it = dockViewsSet->constBegin(), end = dockViewsSet->constEnd(); it != end; ++it) {
|
||||
for (auto it = views->constBegin(), end = views->constEnd(); it != end; ++it) {
|
||||
if (containsLattePlasmoid(it.key())) {
|
||||
m_hideDock = it.value();
|
||||
m_hideDock->visibility()->setBlockHiding(true);
|
||||
@ -566,10 +566,10 @@ void GlobalShortcuts::showSettings()
|
||||
{
|
||||
QList<DockView *> docks;
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *dockViewsSet = m_corona->dockViews();
|
||||
QHash<const Plasma::Containment *, DockView *> *views = m_corona->layoutManager()->currentDockViews();
|
||||
|
||||
//! create a docks list to sorted out
|
||||
for (auto it = dockViewsSet->constBegin(), end = dockViewsSet->constEnd(); it != end; ++it) {
|
||||
for (auto it = views->constBegin(), end = views->constEnd(); it != end; ++it) {
|
||||
docks.append(it.value());
|
||||
}
|
||||
|
||||
|
@ -235,7 +235,7 @@ void LayoutConfigDialog::on_removeButton_clicked()
|
||||
|
||||
QString layoutName = m_model->data(m_model->index(row, NAMECOLUMN), Qt::DisplayRole).toString();
|
||||
|
||||
if (layoutName == m_manager->currentLayoutName()) {
|
||||
if (m_manager->activeLayout(layoutName)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -647,7 +647,7 @@ void LayoutConfigDialog::insertLayoutInfoAtRow(int row, QString path, QString co
|
||||
|
||||
QFont font;
|
||||
|
||||
if (name == m_manager->currentLayoutName()) {
|
||||
if (m_manager->activeLayout(name)) {
|
||||
font.setBold(true);
|
||||
} else {
|
||||
font.setBold(false);
|
||||
@ -819,8 +819,9 @@ bool LayoutConfigDialog::saveAllChanges()
|
||||
}
|
||||
|
||||
//qDebug() << i << ". " << id << " - " << color << " - " << name << " - " << menu << " - " << lActivities;
|
||||
Layout *activeLayout = m_manager->activeLayout(name);
|
||||
|
||||
Layout *layout = name == m_manager->currentLayoutName() ? m_manager->currentLayout() : m_layouts[id];
|
||||
Layout *layout = activeLayout ? activeLayout : m_layouts[id];
|
||||
|
||||
if (layout->color() != color) {
|
||||
layout->setColor(color);
|
||||
@ -841,7 +842,7 @@ bool LayoutConfigDialog::saveAllChanges()
|
||||
|
||||
if (layout->name() == m_manager->currentLayoutName()) {
|
||||
switchToLayout = name;
|
||||
m_manager->corona()->unload();
|
||||
//m_manager->corona()->unload();
|
||||
}
|
||||
|
||||
layout = m_layouts.take(id);
|
||||
|
@ -60,8 +60,12 @@ LayoutManager::~LayoutManager()
|
||||
m_importer->deleteLater();
|
||||
m_launchersSignals->deleteLater();
|
||||
|
||||
if (m_currentLayout) {
|
||||
m_currentLayout->deleteLater();
|
||||
while (!m_activeLayouts.isEmpty()) {
|
||||
Layout *layout = m_activeLayouts.at(0);
|
||||
m_activeLayouts.removeFirst();
|
||||
layout->unloadContainments();
|
||||
layout->unloadDockViews();
|
||||
layout->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,11 +115,6 @@ QAction *LayoutManager::addWidgetsAction()
|
||||
return m_addWidgetsAction;
|
||||
}
|
||||
|
||||
Layout *LayoutManager::currentLayout()
|
||||
{
|
||||
return m_currentLayout;
|
||||
}
|
||||
|
||||
LaunchersSignals *LayoutManager::launchersSignals()
|
||||
{
|
||||
return m_launchersSignals;
|
||||
@ -195,6 +194,39 @@ QString LayoutManager::layoutPath(QString layoutName)
|
||||
return path;
|
||||
}
|
||||
|
||||
void LayoutManager::addDock(Plasma::Containment *containment, bool forceLoading, int expDockScreen)
|
||||
{
|
||||
m_activeLayouts.at(0)->addDock(containment, forceLoading, expDockScreen);
|
||||
}
|
||||
|
||||
void LayoutManager::recreateDock(Plasma::Containment *containment)
|
||||
{
|
||||
m_activeLayouts.at(0)->recreateDock(containment);
|
||||
}
|
||||
|
||||
void LayoutManager::syncDockViewsToScreens()
|
||||
{
|
||||
m_activeLayouts.at(0)->syncDockViewsToScreens();
|
||||
}
|
||||
|
||||
QHash<const Plasma::Containment *, DockView *> *LayoutManager::currentDockViews() const
|
||||
{
|
||||
return m_activeLayouts.at(0)->dockViews();
|
||||
}
|
||||
|
||||
Layout *LayoutManager::activeLayout(QString id) const
|
||||
{
|
||||
for (int i = 0; i < m_activeLayouts.size(); ++i) {
|
||||
Layout *layout = m_activeLayouts.at(i);
|
||||
|
||||
if (layout->name() == id) {
|
||||
return layout;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void LayoutManager::currentActivityChanged(const QString &id)
|
||||
{
|
||||
qDebug() << "activity changed :: " << id;
|
||||
@ -312,14 +344,17 @@ bool LayoutManager::switchToLayout(QString layoutName)
|
||||
QTimer::singleShot(250, [this, layoutName, lPath]() {
|
||||
qDebug() << layoutName << " - " << lPath;
|
||||
|
||||
if (m_currentLayout) {
|
||||
m_currentLayout->unloadContainments();
|
||||
m_currentLayout->unloadDockViews();
|
||||
m_currentLayout->deleteLater();
|
||||
while (!m_activeLayouts.isEmpty()) {
|
||||
Layout *layout = m_activeLayouts.at(0);
|
||||
m_activeLayouts.removeFirst();
|
||||
layout->unloadContainments();
|
||||
layout->unloadDockViews();
|
||||
layout->deleteLater();
|
||||
}
|
||||
|
||||
m_currentLayout = new Layout(this, lPath, layoutName);
|
||||
m_currentLayout->initToCorona(m_corona);
|
||||
Layout *newLayout = new Layout(this, lPath, layoutName);
|
||||
m_activeLayouts.append(newLayout);
|
||||
newLayout->initToCorona(m_corona);
|
||||
|
||||
m_corona->loadLatteLayout(lPath);
|
||||
m_corona->universalSettings()->setCurrentLayoutName(layoutName);
|
||||
@ -328,7 +363,7 @@ bool LayoutManager::switchToLayout(QString layoutName)
|
||||
m_corona->universalSettings()->setLastNonAssignedLayoutName(layoutName);
|
||||
}
|
||||
|
||||
emit currentLayoutChanged();
|
||||
emit activeLayoutsChanged();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,6 @@ class LayoutManager : public QObject {
|
||||
|
||||
Q_PROPERTY(QAction *addWidgetsAction READ addWidgetsAction NOTIFY addWidgetsActionChanged)
|
||||
|
||||
Q_PROPERTY(Layout *currentLayout READ currentLayout NOTIFY currentLayoutChanged)
|
||||
Q_PROPERTY(LaunchersSignals *launchersSignals READ launchersSignals NOTIFY launchersSignalsChanged)
|
||||
|
||||
public:
|
||||
@ -62,6 +61,9 @@ public:
|
||||
Importer *importer();
|
||||
|
||||
void load();
|
||||
void addDock(Plasma::Containment *containment, bool forceLoading = false, int expDockScreen = -1);
|
||||
void recreateDock(Plasma::Containment *containment);
|
||||
void syncDockViewsToScreens();
|
||||
|
||||
bool layoutExists(QString layoutName) const;
|
||||
|
||||
@ -76,7 +78,11 @@ public:
|
||||
|
||||
QAction *addWidgetsAction();
|
||||
|
||||
Layout *currentLayout();
|
||||
QHash<const Plasma::Containment *, DockView *> *currentDockViews() const;
|
||||
//! returns an active layout with that #id (name), it returns null if such
|
||||
//! layout cant be found
|
||||
Layout *activeLayout(QString id) const;
|
||||
|
||||
LaunchersSignals *launchersSignals();
|
||||
|
||||
QStringList activities();
|
||||
@ -94,6 +100,7 @@ public slots:
|
||||
Q_INVOKABLE void showLayoutConfigDialog();
|
||||
|
||||
signals:
|
||||
void activeLayoutsChanged();
|
||||
void addWidgetsActionChanged();
|
||||
void currentLayoutChanged();
|
||||
void currentLayoutNameChanged();
|
||||
@ -122,6 +129,7 @@ private:
|
||||
Importer *m_importer{nullptr};
|
||||
|
||||
Layout *m_currentLayout{nullptr};
|
||||
QList<Layout *> m_activeLayouts;
|
||||
LaunchersSignals *m_launchersSignals{nullptr};
|
||||
|
||||
QString m_shouldSwitchToLayout;
|
||||
|
Reference in New Issue
Block a user