1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-11 13:18:13 +03:00

disable pause button for only one running activity

This commit is contained in:
Michail Vourlakos 2020-08-31 21:14:26 +03:00
parent 9a5e9fdca1
commit ef415e51fb

View File

@ -94,6 +94,7 @@ void TabLayouts::initUi()
connect(m_layoutsController, &Settings::Controller::Layouts::dataChanged, this, &Generic::dataChanged);
connect(this, &Settings::Handler::TabLayouts::dataChanged, this, &TabLayouts::updatePerLayoutButtonsState);
connect(m_corona->activitiesConsumer(), &KActivities::Consumer::runningActivitiesChanged, this, &TabLayouts::updatePerLayoutButtonsState);
connect(m_inMemoryButtons, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled),
[ = ](int id, bool checked) {
@ -371,7 +372,7 @@ void TabLayouts::updatePerLayoutButtonsState()
//! Pause Button - enabled
if (m_layoutsController->inMultipleMode()) {
if (selectedLayout.isActive && !selectedLayout.isForFreeActivities()) {
if (selectedLayout.isActive && !selectedLayout.isForFreeActivities() && m_corona->layoutsManager()->synchronizer()->runningActivities().count()>1) {
setTwinProperty(m_pauseLayoutAction, TWINENABLED, true);
} else {
setTwinProperty(m_pauseLayoutAction, TWINENABLED, false);