From 3068ea5c20b52de33f604052be9661489d085c53 Mon Sep 17 00:00:00 2001 From: ZouYonghe <1259085392z@gmail.com> Date: Thu, 6 Aug 2026 15:43:12 +0900 Subject: [PATCH 1/2] fix: keep drun grid columns stable --- src/wofi.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/wofi.c b/src/wofi.c index 4b6442f..6edd410 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -402,6 +402,9 @@ static char* parse_images(WofiPropertyBox* box, const char* text, bool create_wi { GtkWidget* label = gtk_label_new(data1); gtk_widget_set_name(label, "text"); + gtk_label_set_max_width_chars(GTK_LABEL(label), 18); + gtk_widget_set_size_request(GTK_WIDGET(label), 180, -1); + gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END); gtk_label_set_use_markup(GTK_LABEL(label), allow_markup); gtk_label_set_xalign(GTK_LABEL(label), 0); if(line_wrap >= 0) @@ -433,6 +436,9 @@ static char* parse_images(WofiPropertyBox* box, const char* text, bool create_wi free(filename); gtk_widget_set_name(label, "text"); + gtk_label_set_max_width_chars(GTK_LABEL(label), 18); + gtk_widget_set_size_request(GTK_WIDGET(label), 180, -1); + gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END); gtk_label_set_use_markup(GTK_LABEL(label), allow_markup); gtk_label_set_xalign(GTK_LABEL(label), 0); if(line_wrap >= 0) @@ -577,6 +583,9 @@ static GtkWidget* create_label(char* mode, char* text, char* search_text, char* } else { GtkWidget* label = gtk_label_new(text); gtk_widget_set_name(label, "text"); + gtk_label_set_max_width_chars(GTK_LABEL(label), 18); + gtk_widget_set_size_request(GTK_WIDGET(label), 180, -1); + gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_END); gtk_label_set_use_markup(GTK_LABEL(label), allow_markup); gtk_label_set_xalign(GTK_LABEL(label), 0); if(line_wrap >= 0) { @@ -757,6 +766,9 @@ static gboolean _insert_widget(gpointer data) { gtk_widget_set_halign(parent, content_halign); GtkWidget* child = gtk_flow_box_child_new(); gtk_widget_set_name(child, "entry"); + if(columns > 0 && width > columns * 16) { + gtk_widget_set_size_request(child, (width - columns * 16) / columns, -1); + } g_signal_connect(child, "size-allocate", G_CALLBACK(widget_allocate), NULL); gtk_container_add(GTK_CONTAINER(child), parent); @@ -1851,7 +1863,6 @@ void wofi_init(struct map* _config) { y = map_get(config, "y"); bool normal_window = strcmp(config_get(config, "normal_window", "false"), "true") == 0; char* mode = map_get(config, "mode"); - GtkOrientation orientation = config_get_mnemonic(config, "orientation", "vertical", 2, "vertical", "horizontal"); outer_orientation = config_get_mnemonic(config, "orientation", "vertical", 2, "horizontal", "vertical"); GtkAlign halign = config_get_mnemonic(config, "halign", "fill", 4, "fill", "start", "end", "center"); content_halign = config_get_mnemonic(config, "content_halign", "fill", 4, "fill", "start", "end", "center"); @@ -2163,8 +2174,10 @@ void wofi_init(struct map* _config) { inner_box = gtk_flow_box_new(); gtk_flow_box_set_selection_mode(GTK_FLOW_BOX(inner_box), GTK_SELECTION_BROWSE); + gtk_flow_box_set_homogeneous(GTK_FLOW_BOX(inner_box), TRUE); gtk_flow_box_set_max_children_per_line(GTK_FLOW_BOX(inner_box), columns); - gtk_orientable_set_orientation(GTK_ORIENTABLE(inner_box), orientation); + gtk_flow_box_set_min_children_per_line(GTK_FLOW_BOX(inner_box), columns); + gtk_orientable_set_orientation(GTK_ORIENTABLE(inner_box), outer_orientation == GTK_ORIENTATION_VERTICAL ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL); gtk_widget_set_halign(inner_box, halign); gtk_widget_set_valign(inner_box, valign); From 6609e29d932ac7f8509de93605658140331a471d Mon Sep 17 00:00:00 2001 From: ZouYonghe <1259085392z@gmail.com> Date: Thu, 6 Aug 2026 15:47:16 +0900 Subject: [PATCH 2/2] fix: reserve space for launcher icons --- src/widget_builder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widget_builder.c b/src/widget_builder.c index 31fbc85..fd703a5 100644 --- a/src/widget_builder.c +++ b/src/widget_builder.c @@ -107,6 +107,7 @@ void wofi_widget_builder_insert_image_with_list(struct widget_builder* builder, cairo_surface_destroy(surface); gtk_container_add(GTK_CONTAINER(builder->box), img); gtk_widget_set_name(img, "img"); + gtk_widget_set_size_request(img, wofi_get_image_size(), wofi_get_image_size()); GtkStyleContext* ctx = gtk_widget_get_style_context(img);