[fractal/fractal-next] components: rename UserPill to Pill
- From: Julian Sparber <jsparber src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/fractal-next] components: rename UserPill to Pill
- Date: Mon, 31 May 2021 14:24:37 +0000 (UTC)
commit e214c309379324f2e5f59f5b0d7ba8770da8a008
Author: Julian Sparber <julian sparber net>
Date: Fri May 28 15:18:10 2021 +0200
components: rename UserPill to Pill
data/resources/resources.gresource.xml | 2 +-
data/resources/style.css | 4 ++--
data/resources/ui/content-invite.ui | 2 +-
data/resources/ui/{user-pill.ui => pill.ui} | 4 ++--
po/POTFILES.in | 4 ++--
src/components/mod.rs | 4 ++--
src/components/{user_pill.rs => pill.rs} | 30 ++++++++++++++---------------
src/meson.build | 2 +-
src/session/content/invite.rs | 4 ++--
9 files changed, 28 insertions(+), 28 deletions(-)
---
diff --git a/data/resources/resources.gresource.xml b/data/resources/resources.gresource.xml
index 7e7b6a2b..23a37a07 100644
--- a/data/resources/resources.gresource.xml
+++ b/data/resources/resources.gresource.xml
@@ -18,7 +18,7 @@
<file compressed="true" preprocess="xml-stripblanks"
alias="sidebar-room-row.ui">ui/sidebar-room-row.ui</file>
<file compressed="true" preprocess="xml-stripblanks" alias="window.ui">ui/window.ui</file>
<file compressed="true" preprocess="xml-stripblanks"
alias="context-menu-bin.ui">ui/context-menu-bin.ui</file>
- <file compressed="true" preprocess="xml-stripblanks" alias="user-pill.ui">ui/user-pill.ui</file>
+ <file compressed="true" preprocess="xml-stripblanks" alias="pill.ui">ui/pill.ui</file>
<file compressed="true" preprocess="xml-stripblanks"
alias="spinner-button.ui">ui/spinner-button.ui</file>
<file compressed="true">style.css</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/send-symbolic.svg</file>
diff --git a/data/resources/style.css b/data/resources/style.css
index 294d5bac..4f385eea 100644
--- a/data/resources/style.css
+++ b/data/resources/style.css
@@ -8,13 +8,13 @@
padding: 12px 40px;
}
-.user-pill {
+.pill {
border-radius: 9999px;
background-color: alpha(@theme_text_color, 0.1);
padding-right: 6px;
}
-.app-notification .user-pill {
+.app-notification .pill {
background-color: alpha(@theme_fg_color, 0.35);
}
diff --git a/data/resources/ui/content-invite.ui b/data/resources/ui/content-invite.ui
index 4902d65b..50fae5d6 100644
--- a/data/resources/ui/content-invite.ui
+++ b/data/resources/ui/content-invite.ui
@@ -83,7 +83,7 @@
<object class="GtkBox">
<property name="halign">center</property>
<child>
- <object class="UserPill" id="inviter">
+ <object class="Pill" id="inviter">
<binding name="user">
<lookup name="inviter">
<lookup name="room">ContentInvite</lookup>
diff --git a/data/resources/ui/user-pill.ui b/data/resources/ui/pill.ui
similarity index 91%
rename from data/resources/ui/user-pill.ui
rename to data/resources/ui/pill.ui
index fe06abff..8a51ec22 100644
--- a/data/resources/ui/user-pill.ui
+++ b/data/resources/ui/pill.ui
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <template class="UserPill" parent="AdwBin">
+ <template class="Pill" parent="AdwBin">
<property name="focusable">True</property>
<property name="valign">center</property>
<style>
- <class name="user-pill"/>
+ <class name="pill"/>
</style>
<child>
<object class="GtkBox">
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a4f5e6a3..18323249 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -23,7 +23,7 @@ data/resources/ui/sidebar-item.ui
data/resources/ui/sidebar-room-row.ui
data/resources/ui/sidebar.ui
data/resources/ui/spinner-button.ui
-data/resources/ui/user-pill.ui
+data/resources/ui/pill.ui
data/resources/ui/window.ui
# Rust files
@@ -31,7 +31,7 @@ src/application.rs
src/components/context_menu_bin.rs
src/components/mod.rs
src/components/spinner_button.rs
-src/components/user_pill.rs
+src/components/pill.rs
src/login.rs
src/main.rs
src/secret.rs
diff --git a/src/components/mod.rs b/src/components/mod.rs
index d5fdf081..1db7ca05 100644
--- a/src/components/mod.rs
+++ b/src/components/mod.rs
@@ -1,7 +1,7 @@
mod context_menu_bin;
+mod pill;
mod spinner_button;
-mod user_pill;
pub use self::context_menu_bin::{ContextMenuBin, ContextMenuBinImpl};
+pub use self::pill::Pill;
pub use self::spinner_button::SpinnerButton;
-pub use self::user_pill::UserPill;
diff --git a/src/components/user_pill.rs b/src/components/pill.rs
similarity index 86%
rename from src/components/user_pill.rs
rename to src/components/pill.rs
index 723e9874..7ff1668c 100644
--- a/src/components/user_pill.rs
+++ b/src/components/pill.rs
@@ -11,8 +11,8 @@ mod imp {
use std::cell::RefCell;
#[derive(Debug, Default, CompositeTemplate)]
- #[template(resource = "/org/gnome/FractalNext/user-pill.ui")]
- pub struct UserPill {
+ #[template(resource = "/org/gnome/FractalNext/pill.ui")]
+ pub struct Pill {
/// The user displayed by this widget
pub user: RefCell<Option<User>>,
/// The room displayed by this widget
@@ -25,9 +25,9 @@ mod imp {
}
#[glib::object_subclass]
- impl ObjectSubclass for UserPill {
- const NAME: &'static str = "UserPill";
- type Type = super::UserPill;
+ impl ObjectSubclass for Pill {
+ const NAME: &'static str = "Pill";
+ type Type = super::Pill;
type ParentType = adw::Bin;
fn class_init(klass: &mut Self::Class) {
@@ -39,7 +39,7 @@ mod imp {
}
}
- impl ObjectImpl for UserPill {
+ impl ObjectImpl for Pill {
fn properties() -> &'static [glib::ParamSpec] {
use once_cell::sync::Lazy;
static PROPERTIES: Lazy<Vec<glib::ParamSpec>> = Lazy::new(|| {
@@ -87,24 +87,24 @@ mod imp {
}
}
- impl WidgetImpl for UserPill {}
+ impl WidgetImpl for Pill {}
- impl BinImpl for UserPill {}
+ impl BinImpl for Pill {}
}
glib::wrapper! {
- pub struct UserPill(ObjectSubclass<imp::UserPill>)
+ pub struct Pill(ObjectSubclass<imp::Pill>)
@extends gtk::Widget, adw::Bin, @implements gtk::Accessible;
}
/// A widget displaying a `User`
-impl UserPill {
+impl Pill {
pub fn new() -> Self {
- glib::Object::new(&[]).expect("Failed to create UserPill")
+ glib::Object::new(&[]).expect("Failed to create Pill")
}
pub fn set_user(&self, user: Option<User>) {
- let priv_ = imp::UserPill::from_instance(self);
+ let priv_ = imp::Pill::from_instance(self);
if *priv_.user.borrow() == user {
return;
@@ -130,12 +130,12 @@ impl UserPill {
}
pub fn user(&self) -> Option<User> {
- let priv_ = imp::UserPill::from_instance(self);
+ let priv_ = imp::Pill::from_instance(self);
priv_.user.borrow().clone()
}
pub fn set_room(&self, room: Option<Room>) {
- let priv_ = imp::UserPill::from_instance(self);
+ let priv_ = imp::Pill::from_instance(self);
if *priv_.room.borrow() == room {
return;
@@ -161,7 +161,7 @@ impl UserPill {
}
pub fn room(&self) -> Option<Room> {
- let priv_ = imp::UserPill::from_instance(self);
+ let priv_ = imp::Pill::from_instance(self);
priv_.room.borrow().clone()
}
}
diff --git a/src/meson.build b/src/meson.build
index 391d63ae..a14a4c88 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -22,7 +22,7 @@ sources = files(
'application.rs',
'components/context_menu_bin.rs',
'components/mod.rs',
- 'components/user_pill.rs',
+ 'components/pill.rs',
'components/spinner_button.rs',
'config.rs',
'main.rs',
diff --git a/src/session/content/invite.rs b/src/session/content/invite.rs
index 3b3fa2c8..e08456f1 100644
--- a/src/session/content/invite.rs
+++ b/src/session/content/invite.rs
@@ -1,5 +1,5 @@
use crate::{
- components::{SpinnerButton, UserPill},
+ components::{Pill, SpinnerButton},
session::{categories::CategoryType, room::Room},
};
use adw::subclass::prelude::*;
@@ -40,7 +40,7 @@ mod imp {
type ParentType = adw::Bin;
fn class_init(klass: &mut Self::Class) {
- UserPill::static_type();
+ Pill::static_type();
SpinnerButton::static_type();
Self::bind_template(klass);
klass.set_accessible_role(gtk::AccessibleRole::Group);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]