Skip to content

Commit

Permalink
Example: use handy window (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier committed May 14, 2022
1 parent 28c61c2 commit 5738b6f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions example/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

#include "generated_plugin_registrant.h"

#include <handy_window/handy_window_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) handy_window_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "HandyWindowPlugin");
handy_window_plugin_register_with_registrar(handy_window_registrar);
}
1 change: 1 addition & 0 deletions example/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
handy_window
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
7 changes: 3 additions & 4 deletions example/linux/my_application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,17 @@ static void my_application_activate(GApplication* application) {
gtk_window_set_title(window, "yaru_widgets_example");
}

gtk_window_set_default_size(window, 1280, 720);
gtk_widget_show(GTK_WIDGET(window));
gtk_window_set_default_size(window, 700, 720);

g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);

FlView* view = fl_view_new(project);
gtk_widget_show(GTK_WIDGET(view));
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));

fl_register_plugins(FL_PLUGIN_REGISTRY(view));

gtk_widget_show(GTK_WIDGET(view));
gtk_widget_show(GTK_WIDGET(window));
gtk_widget_grab_focus(GTK_WIDGET(view));
}

Expand Down
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
handy_window: ^0.1.2
provider: ^6.0.2
yaru: ^0.3.0
yaru_icons: ^0.2.0
Expand Down

0 comments on commit 5738b6f

Please sign in to comment.