Wrap text into new lines and improve view of moderated communities
This commit is contained in:
parent
d7c546a36f
commit
bfe570a0fc
|
@ -77,6 +77,7 @@ impl FactoryComponent for CommentRow {
|
|||
#[watch]
|
||||
set_markup: &markdown_to_pango_markup(self.comment.comment.content.clone()),
|
||||
set_halign: gtk::Align::Start,
|
||||
set_wrap: true,
|
||||
set_use_markup: true,
|
||||
},
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ impl SimpleComponent for CommunityPage {
|
|||
#[watch]
|
||||
set_markup: &markdown_to_pango_markup(model.info.community.description.clone().unwrap_or("".to_string())),
|
||||
set_use_markup: true,
|
||||
set_wrap: true,
|
||||
},
|
||||
gtk::Box {
|
||||
set_orientation: gtk::Orientation::Horizontal,
|
||||
|
|
|
@ -47,6 +47,7 @@ impl FactoryComponent for MentionRow {
|
|||
set_label: &self.comment.post.name,
|
||||
add_css_class: "font-bold",
|
||||
set_halign: gtk::Align::Start,
|
||||
set_wrap: true,
|
||||
add_controller = gtk::GestureClick {
|
||||
connect_pressed[sender] => move |_, _, _, _| {
|
||||
sender.input(MentionRowMsg::OpenCommunity);
|
||||
|
@ -98,6 +99,7 @@ impl FactoryComponent for MentionRow {
|
|||
gtk::Label {
|
||||
#[watch]
|
||||
set_markup: &markdown_to_pango_markup(self.comment.comment.content.clone()),
|
||||
set_wrap: true,
|
||||
set_halign: gtk::Align::Start,
|
||||
set_use_markup: true,
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@ use lemmy_api_common::lemmy_db_views_actor::structs::CommunityModeratorView;
|
|||
use relm4::prelude::*;
|
||||
use relm4_components::web_image::WebImage;
|
||||
|
||||
use crate::util::get_web_image_url;
|
||||
use crate::util::{get_web_image_url, markdown_to_pango_markup};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ModeratesRow {
|
||||
|
@ -65,11 +65,15 @@ impl FactoryComponent for ModeratesRow {
|
|||
},
|
||||
|
||||
gtk::Label {
|
||||
set_label: &self.community.community.description.clone().unwrap_or("".to_string()),
|
||||
set_label: &markdown_to_pango_markup(self.community.community.description.clone().unwrap_or("".to_string())),
|
||||
set_use_markup: true,
|
||||
set_wrap: true,
|
||||
set_halign: gtk::Align::Start,
|
||||
},
|
||||
|
||||
gtk::Separator {}
|
||||
gtk::Separator {
|
||||
set_margin_bottom: 10,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -70,11 +70,13 @@ impl SimpleComponent for PostPage {
|
|||
gtk::Label {
|
||||
#[watch]
|
||||
set_text: &model.info.post_view.post.name,
|
||||
set_wrap: true,
|
||||
add_css_class: "font-very-bold",
|
||||
},
|
||||
gtk::Label {
|
||||
#[watch]
|
||||
set_markup: &markdown_to_pango_markup(model.info.post_view.post.body.clone().unwrap_or("".to_string())),
|
||||
set_wrap: true,
|
||||
set_margin_top: 10,
|
||||
set_use_markup: true,
|
||||
},
|
||||
|
|
|
@ -79,6 +79,7 @@ impl FactoryComponent for PostRow {
|
|||
gtk::Label {
|
||||
set_halign: gtk::Align::Start,
|
||||
set_text: &self.post.post.name,
|
||||
set_wrap: true,
|
||||
add_css_class: "font-bold",
|
||||
add_controller = gtk::GestureClick {
|
||||
connect_pressed[sender] => move |_, _, _, _| {
|
||||
|
|
|
@ -60,6 +60,7 @@ impl FactoryComponent for PrivateMessageRow {
|
|||
gtk::Label {
|
||||
#[watch]
|
||||
set_markup: &markdown_to_pango_markup(self.message.private_message.content.clone()),
|
||||
set_wrap: true,
|
||||
set_halign: gtk::Align::Start,
|
||||
set_use_markup: true,
|
||||
},
|
||||
|
|
|
@ -63,6 +63,7 @@ impl SimpleComponent for ProfilePage {
|
|||
gtk::Label {
|
||||
#[watch]
|
||||
set_markup: &markdown_to_pango_markup(model.info.person_view.person.bio.clone().unwrap_or("".to_string())),
|
||||
set_wrap: true,
|
||||
set_use_markup: true,
|
||||
},
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ use components::{
|
|||
instances_page::{InstancesPage, InstancesPageInput},
|
||||
post_page::{self, PostPage},
|
||||
post_row::PostRow,
|
||||
profile_page::{ProfilePage, ProfileInput},
|
||||
profile_page::{ProfileInput, ProfilePage},
|
||||
};
|
||||
use dialogs::about::AboutDialog;
|
||||
use gtk::prelude::*;
|
||||
|
@ -206,6 +206,7 @@ impl SimpleComponent for App {
|
|||
gtk::Label {
|
||||
#[watch]
|
||||
set_text: &model.message.clone().unwrap_or("".to_string()),
|
||||
set_wrap: true,
|
||||
},
|
||||
gtk::Button {
|
||||
set_label: "Go back",
|
||||
|
@ -406,7 +407,9 @@ impl SimpleComponent for App {
|
|||
}
|
||||
AppMsg::OpenPerson(person_id) => {
|
||||
self.state = AppState::Loading;
|
||||
self.profile_page.sender().emit(ProfileInput::FetchPerson(Some(person_id)));
|
||||
self.profile_page
|
||||
.sender()
|
||||
.emit(ProfileInput::FetchPerson(Some(person_id)));
|
||||
}
|
||||
AppMsg::OpenCommunity(community_id) => {
|
||||
self.state = AppState::Loading;
|
||||
|
|
Loading…
Reference in New Issue