Commit a607fc26 authored by Devin Lin's avatar Devin Lin 🎨
Browse files

panel & taskpanel: Only opaque if windows are maximized

parent c0642a6d
Pipeline #196175 passed with stage
in 1 minute and 9 seconds
......@@ -18,12 +18,14 @@ import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.private.nanoshell 2.0 as NanoShell
import org.kde.plasma.private.mobileshell 1.0 as MobileShell
import org.kde.taskmanager 0.1 as TaskManager
import org.kde.notificationmanager 1.0 as NotificationManager
Item {
id: root
readonly property bool showingApp: !MobileShell.WindowUtil.allWindowsMinimizedExcludingShell
// only opaque if there are no maximized windows on this screen
readonly property bool showingApp: visibleMaximizedWindowsModel.count > 0
readonly property color backgroundColor: topPanel.colorScopeColor
Plasmoid.backgroundHints: showingApp ? PlasmaCore.Types.StandardBackground : PlasmaCore.Types.NoBackground
......@@ -76,6 +78,34 @@ Item {
MobileShell.VolumeProvider.bindShortcuts = true;
}
TaskManager.VirtualDesktopInfo {
id: virtualDesktopInfo
}
TaskManager.ActivityInfo {
id: activityInfo
}
PlasmaCore.SortFilterModel {
id: visibleMaximizedWindowsModel
filterRole: 'IsMinimized'
filterRegExp: 'false'
sourceModel: TaskManager.TasksModel {
id: tasksModel
filterByVirtualDesktop: true
filterByActivity: true
filterNotMaximized: true
filterByScreen: true
filterHidden: true
// screenGeometry: panel.screenGeometry
virtualDesktop: virtualDesktopInfo.currentDesktop
activity: activityInfo.currentActivity
groupMode: TaskManager.TasksModel.GroupDisabled
}
}
// top panel component
MobileShell.StatusBar {
id: topPanel
......@@ -97,7 +127,6 @@ Item {
id: drawer
actionDrawer.notificationSettings: NotificationManager.Settings {}
actionDrawer.notificationModel: NotificationManager.Notifications {
showExpired: true
showDismissed: true
......
......@@ -16,7 +16,7 @@ import org.kde.plasma.private.mobileshell 1.0 as MobileShell
MobileShell.NavigationPanel {
id: root
property bool appIsShown: !MobileShell.WindowUtil.allWindowsMinimizedExcludingShell
required property bool opaqueBar
// background is:
// - opaque if an app is shown or vkbd is shown
......@@ -26,11 +26,11 @@ MobileShell.NavigationPanel {
if (root.taskSwitcher.visible) {
return Qt.rgba(0, 0, 0, 0.1);
} else {
return (Keyboards.KWinVirtualKeyboard.visible || appIsShown) ? PlasmaCore.ColorScope.backgroundColor : "transparent";
return (Keyboards.KWinVirtualKeyboard.visible || opaqueBar) ? PlasmaCore.ColorScope.backgroundColor : "transparent";
}
}
foregroundColorGroup: (!root.taskSwitcher.visible && appIsShown) ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
shadow: !appIsShown
foregroundColorGroup: (!root.taskSwitcher.visible && opaqueBar) ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
shadow: !opaqueBar
// do not enable drag gesture when task switcher is already open
// also don't disable drag gesture mid-drag
......
......@@ -21,13 +21,6 @@ import org.kde.plasma.phone.taskpanel 1.0 as TaskPanel
PlasmaCore.ColorScope {
id: root
width: 360
// contrasting colour
colorGroup: !MobileShell.WindowUtil.allWindowsMinimized ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
readonly property color backgroundColor: PlasmaCore.ColorScope.backgroundColor
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
// toggle visibility of navigation bar (show, or use gestures only)
......@@ -114,18 +107,47 @@ PlasmaCore.ColorScope {
}
//END API implementation
Window.onWindowChanged: {
if (!Window.window) {
return;
TaskManager.VirtualDesktopInfo {
id: virtualDesktopInfo
}
TaskManager.ActivityInfo {
id: activityInfo
}
PlasmaCore.SortFilterModel {
id: visibleMaximizedWindowsModel
filterRole: 'IsMinimized'
filterRegExp: 'false'
sourceModel: TaskManager.TasksModel {
id: tasksModel
filterByVirtualDesktop: true
filterByActivity: true
filterNotMaximized: true
filterByScreen: true
filterHidden: true
// screenGeometry: panel.screenGeometry
virtualDesktop: virtualDesktopInfo.currentDesktop
activity: activityInfo.currentActivity
groupMode: TaskManager.TasksModel.GroupDisabled
}
}
// only opaque if there are no maximized windows on this screen
readonly property bool opaqueBar: visibleMaximizedWindowsModel.count > 0
// contrasting colour
colorGroup: opaqueBar ? PlasmaCore.Theme.NormalColorGroup : PlasmaCore.Theme.ComplementaryColorGroup
// bottom navigation panel component
Component {
id: navigationPanel
NavigationPanelComponent {
taskSwitcher: MobileShell.HomeScreenControls.taskSwitcher
opaqueBar: root.opaqueBar
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment