forked from Shinonome/dots-hyprland
format
This commit is contained in:
@@ -63,33 +63,27 @@ const DockSeparator = (props = {}) => Box({
|
|||||||
className: 'dock-separator',
|
className: 'dock-separator',
|
||||||
})
|
})
|
||||||
|
|
||||||
const PinButton = () => {
|
const PinButton = () => Widget.Button({
|
||||||
let botton = Widget.Button({
|
className: 'dock-app-btn dock-app-btn-animate',
|
||||||
className: 'dock-app-btn dock-app-btn-animate',
|
tooltipText: 'Pin Dock',
|
||||||
tooltipText: 'Pin Dock',
|
child: Widget.Overlay({
|
||||||
child: Widget.Overlay({
|
child: Widget.Box({
|
||||||
child: Widget.Box({
|
homogeneous: true,
|
||||||
homogeneous: true,
|
className: 'dock-app-icon',
|
||||||
className: 'dock-app-icon',
|
child: MaterialIcon('push_pin', 'hugeass')
|
||||||
child: MaterialIcon('push_pin', 'hugeass')
|
|
||||||
}),
|
|
||||||
overlays: [Widget.Box({
|
|
||||||
class_name: 'indicator',
|
|
||||||
vpack: 'end',
|
|
||||||
hpack: 'center',
|
|
||||||
})],
|
|
||||||
}),
|
}),
|
||||||
onClicked: () => {
|
overlays: [Widget.Box({
|
||||||
isPinned = !isPinned
|
class_name: 'indicator',
|
||||||
botton.className = `${isPinned ? "pinned-dock-app-btn" : "dock-app-btn animate"} dock-app-btn-animate`
|
vpack: 'end',
|
||||||
},
|
hpack: 'center',
|
||||||
setup: (button) => {
|
})],
|
||||||
setupCursorHover(button);
|
}),
|
||||||
}
|
onClicked: (self) => {
|
||||||
})
|
isPinned = !isPinned
|
||||||
|
self.className = `${isPinned ? "pinned-dock-app-btn" : "dock-app-btn animate"} dock-app-btn-animate`
|
||||||
return botton
|
},
|
||||||
}
|
setup: setupCursorHover,
|
||||||
|
})
|
||||||
|
|
||||||
const AppButton = ({ icon, ...rest }) => Widget.Revealer({
|
const AppButton = ({ icon, ...rest }) => Widget.Revealer({
|
||||||
attribute: {
|
attribute: {
|
||||||
@@ -299,11 +293,10 @@ export default (monitor = 0) => {
|
|||||||
// self.revealChild = true;
|
// self.revealChild = true;
|
||||||
// // }
|
// // }
|
||||||
|
|
||||||
if (userOptions.dock.monitorExclusivity) {
|
if (userOptions.dock.monitorExclusivity)
|
||||||
self.revealChild = Hyprland.active.monitor.id === monitor
|
self.revealChild = Hyprland.active.monitor.id === monitor;
|
||||||
} else {
|
else
|
||||||
self.revealChild = true;
|
self.revealChild = true;
|
||||||
}
|
|
||||||
|
|
||||||
return self.revealChild
|
return self.revealChild
|
||||||
}
|
}
|
||||||
@@ -317,11 +310,9 @@ export default (monitor = 0) => {
|
|||||||
if (!userOptions.dock.trigger.includes(trigger)) return
|
if (!userOptions.dock.trigger.includes(trigger)) return
|
||||||
const flag = self.attribute.updateShow(self)
|
const flag = self.attribute.updateShow(self)
|
||||||
|
|
||||||
if (flag) { clearTimes() }
|
if (flag) clearTimes();
|
||||||
|
|
||||||
const hidden = userOptions
|
const hidden = userOptions.dock.autoHide.find(e => e["trigger"] === trigger)
|
||||||
.dock
|
|
||||||
.autoHide.find(e => e["trigger"] === trigger)
|
|
||||||
|
|
||||||
if (hidden) {
|
if (hidden) {
|
||||||
let id = Utils.timeout(hidden.interval, () => {
|
let id = Utils.timeout(hidden.interval, () => {
|
||||||
@@ -338,8 +329,7 @@ export default (monitor = 0) => {
|
|||||||
.hook(Hyprland.active.client, self => callback(self, "client-active"))
|
.hook(Hyprland.active.client, self => callback(self, "client-active"))
|
||||||
.hook(Hyprland, self => callback(self, "client-added"), "client-added")
|
.hook(Hyprland, self => callback(self, "client-added"), "client-added")
|
||||||
.hook(Hyprland, self => callback(self, "client-removed"), "client-removed")
|
.hook(Hyprland, self => callback(self, "client-removed"), "client-removed")
|
||||||
}
|
},
|
||||||
,
|
|
||||||
})
|
})
|
||||||
return EventBox({
|
return EventBox({
|
||||||
onHover: () => {
|
onHover: () => {
|
||||||
@@ -349,9 +339,7 @@ export default (monitor = 0) => {
|
|||||||
child: Box({
|
child: Box({
|
||||||
homogeneous: true,
|
homogeneous: true,
|
||||||
css: `min-height: ${userOptions.dock.hiddenThickness}px;`,
|
css: `min-height: ${userOptions.dock.hiddenThickness}px;`,
|
||||||
children: [
|
children: [dockRevealer],
|
||||||
dockRevealer,
|
|
||||||
]
|
|
||||||
}),
|
}),
|
||||||
setup: self => self.on("leave-notify-event", () => {
|
setup: self => self.on("leave-notify-event", () => {
|
||||||
if (!isPinned) dockRevealer.revealChild = false;
|
if (!isPinned) dockRevealer.revealChild = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user