diff options
Diffstat (limited to 'src/gui/panels/welcome.c')
-rw-r--r-- | src/gui/panels/welcome.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/gui/panels/welcome.c b/src/gui/panels/welcome.c index d10b16a..3cd349f 100644 --- a/src/gui/panels/welcome.c +++ b/src/gui/panels/welcome.c @@ -280,6 +280,8 @@ bool gtk_welcome_panel_create(GtkWelcomePanel *panel) { bool result; /* Bilan à retourner */ int min; /* Taille à gauche minimale */ + GtkConstraintLayout *layout; /* Disposition fixant la taille*/ + GtkConstraint *constraint; /* Contrainte à considérer */ /* Constitution de la liste des démarreurs */ @@ -289,8 +291,6 @@ bool gtk_welcome_panel_create(GtkWelcomePanel *panel) (GtkListBoxCreateWidgetFunc)gtk_welcome_panel_create_launcher_widget, NULL, NULL); - - /* Dimensionnement de la zone d'astuces */ gtk_widget_measure(GTK_WIDGET(panel->list), GTK_ORIENTATION_HORIZONTAL, -1, &min, NULL, NULL, NULL); @@ -298,7 +298,32 @@ bool gtk_welcome_panel_create(GtkWelcomePanel *panel) if (min > 150) min -= 150; - g_object_set(G_OBJECT(panel->hints), "width-request", min, NULL); + layout = GTK_CONSTRAINT_LAYOUT(gtk_widget_get_layout_manager(GTK_WIDGET(panel->hints))); + + gtk_constraint_layout_remove_all_constraints(layout); + + constraint = gtk_constraint_new_constant(NULL, + GTK_CONSTRAINT_ATTRIBUTE_LEFT, + GTK_CONSTRAINT_RELATION_EQ, + 0, + GTK_CONSTRAINT_STRENGTH_REQUIRED); + gtk_constraint_layout_add_constraint(layout, constraint); + + constraint = gtk_constraint_new_constant(NULL, + GTK_CONSTRAINT_ATTRIBUTE_TOP, + GTK_CONSTRAINT_RELATION_EQ, + 0, + GTK_CONSTRAINT_STRENGTH_REQUIRED); + gtk_constraint_layout_add_constraint(layout, constraint); + + constraint = gtk_constraint_new_constant(NULL, + GTK_CONSTRAINT_ATTRIBUTE_RIGHT, + GTK_CONSTRAINT_RELATION_EQ, + min, + GTK_CONSTRAINT_STRENGTH_REQUIRED); + gtk_constraint_layout_add_constraint(layout, constraint); + + /* Premier affichage */ gtk_label_set_markup(panel->hints, panel->raw_hints[panel->cur_hint]); |