Unverified Commit dd9fd2c8 authored by Robert Ancell's avatar Robert Ancell Committed by GitHub

Use a HeaderBar for Linux applications. (#59714)

parent e0f60918
...@@ -15,10 +15,14 @@ G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) ...@@ -15,10 +15,14 @@ G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
static void my_application_activate(GApplication* application) { static void my_application_activate(GApplication* application) {
GtkWindow* window = GtkWindow* window =
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
GtkHeaderBar *header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar));
gtk_header_bar_set_title(header_bar, kFlutterWindowTitle);
gtk_header_bar_set_show_close_button(header_bar, TRUE);
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
gtk_widget_show(GTK_WIDGET(window)); gtk_widget_show(GTK_WIDGET(window));
gtk_widget_set_size_request(GTK_WIDGET(window), kFlutterWindowWidth, gtk_widget_set_size_request(GTK_WIDGET(window), kFlutterWindowWidth,
kFlutterWindowHeight); kFlutterWindowHeight);
gtk_window_set_title(window, kFlutterWindowTitle);
g_autoptr(FlDartProject) project = fl_dart_project_new(); g_autoptr(FlDartProject) project = fl_dart_project_new();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment