forked from Shinonome/dots-hyprland
fix ugly icons and spamming icon warnings
This commit is contained in:
@@ -13,8 +13,9 @@ import Hyprland from 'resource:///com/github/Aylur/ags/service/hyprland.js';
|
|||||||
const { execAsync, exec } = Utils;
|
const { execAsync, exec } = Utils;
|
||||||
import { setupCursorHoverGrab } from '../.widgetutils/cursorhover.js';
|
import { setupCursorHoverGrab } from '../.widgetutils/cursorhover.js';
|
||||||
import { dumpToWorkspace, swapWorkspace } from "./actions.js";
|
import { dumpToWorkspace, swapWorkspace } from "./actions.js";
|
||||||
import { substitute } from "../.miscutils/icons.js";
|
import { iconExists, substitute } from "../.miscutils/icons.js";
|
||||||
import { monitors } from '../.miscutils/hyprlanddata.js';
|
import { monitors } from '../.miscutils/hyprlanddata.js';
|
||||||
|
import { MaterialIcon } from '../.commonwidgets/materialicon.js';
|
||||||
|
|
||||||
const NUM_OF_WORKSPACES_SHOWN = userOptions.overview.numOfCols * userOptions.overview.numOfRows;
|
const NUM_OF_WORKSPACES_SHOWN = userOptions.overview.numOfCols * userOptions.overview.numOfRows;
|
||||||
const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)];
|
const TARGET = [Gtk.TargetEntry.new('text/plain', Gtk.TargetFlags.SAME_APP, 0)];
|
||||||
@@ -64,9 +65,12 @@ export default (overviewMonitor = 0) => {
|
|||||||
if (x + w > monitors[monitor]) w = monitors[monitor] - x;
|
if (x + w > monitors[monitor]) w = monitors[monitor] - x;
|
||||||
if (y + h > monitors[monitor].height) h = monitors[monitor].height - y;
|
if (y + h > monitors[monitor].height) h = monitors[monitor].height - y;
|
||||||
|
|
||||||
const appIcon = Widget.Icon({
|
const iconName = substitute(c);
|
||||||
|
const appIcon = iconExists(iconName) ? Widget.Icon({
|
||||||
icon: substitute(c),
|
icon: substitute(c),
|
||||||
size: Math.min(w, h) * userOptions.overview.scale / 2.5,
|
size: Math.min(w, h) * userOptions.overview.scale / 2.5,
|
||||||
|
}) : MaterialIcon('terminal', 'gigantic', {
|
||||||
|
css: `font-size: ${Math.min(w, h) * userOptions.overview.scale / 2.5}px`,
|
||||||
});
|
});
|
||||||
return Widget.Button({
|
return Widget.Button({
|
||||||
attribute: {
|
attribute: {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import Widget from 'resource:///com/github/Aylur/ags/widget.js';
|
|||||||
const { Box, Button, Icon, Label, Revealer, Scrollable, Slider, Stack } = Widget;
|
const { Box, Button, Icon, Label, Revealer, Scrollable, Slider, Stack } = Widget;
|
||||||
import { MaterialIcon } from '../../.commonwidgets/materialicon.js';
|
import { MaterialIcon } from '../../.commonwidgets/materialicon.js';
|
||||||
import { setupCursorHover } from '../../.widgetutils/cursorhover.js';
|
import { setupCursorHover } from '../../.widgetutils/cursorhover.js';
|
||||||
|
import { iconExists } from '../../.miscutils/icons.js';
|
||||||
|
|
||||||
const AppVolume = (stream) => Box({
|
const AppVolume = (stream) => Box({
|
||||||
className: 'sidebar-volmixer-stream spacing-h-10',
|
className: 'sidebar-volmixer-stream spacing-h-10',
|
||||||
@@ -66,10 +67,10 @@ const AudioDevices = (input = false) => {
|
|||||||
child: Box({
|
child: Box({
|
||||||
className: 'txt spacing-h-10',
|
className: 'txt spacing-h-10',
|
||||||
children: [
|
children: [
|
||||||
Icon({
|
iconExists(stream.iconName) ? Icon({
|
||||||
className: 'txt-norm symbolic-icon',
|
className: 'txt-norm symbolic-icon',
|
||||||
icon: stream.iconName,
|
icon: stream.iconName,
|
||||||
}),
|
}) : MaterialIcon(input ? 'mic_external_on' : 'media_output', 'norm'),
|
||||||
Label({
|
Label({
|
||||||
hexpand: true,
|
hexpand: true,
|
||||||
xalign: 0,
|
xalign: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user