diff options
author | Carson Hicks <[email protected]> | 2025-05-13 23:30:37 -0700 |
---|---|---|
committer | Colomban Wendling <[email protected]> | 2025-05-14 10:26:04 +0200 |
commit | a54d97435fd3f53d803aa5230148ddc024e312df (patch) | |
tree | 8c540750ae08d9cf1e407048d9ecefaba7206c05 | |
parent | f4dcf5220b070d57609c85e6e10eaa638f7ce561 (diff) | |
download | mate-control-center-a54d97435fd3f53d803aa5230148ddc024e312df.tar.bz2 mate-control-center-a54d97435fd3f53d803aa5230148ddc024e312df.tar.xz |
Fix duplicate buttons in font viewer
-rw-r--r-- | font-viewer/font-view.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/font-viewer/font-view.c b/font-viewer/font-view.c index 918d0087..406b051b 100644 --- a/font-viewer/font-view.c +++ b/font-viewer/font-view.c @@ -597,24 +597,33 @@ font_view_application_do_open (FontViewApplication *self, font_view_ensure_model (self); - self->info_button = gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (self->toolbar), - NULL, _("Info"), - FALSE); - g_signal_connect (self->info_button, "clicked", - G_CALLBACK (info_button_clicked_cb), self); + if (self->info_button == NULL) + { + self->info_button = gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (self->toolbar), + NULL, _("Info"), + FALSE); + g_signal_connect (self->info_button, "clicked", + G_CALLBACK (info_button_clicked_cb), self); + } /* add install button */ - self->install_button = gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (self->toolbar), - NULL, _("Install"), - FALSE); - g_signal_connect (self->install_button, "clicked", - G_CALLBACK (install_button_clicked_cb), self); - - self->back_button = gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (self->toolbar), - "go-previous-symbolic", _("Back"), - TRUE); - g_signal_connect (self->back_button, "clicked", - G_CALLBACK (back_button_clicked_cb), self); + if (self->install_button == NULL) + { + self->install_button = gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (self->toolbar), + NULL, _("Install"), + FALSE); + g_signal_connect (self->install_button, "clicked", + G_CALLBACK (install_button_clicked_cb), self); + } + + if (self->back_button == NULL) + { + self->back_button = gd_main_toolbar_add_button (GD_MAIN_TOOLBAR (self->toolbar), + "go-previous-symbolic", _("Back"), + TRUE); + g_signal_connect (self->back_button, "clicked", + G_CALLBACK (back_button_clicked_cb), self); + } gtk_widget_set_vexpand (self->toolbar, FALSE); |