diff --git a/lacci/lib/shoes.rb b/lacci/lib/shoes.rb index 0de3e50e2..6357cdc74 100644 --- a/lacci/lib/shoes.rb +++ b/lacci/lib/shoes.rb @@ -75,6 +75,7 @@ class << self # @param height [Integer] The new app window height # @param resizable [Boolean] Whether the app window should be resizeable # @param features [Symbol,Array] Additional Shoes extensions requested by the app + # @param settings [Object] Additional Shoes settings, specific to the Shoes implementation # @return [void] # @see Shoes::App#new def app( @@ -83,10 +84,11 @@ def app( height: 420, resizable: true, features: [], + settings: {}, &app_code_body ) f = [features].flatten # Make sure this is a list, not a single symbol - app = Shoes::App.new(title:, width:, height:, resizable:, features: f, &app_code_body) + app = Shoes::App.new(title:, width:, height:, resizable:, features: f, settings:, &app_code_body) app.init app.run nil diff --git a/lacci/lib/shoes/app.rb b/lacci/lib/shoes/app.rb index fcec668bd..aadcbcf93 100644 --- a/lacci/lib/shoes/app.rb +++ b/lacci/lib/shoes/app.rb @@ -17,7 +17,11 @@ class << self shoes_styles :title, :width, :height, :resizable, :features - # This is defined to avoid the linkable-id check in the Shoes-style method_missing def'n + # This is entirely different for different Shoes implementations. But it allows passing + # implementation-specific settings information that Lacci can't directly use. + attr_reader :settings + + # This is defined ahead of time to avoid the linkable-id check in the Shoes-style method_missing def'n def features @features end @@ -31,6 +35,7 @@ def initialize( height: 420, resizable: true, features: [], + settings: {}, &app_code_body ) log_init("Shoes::App") @@ -49,6 +54,7 @@ def initialize( @event_loop_type = "displaylib" # the default @features = features + @settings = settings unknown_ext = features - Shoes::FEATURES - Shoes::EXTENSIONS unsupported_features = unknown_ext & Shoes::KNOWN_FEATURES