Updated notification styling

This commit is contained in:
Jas Singh
2024-06-28 02:49:09 -07:00
parent 9a2a9d4ec5
commit 52731236e9
3 changed files with 35 additions and 37 deletions

View File

@@ -10,12 +10,16 @@ const period = Variable("", {
poll: [1000, 'date "+%p"'], poll: [1000, 'date "+%p"'],
}); });
const defaultWeather = { const defaultWeather = {
location: {
localtime_epoch: 1719471600,
},
current: { current: {
temp_f: 0, temp_f: 0,
wind_mph: 0, wind_mph: 0,
condition: { condition: {
text: "Clear", text: "Clear",
}, },
},
forecast: { forecast: {
forecastday: [ forecastday: [
{ {
@@ -34,7 +38,6 @@ const defaultWeather = {
}, },
], ],
}, },
},
}; };
const theWeather = Variable(defaultWeather); const theWeather = Variable(defaultWeather);
@@ -336,7 +339,7 @@ const WeatherWidget = () => {
); );
return icons.weather[ return icons.weather[
weatherAtEpoch.condition.text weatherAtEpoch?.condition.text
.trim() .trim()
.toLowerCase() .toLowerCase()
.replaceAll(" ", "_") .replaceAll(" ", "_")
@@ -356,7 +359,7 @@ const WeatherWidget = () => {
(h) => h.time_epoch === nextEpoch, (h) => h.time_epoch === nextEpoch,
); );
return `${Math.ceil(weatherAtEpoch.temp_f)}° F`; return `${weatherAtEpoch ? Math.ceil(weatherAtEpoch.temp_f) : "-"}° F`;
}), }),
}), }),
], ],

View File

@@ -13,17 +13,18 @@ export default () => {
child: Widget.Box({ child: Widget.Box({
class_name: "notification-menu-content", class_name: "notification-menu-content",
css: "padding: 1px; margin: -1px;", css: "padding: 1px; margin: -1px;",
hexpand: true,
vexpand: false, vexpand: false,
children: [ children: [
Widget.Box({ Widget.Box({
class_name: "notification-card-container menu", class_name: "notification-card-container menu",
spacing: 0,
vertical: true, vertical: true,
hexpand: false, hexpand: false,
vexpand: false, vexpand: false,
children: [ children: [
Widget.Box({ Widget.Box({
class_name: "notification-menu-controls", class_name: "notification-menu-controls",
expand: false,
vertical: false, vertical: false,
children: [ children: [
Widget.Box({ Widget.Box({
@@ -79,13 +80,10 @@ export default () => {
}), }),
], ],
}), }),
Widget.Separator({
class_name: "menu-separator notifications",
}),
Widget.Box({ Widget.Box({
class_name: "menu-content-container notifications", class_name: "menu-content-container notifications",
hpack: "center", hpack: "center",
expand: false, vexpand: false,
spacing: 0, spacing: 0,
vertical: true, vertical: true,
setup: (self) => { setup: (self) => {
@@ -206,7 +204,7 @@ export default () => {
return Widget.Box({ return Widget.Box({
class_name: "notification-card menu", class_name: "notification-card menu",
vpack: "center", vpack: "center",
hexpand: false, hexpand: true,
children: [ children: [
...imageContainer(notif), ...imageContainer(notif),
Widget.Box({ Widget.Box({

View File

@@ -1,7 +1,7 @@
@import "../colors"; @import "../colors";
.notification-card-container.menu { .notification-card-container.menu {
margin-top: 0em; margin: 0em;
min-width: 26em; min-width: 26em;
min-height: 6em; min-height: 6em;
background: $crust; background: $crust;
@@ -13,19 +13,22 @@
} }
.menu-content-container.notifications { .menu-content-container.notifications {
margin: 1em; margin: 1.35em;
min-height: 4em; min-height: 4em;
} }
.notification-menu-controls { .notification-menu-controls {
margin: 0em 1em; background: $base;
margin-top: 0.6em; margin: 1em 1.3em;
margin-bottom: 0.4em; margin-bottom: 0em;
border-radius: 0.4em;
padding: 0em 0.5em;
} }
.notification-card.menu { .notification-card.menu {
background: $base; background: $base;
border: 0.1em solid $surface0; border: 0.15em solid $base;
border-radius: 0.4em;
margin: 0em; margin: 0em;
} }
@@ -35,12 +38,6 @@
.menu-label.notifications { .menu-label.notifications {
color: $lavender; color: $lavender;
margin: 0em;
}
.menu-separator.notifications {
background-color: $surface0;
margin: 0em 1em;
} }
.menu-separator.notification-controls { .menu-separator.notification-controls {