Use GtkTextView instead of GtkLabel in startup big_label()

This commit is contained in:
Geoffrey D. Bennett
2024-01-22 19:34:26 +10:30
parent 4b340b4d4c
commit 9fc4c7c6e1
2 changed files with 17 additions and 5 deletions

View File

@@ -215,6 +215,16 @@ button.sw-hw:checked {
border-color: #303030; border-color: #303030;
} }
/* Textview used for long descriptions in the startup window */
textview {
color: #ffffff;
background: none;
}
textview > text {
background: none;
}
/* Bigger buttons in the startup window */ /* Bigger buttons in the startup window */
.window-startup button { .window-startup button {
padding: 5px; padding: 5px;

View File

@@ -18,14 +18,16 @@ static GtkWidget *small_label(char *text) {
} }
static GtkWidget *big_label(char *text) { static GtkWidget *big_label(char *text) {
GtkWidget *w = gtk_label_new(text); GtkWidget *view = gtk_text_view_new ();
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_widget_set_halign(w, GTK_ALIGN_START); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD);
gtk_widget_set_size_request (view, 600, -1);
gtk_widget_set_sensitive (view, FALSE);
gtk_label_set_wrap(GTK_LABEL(w), true); gtk_text_buffer_set_text (buffer, text, -1);
gtk_label_set_max_width_chars(GTK_LABEL(w), 60);
return w; return view;
} }
static void add_sep(GtkWidget *grid, int *grid_y) { static void add_sep(GtkWidget *grid, int *grid_y) {