mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 06:33:09 +00:00
slightly better bottom toolbar behavior
This commit is contained in:
parent
33e3892f96
commit
1c8a653b1d
5 changed files with 28 additions and 19 deletions
|
|
@ -33,8 +33,8 @@ MouseArea {
|
|||
property bool checkable
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
visible: button.checked
|
||||
opacity: 0.05
|
||||
visible: button.pressed
|
||||
opacity: 0.1
|
||||
}
|
||||
PlasmaCore.IconItem {
|
||||
id: icon
|
||||
|
|
|
|||
|
|
@ -75,9 +75,11 @@ FullScreenPanel {
|
|||
plasmoid.nativeInterface.windowModel.requestToggleMinimized(filteredWindowModel.mapRowToSource(i));
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
if (id >= 0) {
|
||||
plasmoid.nativeInterface.windowModel.requestActivate(filteredWindowModel.mapRowToSource(id));
|
||||
} else {
|
||||
plasmoid.nativeInterface.forgetActiveWindow();
|
||||
}
|
||||
currentTaskIndex = id;
|
||||
}
|
||||
|
|
@ -205,8 +207,8 @@ FullScreenPanel {
|
|||
}
|
||||
iconSource: "go-home"
|
||||
onClicked: {
|
||||
setSingleActiveWindow(-1);
|
||||
window.hide();
|
||||
setSingleActiveWindow(-1);
|
||||
}
|
||||
}
|
||||
Component.onCompleted: plasmoid.nativeInterface.panel = window;
|
||||
|
|
|
|||
|
|
@ -98,22 +98,11 @@ PlasmaCore.ColorScope {
|
|||
width: parent.width/3
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
iconSource: "go-home"
|
||||
checkable: true
|
||||
onCheckedChanged: {
|
||||
if (checked) {
|
||||
root.taskSwitcher.setSingleActiveWindow(-1);
|
||||
} else {
|
||||
root.taskSwitcher.setSingleActiveWindow(Math.max(0, root.taskSwitcher.currentTaskIndex));
|
||||
}
|
||||
onClicked: {
|
||||
root.taskSwitcher.setSingleActiveWindow(-1);
|
||||
}
|
||||
onPositionChanged: mainMouseArea.positionChanged(mouse);
|
||||
onReleased: mainMouseArea.released(mouse);
|
||||
Connections {
|
||||
target: root.taskSwitcher
|
||||
onCurrentTaskIndexChanged: {
|
||||
showDesktopButton.checked = root.taskSwitcher.currentTaskIndex < 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
|
|
|
|||
|
|
@ -148,10 +148,14 @@ void TaskPanel::updateActiveWindow()
|
|||
}
|
||||
if (m_activeWindow) {
|
||||
disconnect(m_activeWindow, &KWayland::Client::PlasmaWindow::closeableChanged, this, &TaskPanel::hasCloseableActiveWindowChanged);
|
||||
disconnect(m_activeWindow, &KWayland::Client::PlasmaWindow::unmapped,
|
||||
this, &TaskPanel::forgetActiveWindow);
|
||||
}
|
||||
m_activeWindow = m_windowManagement->activeWindow();
|
||||
|
||||
connect(m_activeWindow, &KWayland::Client::PlasmaWindow::closeableChanged, this, &TaskPanel::hasCloseableActiveWindowChanged);
|
||||
connect(m_activeWindow, &KWayland::Client::PlasmaWindow::unmapped,
|
||||
this, &TaskPanel::forgetActiveWindow);
|
||||
|
||||
// TODO: connect to closeableChanged, not needed right now as KWin doesn't provide this changeable
|
||||
emit hasCloseableActiveWindowChanged();
|
||||
|
|
@ -159,14 +163,25 @@ void TaskPanel::updateActiveWindow()
|
|||
|
||||
bool TaskPanel::hasCloseableActiveWindow() const
|
||||
{
|
||||
return m_activeWindow && m_activeWindow->isCloseable();
|
||||
return m_activeWindow && m_activeWindow->isCloseable() && !m_activeWindow->isMinimized();
|
||||
}
|
||||
|
||||
void TaskPanel::forgetActiveWindow()
|
||||
{
|
||||
if (m_activeWindow) {
|
||||
disconnect(m_activeWindow, &KWayland::Client::PlasmaWindow::closeableChanged, this, &TaskPanel::hasCloseableActiveWindowChanged);
|
||||
disconnect(m_activeWindow, &KWayland::Client::PlasmaWindow::unmapped,
|
||||
this, &TaskPanel::forgetActiveWindow);
|
||||
}
|
||||
m_activeWindow.clear();
|
||||
emit hasCloseableActiveWindowChanged();
|
||||
}
|
||||
|
||||
void TaskPanel::closeActiveWindow()
|
||||
{
|
||||
if (m_activeWindow) {
|
||||
m_activeWindow->requestClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TaskPanel::setTaskGeometry(int row, int x, int y, int width, int height)
|
||||
|
|
|
|||
|
|
@ -66,6 +66,9 @@ public:
|
|||
|
||||
Q_INVOKABLE void setTaskGeometry(int row, int x, int y, int width, int height);
|
||||
|
||||
public Q_SLOTS:
|
||||
void forgetActiveWindow();
|
||||
|
||||
Q_SIGNALS:
|
||||
void windowModelChanged();
|
||||
void showingDesktopChanged(bool);
|
||||
|
|
|
|||
Loading…
Reference in a new issue