mirror of
https://github.com/danbulant/dots-hyprland
synced 2026-05-24 12:22:09 +00:00
dock launcher button (#433)
This commit is contained in:
parent
95d2192d37
commit
ced3823270
1 changed files with 21 additions and 12 deletions
33
.config/ags/modules/dock/dock.js
Normal file → Executable file
33
.config/ags/modules/dock/dock.js
Normal file → Executable file
|
|
@ -1,5 +1,6 @@
|
|||
const { Gtk, GLib } = imports.gi;
|
||||
import { SCREEN_HEIGHT, SCREEN_WIDTH } from '../../variables.js';
|
||||
import App from 'resource:///com/github/Aylur/ags/app.js';
|
||||
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
|
||||
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js';
|
||||
const { EventBox, Button } = Widget;
|
||||
|
|
@ -66,17 +67,10 @@ const DockSeparator = (props = {}) => Box({
|
|||
const PinButton = () => Widget.Button({
|
||||
className: 'dock-app-btn dock-app-btn-animate',
|
||||
tooltipText: 'Pin Dock',
|
||||
child: Widget.Overlay({
|
||||
child: Widget.Box({
|
||||
homogeneous: true,
|
||||
className: 'dock-app-icon txt',
|
||||
child: MaterialIcon('push_pin', 'hugeass')
|
||||
}),
|
||||
overlays: [Widget.Box({
|
||||
class_name: 'indicator',
|
||||
vpack: 'end',
|
||||
hpack: 'center',
|
||||
})],
|
||||
child: Widget.Box({
|
||||
homogeneous: true,
|
||||
className: 'dock-app-icon txt',
|
||||
child: MaterialIcon('push_pin', 'hugeass')
|
||||
}),
|
||||
onClicked: (self) => {
|
||||
isPinned = !isPinned
|
||||
|
|
@ -85,6 +79,20 @@ const PinButton = () => Widget.Button({
|
|||
setup: setupCursorHover,
|
||||
})
|
||||
|
||||
const LauncherButton = () => Widget.Button({
|
||||
className: 'dock-app-btn dock-app-btn-animate',
|
||||
tooltipText: 'Open launcher',
|
||||
child: Widget.Box({
|
||||
homogeneous: true,
|
||||
className: 'dock-app-icon txt',
|
||||
child: MaterialIcon('apps', 'hugerass')
|
||||
}),
|
||||
onClicked: (self) => {
|
||||
App.toggleWindow('overview');
|
||||
},
|
||||
setup: setupCursorHover,
|
||||
})
|
||||
|
||||
const AppButton = ({ icon, ...rest }) => Widget.Revealer({
|
||||
attribute: {
|
||||
'workspace': 0
|
||||
|
|
@ -245,10 +253,11 @@ export default (monitor = 0) => {
|
|||
const dockContent = Box({
|
||||
className: 'dock-bg spacing-h-5',
|
||||
children: [
|
||||
PinButton(),
|
||||
PinnedApps(),
|
||||
DockSeparator(),
|
||||
Taskbar(),
|
||||
PinButton(),
|
||||
LauncherButton(),
|
||||
]
|
||||
})
|
||||
const dockRevealer = Revealer({
|
||||
|
|
|
|||
Loading…
Reference in a new issue