From 50b5cbe4ac47d11d80a5c1239b049ad5541130f4 Mon Sep 17 00:00:00 2001 From: isabel Date: Sat, 14 Oct 2023 02:45:55 +0100 Subject: [PATCH] feat!(ags): remove desktop --- .../gui/confs/bars/ags/config/config.js | 2 - .../bars/ags/config/js/desktop/Desktop.js | 34 ----------- .../bars/ags/config/js/desktop/DesktopMenu.js | 60 ------------------- .../config/js/services/onScreenIndicator.js | 10 ---- .../ags/config/scss/widgets/dashboard.scss | 10 ++-- .../bars/ags/config/scss/widgets/desktop.scss | 19 ------ 6 files changed, 6 insertions(+), 129 deletions(-) delete mode 100644 home/isabel/programs/gui/confs/bars/ags/config/js/desktop/Desktop.js delete mode 100644 home/isabel/programs/gui/confs/bars/ags/config/js/desktop/DesktopMenu.js diff --git a/home/isabel/programs/gui/confs/bars/ags/config/config.js b/home/isabel/programs/gui/confs/bars/ags/config/config.js index 2253fce26..fb9f0c53c 100644 --- a/home/isabel/programs/gui/confs/bars/ags/config/config.js +++ b/home/isabel/programs/gui/confs/bars/ags/config/config.js @@ -5,7 +5,6 @@ import OSD from "./js/osd/OSD.js"; import Applauncher from "./js/applauncher/Applauncher.js"; import PowerMenu from "./js/powermenu/PowerMenu.js"; import Verification from "./js/powermenu/Verification.js"; -import Desktop from "./js/desktop/Desktop.js"; import Notifications from "./js/notifications/Notifications.js"; import QuickSettings from "./js/quicksettings/QuickSettings.js"; import options from "./js/options.js"; @@ -27,7 +26,6 @@ export default { forMonitors(TopBar), forMonitors(ScreenCorners), forMonitors(OSD), - forMonitors(Desktop), forMonitors(Notifications), Applauncher(), Dashboard(), diff --git a/home/isabel/programs/gui/confs/bars/ags/config/js/desktop/Desktop.js b/home/isabel/programs/gui/confs/bars/ags/config/js/desktop/Desktop.js deleted file mode 100644 index 1445079ca..000000000 --- a/home/isabel/programs/gui/confs/bars/ags/config/js/desktop/Desktop.js +++ /dev/null @@ -1,34 +0,0 @@ -import Theme from "../services/theme/theme.js"; -import DesktopMenu from "./DesktopMenu.js"; -import { Widget } from "../imports.js"; - -const Desktop = () => - Widget.EventBox({ - onSecondaryClick: (_, event) => DesktopMenu().popup_at_pointer(event), - onMiddleClick: print, - child: Widget.Box({ - vertical: true, - vexpand: true, - hexpand: true, - connections: [ - [ - Theme, - (box) => { - box.halign = imports.gi.Gtk.Align[halign.toUpperCase()]; - box.valign = imports.gi.Gtk.Align[valign.toUpperCase()]; - box.setStyle(`margin: ${Number(offset)}px;`); - }, - ], - ], - }), - }); - -export default (monitor) => - Widget.Window({ - monitor, - name: `desktop${monitor}`, - layer: "background", - className: "desktop", - anchor: ["top", "bottom", "left", "right"], - child: Desktop(), - }); diff --git a/home/isabel/programs/gui/confs/bars/ags/config/js/desktop/DesktopMenu.js b/home/isabel/programs/gui/confs/bars/ags/config/js/desktop/DesktopMenu.js deleted file mode 100644 index 95781bc7e..000000000 --- a/home/isabel/programs/gui/confs/bars/ags/config/js/desktop/DesktopMenu.js +++ /dev/null @@ -1,60 +0,0 @@ -import Theme from "../services/theme/theme.js"; -import PowerMenu from "../services/powermenu.js"; -import icons from "../icons.js"; -import { App, Widget } from "../imports.js"; -import Gtk from "gi://Gtk"; - -const Item = (label, icon, onActivate) => - Widget.MenuItem({ - onActivate, - child: Widget.Box({ - children: [ - Widget.Icon(icon), - Widget.Label({ - label, - hexpand: true, - xalign: 0, - }), - ], - }), - }); - -export default () => - Widget.Menu({ - className: "desktop-menu", - children: [ - Widget.MenuItem({ - child: Widget.Box({ - children: [ - Widget.Icon(icons.powermenu.shutdown), - Widget.Label({ - label: "System", - hexpand: true, - xalign: 0, - }), - ], - }), - submenu: Widget.Menu({ - children: [ - Item("Shutdown", icons.powermenu.shutdown, () => - PowerMenu.action("shutdown"), - ), - Item("Log Out", icons.powermenu.logout, () => - PowerMenu.action("logout"), - ), - Item("Reboot", icons.powermenu.reboot, () => - PowerMenu.action("reboot"), - ), - Item("Sleep", icons.powermenu.sleep, () => - PowerMenu.action("reboot"), - ), - ], - }), - }), - Item("Applications", icons.apps.apps, () => - App.openWindow("applauncher"), - ), - Widget({ type: Gtk.SeparatorMenuItem }), - Item("Settings", icons.settings, () => Theme.openSettings()), - ], - }); diff --git a/home/isabel/programs/gui/confs/bars/ags/config/js/services/onScreenIndicator.js b/home/isabel/programs/gui/confs/bars/ags/config/js/services/onScreenIndicator.js index d1fa46214..9b621d0b5 100644 --- a/home/isabel/programs/gui/confs/bars/ags/config/js/services/onScreenIndicator.js +++ b/home/isabel/programs/gui/confs/bars/ags/config/js/services/onScreenIndicator.js @@ -38,16 +38,6 @@ class Indicator extends Service { ); } - kbd() { - // brightness is async, so lets wait a bit - Utils.timeout(10, () => - this.popup( - (Brightness.kbd * 33 + 1) / 100, - icons.brightness.keyboard, - ), - ); - } - connectWidget(widget, callback) { Utils.connect(this, widget, callback, "popup"); } diff --git a/home/isabel/programs/gui/confs/bars/ags/config/scss/widgets/dashboard.scss b/home/isabel/programs/gui/confs/bars/ags/config/scss/widgets/dashboard.scss index 92d021360..6fce64cac 100644 --- a/home/isabel/programs/gui/confs/bars/ags/config/scss/widgets/dashboard.scss +++ b/home/isabel/programs/gui/confs/bars/ags/config/scss/widgets/dashboard.scss @@ -11,10 +11,7 @@ } &:selected { - box-shadow: - inset 0 -8px 0 0 transparentize($accent, 0.5), - inset 0 0 0 1px $accent; - border-radius: $radii * 0.6; + @include button($flat: false); } &.header { @@ -31,6 +28,7 @@ &:indeterminate { color: transparentize($fg_color, 0.9); } + font-size: 1.1em; padding: 0.2em; } @@ -83,9 +81,11 @@ window#dashboard .dashboard { .placeholder { color: $wallpaper_fg; + image { font-size: 7em; } + label { font-size: 1.2em; } @@ -128,9 +128,11 @@ window#dashboard .dashboard { @include widget; margin-top: $spacing; margin-right: $spacing; + &:last-child { margin-right: 0; } + padding: $spacing; .circular-progress { diff --git a/home/isabel/programs/gui/confs/bars/ags/config/scss/widgets/desktop.scss b/home/isabel/programs/gui/confs/bars/ags/config/scss/widgets/desktop.scss index 0309a9ea9..40ab31082 100644 --- a/home/isabel/programs/gui/confs/bars/ags/config/scss/widgets/desktop.scss +++ b/home/isabel/programs/gui/confs/bars/ags/config/scss/widgets/desktop.scss @@ -3,25 +3,6 @@ window.corner .corner { border-radius: if($screen_corners, $radii * 2, 0); } -window.desktop { - @if $bar_style == "normal" { - border-radius: if($screen_corners, $popover_radius, 0); - box-shadow: inset 0 0 $spacing 0 $shadow; - } - - .date { - color: $wallpaper_fg; - font-size: 48px; - } -} - -.desktop-menu { - image { - margin-left: -14px; - margin-right: 6px; - } -} - window.indicator .progress { @include floating_widget; padding: $spacing/2;