colordialogbutton: Sync color

Make sure the color of the swatch and the button
are initially in sync. As a side-effect, this
ensures that the swatch has its accessible label
computed at the outset.
This commit is contained in:
Matthias Clasen
2023-06-17 11:37:22 -04:00
parent 115f60796f
commit 80c4d4f51d

View File

@@ -141,6 +141,8 @@ gtk_color_dialog_button_init (GtkColorDialogButton *self)
GTK_PHASE_CAPTURE);
gtk_widget_add_controller (self->button, GTK_EVENT_CONTROLLER (source));
gtk_widget_add_css_class (self->button, "color");
gtk_color_dialog_button_set_rgba (self, &(GdkRGBA) { 0.75, 0.25, 0.25, 1.0 });
}
static void