diff --git a/data/resources/resources.gresource.xml b/data/resources/resources.gresource.xml
index 5acbb7e1..f83e2946 100644
--- a/data/resources/resources.gresource.xml
+++ b/data/resources/resources.gresource.xml
@@ -17,6 +17,7 @@
ui/sidebar-room-row.ui
ui/window.ui
ui/context-menu-bin.ui
+ ui/user-pill.ui
style.css
icons/scalable/actions/send-symbolic.svg
icons/scalable/status/welcome.svg
diff --git a/data/resources/style.css b/data/resources/style.css
index 584ff678..5d46ab2c 100644
--- a/data/resources/style.css
+++ b/data/resources/style.css
@@ -3,6 +3,12 @@
font-weight: bold;
}
+.user-pill {
+ border-radius: 9999px;
+ background-color: alpha(@theme_text_color, 0.1);
+ padding-right: 6px;
+}
+
/* Login */
.login {
min-width: 250px;
diff --git a/data/resources/ui/user-pill.ui b/data/resources/ui/user-pill.ui
new file mode 100644
index 00000000..aff200ae
--- /dev/null
+++ b/data/resources/ui/user-pill.ui
@@ -0,0 +1,32 @@
+
+
+
+ True
+
+
+
+
+
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1ef516a9..28385a3c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -21,12 +21,14 @@ data/resources/ui/sidebar-category-row.ui
data/resources/ui/sidebar-item.ui
data/resources/ui/sidebar-room-row.ui
data/resources/ui/sidebar.ui
+data/resources/ui/user-pill.ui
data/resources/ui/window.ui
# Rust files
src/application.rs
src/components/context_menu_bin.rs
src/components/mod.rs
+src/components/user_pill.rs
src/login.rs
src/main.rs
src/secret.rs
diff --git a/src/components/mod.rs b/src/components/mod.rs
index 8ea2852e..05615c7f 100644
--- a/src/components/mod.rs
+++ b/src/components/mod.rs
@@ -1,3 +1,5 @@
mod context_menu_bin;
+mod user_pill;
pub use self::context_menu_bin::{ContextMenuBin, ContextMenuBinImpl};
+pub use self::user_pill::UserPill;
diff --git a/src/components/user_pill.rs b/src/components/user_pill.rs
new file mode 100644
index 00000000..cfe92d4e
--- /dev/null
+++ b/src/components/user_pill.rs
@@ -0,0 +1,111 @@
+use adw::subclass::prelude::*;
+use gtk::prelude::*;
+use gtk::subclass::prelude::*;
+use gtk::{glib, CompositeTemplate};
+
+use crate::session::User;
+
+mod imp {
+ use super::*;
+ use glib::subclass::InitializingObject;
+ use std::cell::RefCell;
+
+ #[derive(Debug, Default, CompositeTemplate)]
+ #[template(resource = "/org/gnome/FractalNext/user-pill.ui")]
+ pub struct UserPill {
+ /// The user displayed by this widget
+ pub user: RefCell