💅 style(notification): improve notification widget appearance with ellipsization and padding
This commit is contained in:
2 files changed
+41
-35
No files matched your search
@@ -119,7 +119,8 @@ class NotificationWidget(Box):
|
|||||||
children=[
|
children=[
|
||||||
Label(
|
Label(
|
||||||
markup=self._notification.summary, # type: ignore
|
markup=self._notification.summary, # type: ignore
|
||||||
ellipsization="middle",
|
ellipsization="end",
|
||||||
|
max_chars_width=20,
|
||||||
style_classes="summary",
|
style_classes="summary",
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -128,9 +129,11 @@ class NotificationWidget(Box):
|
|||||||
),
|
),
|
||||||
Label(
|
Label(
|
||||||
label=self._notification.body, # type: ignore
|
label=self._notification.body, # type: ignore
|
||||||
line_wrap="word-char",
|
# line_wrap="word-char",
|
||||||
v_align="start",
|
v_align="start",
|
||||||
h_align="start",
|
h_align="start",
|
||||||
|
ellipsization="end",
|
||||||
|
max_chars_width=34,
|
||||||
style_classes="body",
|
style_classes="body",
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
+36
-33
@@ -1,60 +1,63 @@
|
|||||||
|
|
||||||
#notification {
|
#notification {
|
||||||
padding: 0.8rem;
|
padding: 16px;
|
||||||
background-color: alpha(#000, 0.3);
|
background-color: alpha(#000, 0.3);
|
||||||
border: .5px solid alpha(#111, 0.4);
|
border: 0.5px solid alpha(#111, 0.4);
|
||||||
box-shadow: inset 0 0 200px 0 alpha(#111, 0.5), inset 0 0 0 .5px alpha(#aaa, 0.4);
|
box-shadow:
|
||||||
border-radius: 1.2rem;
|
inset 0 0 200px 0 alpha(#111, 0.5),
|
||||||
|
inset 0 0 0 0.5px alpha(#aaa, 0.4);
|
||||||
|
border-radius: 20px;
|
||||||
|
margin: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#notification .summary {
|
#notification .summary {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
#notification .body {
|
#notification .body {
|
||||||
color: #ddd;
|
color: #ddd;
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
#noti-image {
|
#noti-image {
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#env-noti-center {
|
#env-noti-center {
|
||||||
border-radius: 1.25rem;
|
border-radius: 1.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#notification-action{
|
#notification-action {
|
||||||
background-color: #e0e0e0;
|
background-color: #e0e0e0;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
padding: 6px 12px;
|
padding: 6px 12px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 0.9rem;
|
font-size: 0.9rem;
|
||||||
transition: background-color 0.2s ease, color 0.2s ease;
|
transition:
|
||||||
|
background-color 0.2s ease,
|
||||||
|
color 0.2s ease;
|
||||||
}
|
}
|
||||||
#notification-action label {
|
#notification-action label {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
}
|
}
|
||||||
#notification-action:hover label {
|
#notification-action:hover label {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#noti-image image{
|
#noti-image image {
|
||||||
border-radius: 25px;
|
border-radius: 25px;
|
||||||
}
|
}
|
||||||
#notification-action:hover {
|
#notification-action:hover {
|
||||||
background-color: #007aff; /* macOS-style blue */
|
background-color: #007aff; /* macOS-style blue */
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#notification-center {
|
#notification-center {
|
||||||
background-color: alpha(#000, 0.3);
|
background-color: alpha(#000, 0.3);
|
||||||
box-shadow: inset 0 0 0 1px alpha(#aaa, 0.4);
|
box-shadow: inset 0 0 0 1px alpha(#aaa, 0.4);
|
||||||
border: 1px solid alpha(#111, 0.4);
|
border: 1px solid alpha(#111, 0.4);
|
||||||
border-radius: 1.25rem;
|
border-radius: 1.25rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user