Skip to content

Commit c59cb31

Browse files
authored
0.6.2 fix 3
1 parent e2bb7c3 commit c59cb31

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

panel.cpp

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,7 @@ void Panel::updateWorkspaces() {
410410
visibleDesktop = KWindowSystem::currentDesktop();
411411
if (mPanelLayout == Horizontal) {
412412
for (qint8 workspace = 1; workspace <= mCountWorkspaces; ++workspace) {
413-
QString buttonName;
414-
if (!getConfigValue("showDesktopNames").toBool()) {
415-
buttonName = QString("workspace%1").arg(workspace);
416-
}
417-
else {
418-
buttonName = KWindowSystem::desktopName(workspace);
419-
}
413+
QString buttonName = QString("workspace%1").arg(workspace);
420414

421415
if ((workspace) == visibleDesktop) {
422416
QString buttonStyle = QString("background-color: %1; color: #ffffff;").arg(mAccentColor);
@@ -429,13 +423,13 @@ void Panel::updateWorkspaces() {
429423
}
430424
}
431425
else {
432-
QString buttonText;
433-
if (!getConfigValue("showDesktopNames").toBool()) {
434-
buttonText = QString::number(visibleDesktop);
435-
}
436-
else {
437-
buttonText = KWindowSystem::desktopName(visibleDesktop);
438-
}
426+
QString buttonText;
427+
if (!getConfigValue("showDesktopNames").toBool()) {
428+
buttonText = QString::number(visibleDesktop);
429+
}
430+
else {
431+
buttonText = KWindowSystem::desktopName(visibleDesktop);
432+
}
439433
static_cast<QPushButton*>(mAppletWidgets["workspace"])->setText(buttonText);
440434
}
441435
}
@@ -1200,13 +1194,7 @@ void Panel::addApplets() {
12001194

12011195
else if (applet == "workspaces") {
12021196
for (qint8 workspace = 1; workspace <= mCountWorkspaces; ++workspace) {
1203-
QString buttonName;
1204-
if (!getConfigValue("showDesktopNames").toBool()) {
1205-
buttonName = QString("workspace%1").arg(workspace);
1206-
}
1207-
else {
1208-
buttonName = KWindowSystem::desktopName(workspace);
1209-
}
1197+
QString buttonName = QString("workspace%1").arg(workspace);
12101198

12111199
this->connect(static_cast<QPushButton*>(mAppletWidgets[buttonName]),
12121200
&QPushButton::clicked, this, [workspace]() {

0 commit comments

Comments
 (0)