Rename bar.js file to index.js and fix styling for switches and media progress bar.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const battery = await Service.import("battery");
|
||||
import { closeAllMenus } from "../bar.js";
|
||||
import { closeAllMenus } from "../index.js";
|
||||
|
||||
const BatteryLabel = () => {
|
||||
const isVis = Variable(battery.available);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const bluetooth = await Service.import('bluetooth')
|
||||
import { closeAllMenus } from "../bar.js";
|
||||
import { closeAllMenus } from "../index.js";
|
||||
|
||||
const Bluetooth = () => {
|
||||
const btIcon = Widget.Label({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { closeAllMenus } from "../bar.js";
|
||||
import { closeAllMenus } from "../index.js";
|
||||
|
||||
const date = Variable("", {
|
||||
poll: [1000, 'date "+ %a %b %d %I:%M:%S %p"'],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const mpris = await Service.import("mpris");
|
||||
import { closeAllMenus } from "../bar.js";
|
||||
import { closeAllMenus } from "../index.js";
|
||||
|
||||
const Media = () => {
|
||||
const activePlayer = Variable(mpris.players[0]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const network = await Service.import("network");
|
||||
import { closeAllMenus } from "../bar.js";
|
||||
import { closeAllMenus } from "../index.js";
|
||||
|
||||
import { globalMousePos } from "../../../globals.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const audio = await Service.import("audio");
|
||||
import { closeAllMenus } from "../bar.js";
|
||||
import { closeAllMenus } from "../index.js";
|
||||
|
||||
import { globalMousePos } from "../../../globals.js";
|
||||
|
||||
|
||||
@@ -10,18 +10,22 @@ const Bar = (curPlayer) => {
|
||||
tooltip_text: "yoyo",
|
||||
class_name: "menu-slider media progress",
|
||||
draw_value: false,
|
||||
on_change: ({ value }) =>
|
||||
(curPlayer.position = value * curPlayer.length),
|
||||
on_change: ({ value }) => {
|
||||
return (curPlayer.position = value * curPlayer.length);
|
||||
},
|
||||
setup: (self) => {
|
||||
const update = () => {
|
||||
if (
|
||||
typeof curPlayer.position === "number" &&
|
||||
curPlayer.position > 0
|
||||
curPlayer.position > 0 &&
|
||||
typeof curPlayer.length === "number" &&
|
||||
curPlayer.length > 0
|
||||
) {
|
||||
const value = curPlayer.position / curPlayer.length;
|
||||
self.value = value > 0 ? value : 0;
|
||||
} else {
|
||||
self.value = 0;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
self.hook(curPlayer, update);
|
||||
self.hook(curPlayer, update, "position");
|
||||
|
||||
@@ -39,7 +39,7 @@ const Media = () => {
|
||||
AlbumCover(curPlayer),
|
||||
Widget.Box({
|
||||
class_name: "media-indicator-right-section",
|
||||
hpack: "center",
|
||||
hpack: "fill",
|
||||
hexpand: true,
|
||||
vertical: true,
|
||||
children: [
|
||||
|
||||
@@ -29,7 +29,9 @@ const renderWAPs = (self, network, staging, connecting) => {
|
||||
Utils.merge(
|
||||
[network.bind("wifi"), staging.bind("value"), connecting.bind("value")],
|
||||
() => {
|
||||
const WAPs = network.wifi.access_points;
|
||||
// Sometimes the network service will yield a "this._device is undefined" when
|
||||
// trying to access the "access_points" property. So we must check if it exists.
|
||||
const WAPs = Object.hasOwnProperty.call(network.wifi, "access_points") ? network.wifi.access_points : [];
|
||||
|
||||
const isInStaging = (wap) => {
|
||||
if (Object.keys(staging.value).length === 0) {
|
||||
|
||||
@@ -188,7 +188,7 @@ export default () => {
|
||||
if (notifs.notifications.length <= 0) {
|
||||
return (self.children = [
|
||||
Widget.Box({
|
||||
vpack: "center",
|
||||
vpack: "start",
|
||||
hpack: "center",
|
||||
expand: true,
|
||||
child: Widget.Label({
|
||||
|
||||
Reference in New Issue
Block a user