forked from Shinonome/dots-hyprland
dock launcher button (#433)
This commit is contained in:
Regular → Executable
+21
-12
@@ -1,5 +1,6 @@
|
|||||||
const { Gtk, GLib } = imports.gi;
|
const { Gtk, GLib } = imports.gi;
|
||||||
import { SCREEN_HEIGHT, SCREEN_WIDTH } from '../../variables.js';
|
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 Widget from 'resource:///com/github/Aylur/ags/widget.js';
|
||||||
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js';
|
import * as Utils from 'resource:///com/github/Aylur/ags/utils.js';
|
||||||
const { EventBox, Button } = Widget;
|
const { EventBox, Button } = Widget;
|
||||||
@@ -66,17 +67,10 @@ const DockSeparator = (props = {}) => Box({
|
|||||||
const PinButton = () => Widget.Button({
|
const PinButton = () => 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.Box({
|
||||||
child: Widget.Box({
|
homogeneous: true,
|
||||||
homogeneous: true,
|
className: 'dock-app-icon txt',
|
||||||
className: 'dock-app-icon txt',
|
child: MaterialIcon('push_pin', 'hugeass')
|
||||||
child: MaterialIcon('push_pin', 'hugeass')
|
|
||||||
}),
|
|
||||||
overlays: [Widget.Box({
|
|
||||||
class_name: 'indicator',
|
|
||||||
vpack: 'end',
|
|
||||||
hpack: 'center',
|
|
||||||
})],
|
|
||||||
}),
|
}),
|
||||||
onClicked: (self) => {
|
onClicked: (self) => {
|
||||||
isPinned = !isPinned
|
isPinned = !isPinned
|
||||||
@@ -85,6 +79,20 @@ const PinButton = () => Widget.Button({
|
|||||||
setup: setupCursorHover,
|
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({
|
const AppButton = ({ icon, ...rest }) => Widget.Revealer({
|
||||||
attribute: {
|
attribute: {
|
||||||
'workspace': 0
|
'workspace': 0
|
||||||
@@ -245,10 +253,11 @@ export default (monitor = 0) => {
|
|||||||
const dockContent = Box({
|
const dockContent = Box({
|
||||||
className: 'dock-bg spacing-h-5',
|
className: 'dock-bg spacing-h-5',
|
||||||
children: [
|
children: [
|
||||||
|
PinButton(),
|
||||||
PinnedApps(),
|
PinnedApps(),
|
||||||
DockSeparator(),
|
DockSeparator(),
|
||||||
Taskbar(),
|
Taskbar(),
|
||||||
PinButton(),
|
LauncherButton(),
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
const dockRevealer = Revealer({
|
const dockRevealer = Revealer({
|
||||||
|
|||||||
Reference in New Issue
Block a user