mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 15:32:50 -05:00
Workspace switcher: max icons setting (#150)
This commit is contained in:
committed by
GitHub
parent
5146dcb3f7
commit
886c6877d5
@@ -46,6 +46,7 @@ Singleton {
|
|||||||
property bool showWorkspaceIndex: false
|
property bool showWorkspaceIndex: false
|
||||||
property bool showWorkspacePadding: false
|
property bool showWorkspacePadding: false
|
||||||
property bool showWorkspaceApps: false
|
property bool showWorkspaceApps: false
|
||||||
|
property int maxWorkspaceIcons: 3
|
||||||
property var workspaceNameIcons: ({})
|
property var workspaceNameIcons: ({})
|
||||||
property bool clockCompactMode: false
|
property bool clockCompactMode: false
|
||||||
property bool focusedWindowCompactMode: false
|
property bool focusedWindowCompactMode: false
|
||||||
@@ -232,6 +233,8 @@ Singleton {
|
|||||||
!== undefined ? settings.showWorkspacePadding : false
|
!== undefined ? settings.showWorkspacePadding : false
|
||||||
showWorkspaceApps = settings.showWorkspaceApps
|
showWorkspaceApps = settings.showWorkspaceApps
|
||||||
!== undefined ? settings.showWorkspaceApps : false
|
!== undefined ? settings.showWorkspaceApps : false
|
||||||
|
maxWorkspaceIcons = settings.maxWorkspaceIcons
|
||||||
|
!== undefined ? settings.maxWorkspaceIcons : 3
|
||||||
workspaceNameIcons = settings.workspaceNameIcons
|
workspaceNameIcons = settings.workspaceNameIcons
|
||||||
!== undefined ? settings.workspaceNameIcons : ({})
|
!== undefined ? settings.workspaceNameIcons : ({})
|
||||||
clockCompactMode = settings.clockCompactMode
|
clockCompactMode = settings.clockCompactMode
|
||||||
@@ -431,6 +434,11 @@ Singleton {
|
|||||||
showWorkspaceApps = enabled
|
showWorkspaceApps = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setMaxWorkspaceIcons(maxIcons) {
|
||||||
|
maxWorkspaceIcons = maxIcons
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
function setWorkspaceNameIcon(workspaceName, iconData) {
|
function setWorkspaceNameIcon(workspaceName, iconData) {
|
||||||
var iconMap = JSON.parse(JSON.stringify(workspaceNameIcons))
|
var iconMap = JSON.parse(JSON.stringify(workspaceNameIcons))
|
||||||
|
|||||||
@@ -242,6 +242,48 @@ Item {
|
|||||||
checked)
|
checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: parent.width - Theme.spacingL
|
||||||
|
spacing: Theme.spacingL
|
||||||
|
visible: SettingsData.showWorkspaceApps
|
||||||
|
opacity: visible ? 1 : 0
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Theme.spacingL
|
||||||
|
|
||||||
|
Column {
|
||||||
|
width: 120
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: "Max apps to show"
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceText
|
||||||
|
font.weight: Font.Medium
|
||||||
|
}
|
||||||
|
|
||||||
|
DankTextField {
|
||||||
|
width: 100
|
||||||
|
height: 28
|
||||||
|
placeholderText: "#ffffff"
|
||||||
|
text: SettingsData.maxWorkspaceIcons
|
||||||
|
maximumLength: 7
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
topPadding: Theme.spacingXS
|
||||||
|
bottomPadding: Theme.spacingXS
|
||||||
|
onEditingFinished: {
|
||||||
|
SettingsData.setMaxWorkspaceIcons(parseInt(text, 10))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.mediumDuration
|
||||||
|
easing.type: Theme.emphasizedEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ Rectangle {
|
|||||||
visible: SettingsData.showWorkspaceApps && icons.length > 0
|
visible: SettingsData.showWorkspaceApps && icons.length > 0
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: icons.slice(0, 3)
|
model: icons.slice(0, SettingsData.maxWorkspaceIcons)
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
width: 18
|
width: 18
|
||||||
height: 18
|
height: 18
|
||||||
|
|||||||
Reference in New Issue
Block a user