2 Commits

Author SHA1 Message Date
214c9e3376 Fix input box text spacing in GTK CSS 2026-03-26 17:23:40 -06:00
6a7f44a1fb Fix topic wrap spacing in topic bar 2026-03-26 15:49:56 -06:00
2 changed files with 17 additions and 0 deletions

View File

@@ -1410,16 +1410,26 @@ mg_populate (session *sess)
{ {
GtkTextBuffer *topic_buffer; GtkTextBuffer *topic_buffer;
GtkTextIter start;
GtkTextIter end;
topic_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (gui->topic_entry)); topic_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (gui->topic_entry));
gtk_text_buffer_set_text (topic_buffer, res->topic_text, -1); gtk_text_buffer_set_text (topic_buffer, res->topic_text, -1);
gtk_text_buffer_get_bounds (topic_buffer, &start, &end);
gtk_text_buffer_apply_tag_by_name (topic_buffer, "zoitechat-topic-left", &start, &end);
g_free (res->topic_text); g_free (res->topic_text);
res->topic_text = NULL; res->topic_text = NULL;
} else } else
{ {
GtkTextBuffer *topic_buffer; GtkTextBuffer *topic_buffer;
GtkTextIter start;
GtkTextIter end;
topic_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (gui->topic_entry)); topic_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (gui->topic_entry));
gtk_text_buffer_set_text (topic_buffer, "", -1); gtk_text_buffer_set_text (topic_buffer, "", -1);
gtk_text_buffer_get_bounds (topic_buffer, &start, &end);
gtk_text_buffer_apply_tag_by_name (topic_buffer, "zoitechat-topic-left", &start, &end);
} }
mg_restore_speller (gui->input_box, &res->input_text); mg_restore_speller (gui->input_box, &res->input_text);
mg_restore_entry (gui->key_entry, &res->key_text); mg_restore_entry (gui->key_entry, &res->key_text);
@@ -2990,8 +3000,11 @@ mg_create_topicbar (session *sess, GtkWidget *box)
gui->topic_entry = topic = gtk_text_view_new (); gui->topic_entry = topic = gtk_text_view_new ();
gtk_widget_set_name (topic, "zoitechat-inputbox"); gtk_widget_set_name (topic, "zoitechat-inputbox");
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (topic), GTK_WRAP_WORD_CHAR); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (topic), GTK_WRAP_WORD_CHAR);
gtk_text_view_set_justification (GTK_TEXT_VIEW (topic), GTK_JUSTIFY_LEFT);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (topic), 4); gtk_text_view_set_left_margin (GTK_TEXT_VIEW (topic), 4);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (topic), 4); gtk_text_view_set_right_margin (GTK_TEXT_VIEW (topic), 4);
gtk_text_buffer_create_tag (gtk_text_view_get_buffer (GTK_TEXT_VIEW (topic)), "zoitechat-topic-left",
"justification", GTK_JUSTIFY_LEFT, NULL);
gtk_box_pack_start (GTK_BOX (hbox), topic, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), topic, TRUE, TRUE, 0);
mg_apply_emoji_fallback_widget (topic); mg_apply_emoji_fallback_widget (topic);
gtk_widget_add_events (topic, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | gtk_widget_add_events (topic, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |

View File

@@ -167,10 +167,14 @@ theme_css_build_input (const char *theme_name, guint16 fg_red, guint16 fg_green,
"background-color: #%02x%02x%02x;" "background-color: #%02x%02x%02x;"
"color: #%02x%02x%02x;" "color: #%02x%02x%02x;"
"caret-color: #%02x%02x%02x;" "caret-color: #%02x%02x%02x;"
"word-spacing: normal;"
"letter-spacing: normal;"
"}" "}"
"%s {" "%s {"
"color: #%02x%02x%02x;" "color: #%02x%02x%02x;"
"caret-color: #%02x%02x%02x;" "caret-color: #%02x%02x%02x;"
"word-spacing: normal;"
"letter-spacing: normal;"
"}" "}"
"%s selection, %s text selection, %s:focus selection, %s:focus text selection, %s *:selected, %s *:selected:focus {" "%s selection, %s text selection, %s:focus selection, %s:focus text selection, %s *:selected, %s *:selected:focus {"
"background-color: #%02x%02x%02x;" "background-color: #%02x%02x%02x;"