Allow layout options configuration from run control

This commit is contained in:
Thibault Jouan
2015-04-26 02:49:39 +00:00
parent 70fe9bdb03
commit 7c2712924a
3 changed files with 34 additions and 9 deletions

View File

@@ -32,11 +32,15 @@ module Uh
@env.keybinds[translate_keysym *keysyms] = block
end
def layout obj
if obj.is_a? Class
@env.layout_class = obj
def layout arg, **options
if arg.is_a? Class
if options.any?
@env.layout = arg.new options
else
@env.layout_class = arg
end
else
@env.layout = obj
@env.layout = arg
end
end