Improve about window

This commit is contained in:
daleclack 2023-06-10 08:27:32 +08:00
parent 7acfba3552
commit 001175d550
3 changed files with 12 additions and 4 deletions

View File

@ -53,7 +53,7 @@ static void about_activated(GSimpleAction *action,
char *copyright;
copyright = g_strdup_printf("©2019—%04d The Xe Project", local->tm_year + 1900);
btnlaunch_clicked(NULL, MY_DOCK(dock));
hide_launchpad(MY_DOCK(dock));
// Show the about dialog
gtk_show_about_dialog(GTK_WINDOW(win),
"program-name", "My_GtkUI",

View File

@ -25,7 +25,15 @@ struct _MyDock
G_DEFINE_TYPE(MyDock, my_dock, GTK_TYPE_BOX)
void btnlaunch_clicked(GtkWidget *widget, MyDock *dock)
void hide_launchpad(MyDock *dock)
{
// Hide the launchpad
gtk_stack_set_visible_child(GTK_STACK(dock->launchpad_stack),
dock->default_page);
dock->current_page = MainPage;
}
static void btnlaunch_clicked(GtkWidget *widget, MyDock *dock)
{
// Check is launchpad page is shown and switch pages
if (dock->current_page == MainPage)

View File

@ -4,6 +4,6 @@
G_DECLARE_FINAL_TYPE(MyDock, my_dock, MY, DOCK, GtkBox)
GtkWidget *my_dock_new(); // Create a new MyDock
GtkWidget *my_dock_new(); // Create a new MyDock
void btnlaunch_clicked(GtkWidget *widget, MyDock *dock); // Hide/Show the launchpad
void hide_launchpad(MyDock *dock); // Hide the launchpad