From 0f6e34412ac63daeff7af6153f63e868dc9743e7 Mon Sep 17 00:00:00 2001 From: Rasmus Rendal Date: Sat, 22 Sep 2018 21:38:32 +0200 Subject: [PATCH 1/6] Added a label to the members list which shows MXID's --- fractal-gtk/res/app.css | 5 +++++ fractal-gtk/src/widgets/members_list.rs | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/fractal-gtk/res/app.css b/fractal-gtk/res/app.css index 15a24d26..825668a7 100644 --- a/fractal-gtk/res/app.css +++ b/fractal-gtk/res/app.css @@ -297,3 +297,8 @@ stack.titlebar:not(headerbar) > box > separator { .devel headerbar:last-child > box > label { color: @theme_fg_color; } + +.uid-label { + color: grey; + font-size: small; +} diff --git a/fractal-gtk/src/widgets/members_list.rs b/fractal-gtk/src/widgets/members_list.rs index 975036e5..94eea4eb 100644 --- a/fractal-gtk/src/widgets/members_list.rs +++ b/fractal-gtk/src/widgets/members_list.rs @@ -126,11 +126,20 @@ fn load_row_content(member: Member) -> gtk::Box { avatar.circle(member.uid.clone(), member.alias.clone(), 40); let user_box = gtk::Box::new(gtk::Orientation::Vertical, 0); let username = gtk::Label::new(Some(member.get_alias().as_str())); + let uid = gtk::Label::new(Some(member.uid.as_str())); + username.set_xalign(0.); + uid.set_xalign(0.); + //let sc = uid.get_style_context(); + if let Some(style) = uid.get_style_context() { + style.add_class("uid-label"); + } + //Some(sc).add_class(Some("hello")); b.set_margin_start(12); b.set_margin_end(12); b.set_margin_top(6); b.set_margin_bottom(6); user_box.pack_start(&username, true, true, 0); + user_box.pack_start(&uid, false, false, 0); /* we don't have this state yet * let state = gtk::Label::new(); * user_box.pack_end(&state, true, true, 0); */ From 03e4da2e3fe3cfd0b25a3750b2dd2190bd2cb4b1 Mon Sep 17 00:00:00 2001 From: Rasmus Rendal Date: Sat, 22 Sep 2018 21:38:32 +0200 Subject: [PATCH 2/6] Added a label to the members list which shows MXID's --- fractal-gtk/res/app.css | 5 +++++ fractal-gtk/src/widgets/members_list.rs | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/fractal-gtk/res/app.css b/fractal-gtk/res/app.css index 15a24d26..825668a7 100644 --- a/fractal-gtk/res/app.css +++ b/fractal-gtk/res/app.css @@ -297,3 +297,8 @@ stack.titlebar:not(headerbar) > box > separator { .devel headerbar:last-child > box > label { color: @theme_fg_color; } + +.uid-label { + color: grey; + font-size: small; +} diff --git a/fractal-gtk/src/widgets/members_list.rs b/fractal-gtk/src/widgets/members_list.rs index 975036e5..9b0effcb 100644 --- a/fractal-gtk/src/widgets/members_list.rs +++ b/fractal-gtk/src/widgets/members_list.rs @@ -126,11 +126,18 @@ fn load_row_content(member: Member) -> gtk::Box { avatar.circle(member.uid.clone(), member.alias.clone(), 40); let user_box = gtk::Box::new(gtk::Orientation::Vertical, 0); let username = gtk::Label::new(Some(member.get_alias().as_str())); + let uid = gtk::Label::new(Some(member.uid.as_str())); + username.set_xalign(0.); + uid.set_xalign(0.); + if let Some(style) = uid.get_style_context() { + style.add_class("uid-label"); + } b.set_margin_start(12); b.set_margin_end(12); b.set_margin_top(6); b.set_margin_bottom(6); user_box.pack_start(&username, true, true, 0); + user_box.pack_start(&uid, false, false, 0); /* we don't have this state yet * let state = gtk::Label::new(); * user_box.pack_end(&state, true, true, 0); */ From 7d9685d61b1ef17c08b3ec2fdd32e5c88765c6f1 Mon Sep 17 00:00:00 2001 From: Rasmus Rendal Date: Sat, 22 Sep 2018 19:46:18 +0000 Subject: [PATCH 3/6] Update members_list.rs --- fractal-gtk/src/widgets/members_list.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/fractal-gtk/src/widgets/members_list.rs b/fractal-gtk/src/widgets/members_list.rs index 94eea4eb..9b0effcb 100644 --- a/fractal-gtk/src/widgets/members_list.rs +++ b/fractal-gtk/src/widgets/members_list.rs @@ -129,11 +129,9 @@ fn load_row_content(member: Member) -> gtk::Box { let uid = gtk::Label::new(Some(member.uid.as_str())); username.set_xalign(0.); uid.set_xalign(0.); - //let sc = uid.get_style_context(); if let Some(style) = uid.get_style_context() { style.add_class("uid-label"); } - //Some(sc).add_class(Some("hello")); b.set_margin_start(12); b.set_margin_end(12); b.set_margin_top(6); From a6109e7f582678a89f1617d2e10a267d2e3923df Mon Sep 17 00:00:00 2001 From: Rasmus Rendal Date: Sun, 23 Sep 2018 10:43:17 +0200 Subject: [PATCH 4/6] Use dim-label instead of another CSS class --- fractal-gtk/res/app.css | 5 ----- fractal-gtk/src/widgets/members_list.rs | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/fractal-gtk/res/app.css b/fractal-gtk/res/app.css index 825668a7..15a24d26 100644 --- a/fractal-gtk/res/app.css +++ b/fractal-gtk/res/app.css @@ -297,8 +297,3 @@ stack.titlebar:not(headerbar) > box > separator { .devel headerbar:last-child > box > label { color: @theme_fg_color; } - -.uid-label { - color: grey; - font-size: small; -} diff --git a/fractal-gtk/src/widgets/members_list.rs b/fractal-gtk/src/widgets/members_list.rs index 9b0effcb..e675de29 100644 --- a/fractal-gtk/src/widgets/members_list.rs +++ b/fractal-gtk/src/widgets/members_list.rs @@ -130,7 +130,7 @@ fn load_row_content(member: Member) -> gtk::Box { username.set_xalign(0.); uid.set_xalign(0.); if let Some(style) = uid.get_style_context() { - style.add_class("uid-label"); + style.add_class("dim-label"); } b.set_margin_start(12); b.set_margin_end(12); From 4772e6f0017e8a92f1fda7df808fdaec59783e2b Mon Sep 17 00:00:00 2001 From: Rasmus Rendal Date: Sun, 23 Sep 2018 10:52:22 +0200 Subject: [PATCH 5/6] Made the text small again --- fractal-gtk/res/app.css | 4 ++++ fractal-gtk/src/widgets/members_list.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/fractal-gtk/res/app.css b/fractal-gtk/res/app.css index 15a24d26..7525583b 100644 --- a/fractal-gtk/res/app.css +++ b/fractal-gtk/res/app.css @@ -297,3 +297,7 @@ stack.titlebar:not(headerbar) > box > separator { .devel headerbar:last-child > box > label { color: @theme_fg_color; } + +.uid-label { + font-size: small; +} diff --git a/fractal-gtk/src/widgets/members_list.rs b/fractal-gtk/src/widgets/members_list.rs index e675de29..8252605c 100644 --- a/fractal-gtk/src/widgets/members_list.rs +++ b/fractal-gtk/src/widgets/members_list.rs @@ -130,6 +130,7 @@ fn load_row_content(member: Member) -> gtk::Box { username.set_xalign(0.); uid.set_xalign(0.); if let Some(style) = uid.get_style_context() { + style.add_class("uid-label"); style.add_class("dim-label"); } b.set_margin_start(12); From e0a91b06ce064d8af420bf3a2492235627a6db77 Mon Sep 17 00:00:00 2001 From: Rasmus Rendal Date: Sun, 23 Sep 2018 10:57:01 +0200 Subject: [PATCH 6/6] Changed the name to small-font, to make it a bit more general --- fractal-gtk/res/app.css | 2 +- fractal-gtk/src/widgets/members_list.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fractal-gtk/res/app.css b/fractal-gtk/res/app.css index 7525583b..9c528be2 100644 --- a/fractal-gtk/res/app.css +++ b/fractal-gtk/res/app.css @@ -298,6 +298,6 @@ stack.titlebar:not(headerbar) > box > separator { color: @theme_fg_color; } -.uid-label { +.small-font { font-size: small; } diff --git a/fractal-gtk/src/widgets/members_list.rs b/fractal-gtk/src/widgets/members_list.rs index 8252605c..a68fe079 100644 --- a/fractal-gtk/src/widgets/members_list.rs +++ b/fractal-gtk/src/widgets/members_list.rs @@ -130,7 +130,7 @@ fn load_row_content(member: Member) -> gtk::Box { username.set_xalign(0.); uid.set_xalign(0.); if let Some(style) = uid.get_style_context() { - style.add_class("uid-label"); + style.add_class("small-font"); style.add_class("dim-label"); } b.set_margin_start(12);