forked from Shinonome/dots-hyprland
add bg, taskbar items
This commit is contained in:
@@ -389,7 +389,7 @@ Singleton {
|
||||
property bool darkenScreen: true
|
||||
property real clickthroughOpacity: 0.8
|
||||
property JsonObject floatingImage: JsonObject {
|
||||
property string imageSource: "https://cdn.discordapp.com/attachments/961693710968557598/1369635662390759434/image.gif?ex=6911cb1c&is=6910799c&hm=4450244066c0a7a6e5d2bdd195f47388eb5e7f9dd53d3931e99ad9642c638a00&"
|
||||
property string imageSource: "https://media.tenor.com/H5U5bJzj3oAAAAAi/kukuru.gif"
|
||||
property real scale: 0.5
|
||||
}
|
||||
}
|
||||
@@ -561,7 +561,7 @@ Singleton {
|
||||
property JsonObject waffles: JsonObject {
|
||||
property JsonObject bar: JsonObject {
|
||||
property bool bottom: true
|
||||
property bool leftAlignApps: true
|
||||
property bool leftAlignApps: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ DockButton {
|
||||
property real countDotHeight: 4
|
||||
property bool appIsActive: appToplevel.toplevels.find(t => (t.activated == true)) !== undefined
|
||||
|
||||
property bool isSeparator: appToplevel.appId === "SEPARATOR"
|
||||
property var desktopEntry: DesktopEntries.heuristicLookup(appToplevel.appId)
|
||||
readonly property bool isSeparator: appToplevel.appId === "SEPARATOR"
|
||||
readonly property var desktopEntry: DesktopEntries.heuristicLookup(appToplevel.appId)
|
||||
enabled: !isSeparator
|
||||
implicitWidth: isSeparator ? 1 : implicitHeight - topInset - bottomInset
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import qs.modules.common
|
||||
import qs.modules.common.widgets
|
||||
import qs.modules.common.functions
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
@@ -8,6 +5,10 @@ import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Wayland
|
||||
import qs.services
|
||||
import qs.modules.common
|
||||
import qs.modules.common.widgets
|
||||
import qs.modules.common.functions
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -40,44 +41,7 @@ Item {
|
||||
|
||||
model: ScriptModel {
|
||||
objectProp: "appId"
|
||||
values: {
|
||||
var map = new Map();
|
||||
|
||||
// Pinned apps
|
||||
const pinnedApps = Config.options?.dock.pinnedApps ?? [];
|
||||
for (const appId of pinnedApps) {
|
||||
if (!map.has(appId.toLowerCase())) map.set(appId.toLowerCase(), ({
|
||||
pinned: true,
|
||||
toplevels: []
|
||||
}));
|
||||
}
|
||||
|
||||
// Separator
|
||||
if (pinnedApps.length > 0) {
|
||||
map.set("SEPARATOR", { pinned: false, toplevels: [] });
|
||||
}
|
||||
|
||||
// Ignored apps
|
||||
const ignoredRegexStrings = Config.options?.dock.ignoredAppRegexes ?? [];
|
||||
const ignoredRegexes = ignoredRegexStrings.map(pattern => new RegExp(pattern, "i"));
|
||||
// Open windows
|
||||
for (const toplevel of ToplevelManager.toplevels.values) {
|
||||
if (ignoredRegexes.some(re => re.test(toplevel.appId))) continue;
|
||||
if (!map.has(toplevel.appId.toLowerCase())) map.set(toplevel.appId.toLowerCase(), ({
|
||||
pinned: false,
|
||||
toplevels: []
|
||||
}));
|
||||
map.get(toplevel.appId.toLowerCase()).toplevels.push(toplevel);
|
||||
}
|
||||
|
||||
var values = [];
|
||||
|
||||
for (const [key, value] of map) {
|
||||
values.push({ appId: key, toplevels: value.toplevels, pinned: value.pinned });
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
values: TaskbarApps.apps
|
||||
}
|
||||
delegate: DockAppButton {
|
||||
required property var modelData
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import qs
|
||||
import qs.services
|
||||
import qs.modules.common
|
||||
import qs.modules.common.widgets
|
||||
import qs.modules.common.widgets.widgetCanvas
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
|
||||
import qs.modules.ii.background.widgets
|
||||
import qs.modules.ii.background.widgets.clock
|
||||
import qs.modules.ii.background.widgets.weather
|
||||
|
||||
Variants {
|
||||
id: root
|
||||
model: Quickshell.screens
|
||||
|
||||
PanelWindow {
|
||||
id: panelRoot
|
||||
required property var modelData
|
||||
|
||||
screen: modelData
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.layer: WlrLayer.Bottom
|
||||
WlrLayershell.namespace: "quickshell:background"
|
||||
anchors {
|
||||
top: true
|
||||
bottom: true
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
color: "transparent"
|
||||
|
||||
StyledImage {
|
||||
anchors.fill: parent
|
||||
source: Config.options.background.wallpaperPath
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.services
|
||||
import qs.modules.common
|
||||
import qs.modules.waffle.looks
|
||||
|
||||
AppButton {
|
||||
id: root
|
||||
|
||||
required property var toplevel
|
||||
readonly property bool isSeparator: toplevel.appId === "SEPARATOR"
|
||||
readonly property var desktopEntry: DesktopEntries.heuristicLookup(toplevel.appId)
|
||||
|
||||
Layout.fillHeight: true
|
||||
|
||||
iconName: toplevel.appId
|
||||
}
|
||||
@@ -10,6 +10,7 @@ AppButton {
|
||||
id: root
|
||||
|
||||
iconName: "task-view"
|
||||
separateLightDark: true
|
||||
|
||||
checked: GlobalStates.overviewOpen
|
||||
onClicked: {
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.services
|
||||
import qs.modules.common
|
||||
import qs.modules.waffle.looks
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
Layout.fillHeight: true
|
||||
implicitHeight: row.implicitHeight
|
||||
implicitWidth: row.implicitWidth
|
||||
|
||||
// Apps row
|
||||
RowLayout {
|
||||
id: row
|
||||
anchors.fill: parent
|
||||
spacing: 4
|
||||
|
||||
Repeater {
|
||||
model: ScriptModel {
|
||||
objectProp: "appId"
|
||||
values: TaskbarApps.apps.filter(app => app.appId !== "SEPARATOR")
|
||||
}
|
||||
delegate: TaskAppButton {
|
||||
required property var modelData
|
||||
toplevel: modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Previews popup
|
||||
}
|
||||
@@ -23,7 +23,7 @@ Scope {
|
||||
screen: modelData
|
||||
exclusionMode: ExclusionMode.Ignore
|
||||
exclusiveZone: implicitHeight
|
||||
WlrLayershell.namespace: "quickshell:wBar"
|
||||
WlrLayershell.namespace: "quickshell:bar"
|
||||
|
||||
anchors {
|
||||
left: true
|
||||
|
||||
@@ -57,6 +57,7 @@ Rectangle {
|
||||
StartButton {}
|
||||
SearchButton {}
|
||||
TaskViewButton {}
|
||||
Tasks {}
|
||||
}
|
||||
|
||||
BarGroupRow {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import org.kde.kirigami as Kirigami
|
||||
import qs
|
||||
import qs.services
|
||||
import qs.modules.common
|
||||
import qs.modules.waffle.looks
|
||||
@@ -13,6 +14,11 @@ AppButton {
|
||||
implicitWidth: expandedForm ? 148 : (height - topInset - bottomInset + leftInset + rightInset)
|
||||
iconName: "widgets"
|
||||
|
||||
checked: GlobalStates.sidebarLeftOpen
|
||||
onClicked: {
|
||||
GlobalStates.sidebarLeftOpen = !GlobalStates.sidebarLeftOpen
|
||||
}
|
||||
|
||||
contentItem: Item {
|
||||
anchors {
|
||||
verticalCenter: parent.verticalCenter
|
||||
@@ -29,11 +35,20 @@ AppButton {
|
||||
horizontalCenter: root.expandedForm ? undefined : parent.horizontalCenter
|
||||
margins: 8
|
||||
}
|
||||
spacing: 6
|
||||
|
||||
AppIcon {
|
||||
id: iconWidget
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
iconName: root.iconName
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
WText {
|
||||
text: Translation.tr("Widgets")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user