From ebeeacce3a46eb78272b7009fb087132a4b97449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 27 Nov 2026 21:18:53 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20+=20beside=20the=20wordmark?= =?UTF-8?q?=20creates=20a=20community=20(was=20only=20a=20hidden=20right-c?= =?UTF-8?q?lick=20on=20the=20wordmark)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/client/src/gui/sidebar.rs | 51 +++++++++++++++----------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/crates/client/src/gui/sidebar.rs b/crates/client/src/gui/sidebar.rs index 94733c7..9826613 100644 --- a/crates/client/src/gui/sidebar.rs +++ b/crates/client/src/gui/sidebar.rs @@ -114,9 +114,15 @@ impl Yumush { .text_size(text(text::TITLE)) .font_weight(FontWeight::SEMIBOLD) .text_color(palette.text) - .context_menu(new_community_menu(entity)) .child("yumuß"), ) + .child(icon_button( + "new_community_button", + palette, + IconName::Plus, + "New community", + new_community(entity), + )) .child( div() .relative() @@ -1152,33 +1158,24 @@ fn matches_query(name: &str, query: &str) -> bool { name.to_lowercase().contains(query) } -fn new_community_menu( - entity: &Entity, -) -> impl Fn(PopupMenu, &mut Window, &mut Context) -> PopupMenu + 'static { +fn new_community(entity: &Entity) -> impl Fn(&mut Window, &mut App) + 'static { let entity = entity.clone(); - - move |menu, _, _| { - let entity = entity.clone(); - - menu.item( - PopupMenuItem::new("New community").on_click(move |_, window, cx| { - entity.update(cx, |_, cx| { - input_dialog( - "New community", - "Create", - "Name...", - window, - cx, - |this, name, window, cx| { - let name = name.trim().to_string(); - if validate_community_name(&name).is_ok() { - create_community(this, name, window, cx); - } - }, - ); - }); - }), - ) + move |window, cx| { + entity.update(cx, |_, cx| { + input_dialog( + "New community", + "Create", + "Name...", + window, + cx, + |this, name, window, cx| { + let name = name.trim().to_string(); + if validate_community_name(&name).is_ok() { + create_community(this, name, window, cx); + } + }, + ); + }) } }