ruflet_core 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -30
- data/lib/ruflet/version.rb +1 -1
- data/lib/ruflet_core.rb +9 -7
- data/lib/ruflet_protocol/ruflet/protocol.rb +28 -54
- data/lib/ruflet_ui/ruflet/app.rb +1 -1
- data/lib/ruflet_ui/ruflet/colors.rb +4 -50
- data/lib/ruflet_ui/ruflet/control.rb +69 -64
- data/lib/ruflet_ui/ruflet/dsl.rb +10 -3
- data/lib/ruflet_ui/ruflet/icons/cupertino/cupertino_icons.rb +2 -2
- data/lib/ruflet_ui/ruflet/icons/cupertino_icon_lookup.rb +1 -0
- data/lib/ruflet_ui/ruflet/icons/icon_constant_names.rb +29 -0
- data/lib/ruflet_ui/ruflet/icons/material/material_icons.rb +2 -2
- data/lib/ruflet_ui/ruflet/icons/material_icon_lookup.rb +1 -0
- data/lib/ruflet_ui/ruflet/page.rb +308 -526
- data/lib/ruflet_ui/ruflet/ui/control_factory.rb +68 -12
- data/lib/ruflet_ui/ruflet/ui/control_registry.rb +13 -6
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheet_control.rb +8 -45
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactionsheetaction_control.rb +45 -2
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoactivityindicator_control.rb +43 -2
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoalertdialog_control.rb +0 -5
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinobutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocheckbox_control.rb +56 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenu_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinocontextmenuaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodatepicker_control.rb +53 -8
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinodialogaction_control.rb +1 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinofilledbutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinolisttile_control.rb +54 -9
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinonavigationbar_control.rb +47 -9
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinopicker_control.rb +52 -10
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoradio_control.rb +52 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinosegmentedbutton_control.rb +49 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslider_control.rb +50 -5
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoslidingsegmentedbutton_control.rb +46 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinoswitch_control.rb +61 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotextfield_control.rb +145 -1
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotimerpicker_control.rb +47 -12
- data/lib/ruflet_ui/ruflet/ui/controls/cupertinos/cupertinotintedbutton_control.rb +59 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/alertdialog_control.rb +8 -45
- data/lib/ruflet_ui/ruflet/ui/controls/materials/appbar_control.rb +8 -40
- data/lib/ruflet_ui/ruflet/ui/controls/materials/audio_control.rb +16 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/autocomplete_control.rb +44 -1
- data/lib/ruflet_ui/ruflet/ui/controls/materials/badge_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/banner_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomappbar_control.rb +8 -47
- data/lib/ruflet_ui/ruflet/ui/controls/materials/bottomsheet_control.rb +0 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/button_control.rb +8 -54
- data/lib/ruflet_ui/ruflet/ui/controls/materials/card_control.rb +8 -50
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chart_controls.rb +19 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/checkbox_control.rb +9 -60
- data/lib/ruflet_ui/ruflet/ui/controls/materials/chip_control.rb +7 -81
- data/lib/ruflet_ui/ruflet/ui/controls/materials/circleavatar_control.rb +7 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/container_control.rb +9 -65
- data/lib/ruflet_ui/ruflet/ui/controls/materials/contextmenu_control.rb +50 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacell_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datacolumn_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datatable_control.rb +7 -88
- data/lib/ruflet_ui/ruflet/ui/controls/materials/datepicker_control.rb +9 -55
- data/lib/ruflet_ui/ruflet/ui/controls/materials/daterangepicker_control.rb +8 -58
- data/lib/ruflet_ui/ruflet/ui/controls/materials/divider_control.rb +0 -9
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdown_control.rb +8 -93
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownm2_control.rb +9 -103
- data/lib/ruflet_ui/ruflet/ui/controls/materials/dropdownoption_control.rb +0 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanel_control.rb +7 -51
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansionpanellist_control.rb +46 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/expansiontile_control.rb +69 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledbutton_control.rb +54 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/fillediconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonalbutton_control.rb +54 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/filledtonaliconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/floatingactionbutton_control.rb +7 -69
- data/lib/ruflet_ui/ruflet/ui/controls/materials/iconbutton_control.rb +8 -68
- data/lib/ruflet_ui/ruflet/ui/controls/materials/listtile_control.rb +8 -74
- data/lib/ruflet_ui/ruflet/ui/controls/materials/map_control.rb +99 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/menuitembutton_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationbar_control.rb +7 -59
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationdrawer_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/navigationrail_control.rb +7 -73
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinedbutton_control.rb +51 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/outlinediconbutton_control.rb +67 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenubutton_control.rb +8 -61
- data/lib/ruflet_ui/ruflet/ui/controls/materials/popupmenuitem_control.rb +0 -6
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressbar_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/progressring_control.rb +8 -56
- data/lib/ruflet_ui/ruflet/ui/controls/materials/radio_control.rb +9 -54
- data/lib/ruflet_ui/ruflet/ui/controls/materials/rangeslider_control.rb +7 -62
- data/lib/ruflet_ui/ruflet/ui/controls/materials/reorderablelistview_control.rb +9 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/ruflet_controls.rb +5 -26
- data/lib/ruflet_ui/ruflet/ui/controls/materials/searchbar_control.rb +80 -11
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segment_control.rb +0 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/segmentedbutton_control.rb +7 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/selectionarea_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/materials/slider_control.rb +9 -60
- data/lib/ruflet_ui/ruflet/ui/controls/materials/snackbar_control.rb +37 -4
- data/lib/ruflet_ui/ruflet/ui/controls/materials/snackbaraction_control.rb +38 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/spinkit_control.rb +25 -0
- data/lib/ruflet_ui/ruflet/ui/controls/materials/submenubutton_control.rb +52 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/switch_control.rb +9 -61
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tab_control.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbar_control.rb +8 -64
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabbarview_control.rb +43 -5
- data/lib/ruflet_ui/ruflet/ui/controls/materials/tabs_control.rb +7 -47
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textbutton_control.rb +51 -2
- data/lib/ruflet_ui/ruflet/ui/controls/materials/textfield_control.rb +9 -132
- data/lib/ruflet_ui/ruflet/ui/controls/materials/timepicker_control.rb +10 -34
- data/lib/ruflet_ui/ruflet/ui/controls/materials/verticaldivider_control.rb +0 -9
- data/lib/ruflet_ui/ruflet/ui/controls/materials/video_control.rb +9 -42
- data/lib/ruflet_ui/ruflet/ui/controls/materials/webview_control.rb +1 -114
- data/lib/ruflet_ui/ruflet/ui/controls/ruflet_controls.rb +13 -28
- data/lib/ruflet_ui/ruflet/ui/controls/shared/animatedswitcher_control.rb +46 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/arc_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/browsercontextmenu_control.rb +1 -12
- data/lib/ruflet_ui/ruflet/ui/controls/shared/canvas_control.rb +8 -54
- data/lib/ruflet_ui/ruflet/ui/controls/shared/circle_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/column_control.rb +9 -51
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dismissible_control.rb +52 -12
- data/lib/ruflet_ui/ruflet/ui/controls/shared/draggable_control.rb +1 -7
- data/lib/ruflet_ui/ruflet/ui/controls/shared/dragtarget_control.rb +1 -3
- data/lib/ruflet_ui/ruflet/ui/controls/shared/fletapp_control.rb +9 -46
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gesturedetector_control.rb +9 -113
- data/lib/ruflet_ui/ruflet/ui/controls/shared/gridview_control.rb +57 -13
- data/lib/ruflet_ui/ruflet/ui/controls/shared/hero_control.rb +9 -40
- data/lib/ruflet_ui/ruflet/ui/controls/shared/icon_control.rb +9 -48
- data/lib/ruflet_ui/ruflet/ui/controls/shared/interactiveviewer_control.rb +9 -53
- data/lib/ruflet_ui/ruflet/ui/controls/shared/line_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/listview_control.rb +57 -11
- data/lib/ruflet_ui/ruflet/ui/controls/shared/markdown_control.rb +9 -54
- data/lib/ruflet_ui/ruflet/ui/controls/shared/oval_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/page_control.rb +9 -58
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pagelet_control.rb +9 -48
- data/lib/ruflet_ui/ruflet/ui/controls/shared/pageview_control.rb +50 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/path_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/placeholder_control.rb +44 -9
- data/lib/ruflet_ui/ruflet/ui/controls/shared/points_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/rect_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/reorderabledraghandle_control.rb +43 -4
- data/lib/ruflet_ui/ruflet/ui/controls/shared/responsiverow_control.rb +47 -15
- data/lib/ruflet_ui/ruflet/ui/controls/shared/rotatedbox_control.rb +97 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/row_control.rb +9 -51
- data/lib/ruflet_ui/ruflet/ui/controls/shared/ruflet_controls.rb +5 -0
- data/lib/ruflet_ui/ruflet/ui/controls/shared/safearea_control.rb +48 -4
- data/lib/ruflet_ui/ruflet/ui/{services/ruflet → controls/shared}/screenshot_control.rb +18 -2
- data/lib/ruflet_ui/ruflet/ui/controls/shared/semantics_control.rb +65 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shadermask_control.rb +9 -41
- data/lib/ruflet_ui/ruflet/ui/controls/shared/shimmer_control.rb +9 -44
- data/lib/ruflet_ui/ruflet/ui/controls/shared/stack_control.rb +44 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/text_control.rb +9 -35
- data/lib/ruflet_ui/ruflet/ui/controls/shared/transparentpointer_control.rb +9 -38
- data/lib/ruflet_ui/ruflet/ui/controls/shared/view_control.rb +63 -1
- data/lib/ruflet_ui/ruflet/ui/controls/shared/window_control.rb +40 -66
- data/lib/ruflet_ui/ruflet/ui/controls/shared/windowdragarea_control.rb +45 -4
- data/lib/ruflet_ui/ruflet/ui/material_control_methods.rb +61 -17
- data/lib/ruflet_ui/ruflet/ui/material_control_registry.rb +22 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/accelerometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/audio_recorder_control.rb +14 -36
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/barometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/battery_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/camera_control.rb +9 -42
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/clipboard_control.rb +31 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/connectivity_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/filepicker_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/flashlight_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/geolocator_control.rb +14 -30
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/gyroscope_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/hapticfeedback_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/magnetometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/permissionhandler_control.rb +5 -20
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/screenbrightness_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/securestorage_control.rb +22 -49
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/semanticsservice_control.rb +20 -15
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/shakedetector_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/share_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/sharedpreferences_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/storagepaths_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/urllauncher_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/useraccelerometer_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/wakelock_control.rb +1 -0
- data/lib/ruflet_ui/ruflet/ui/services/ruflet_services.rb +0 -7
- data/lib/ruflet_ui/ruflet/ui/shared_control_forwarders.rb +20 -1
- data/lib/ruflet_ui.rb +12 -10
- metadata +7 -8
- data/lib/ruflet_ui/ruflet/types/animation.rb +0 -110
- data/lib/ruflet_ui/ruflet/ui/controls/materials/codeeditor_control.rb +0 -93
- data/lib/ruflet_ui/ruflet/ui/controls/materials/map_controls.rb +0 -311
- data/lib/ruflet_ui/ruflet/ui/controls/materials/rive_control.rb +0 -87
- data/lib/ruflet_ui/ruflet/ui/controls/materials/spinkit_controls.rb +0 -109
- data/lib/ruflet_ui/ruflet/ui/services/ruflet/tester_control.rb +0 -126
|
@@ -8,47 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "shadermask".freeze
|
|
9
9
|
WIRE = "ShaderMask".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
21
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
22
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
23
|
-
props[:badge] = badge unless badge.nil?
|
|
24
|
-
props[:blend_mode] = blend_mode unless blend_mode.nil?
|
|
25
|
-
props[:border_radius] = border_radius unless border_radius.nil?
|
|
26
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
27
|
-
props[:col] = col unless col.nil?
|
|
28
|
-
props[:content] = content unless content.nil?
|
|
29
|
-
props[:data] = data unless data.nil?
|
|
30
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
31
|
-
props[:expand] = expand unless expand.nil?
|
|
32
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
33
|
-
props[:height] = height unless height.nil?
|
|
34
|
-
props[:key] = key unless key.nil?
|
|
35
|
-
props[:left] = left unless left.nil?
|
|
36
|
-
props[:margin] = margin unless margin.nil?
|
|
37
|
-
props[:offset] = offset unless offset.nil?
|
|
38
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
39
|
-
props[:right] = right unless right.nil?
|
|
40
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
41
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
42
|
-
props[:scale] = scale unless scale.nil?
|
|
43
|
-
props[:shader] = shader unless shader.nil?
|
|
44
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
45
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
46
|
-
props[:top] = top unless top.nil?
|
|
47
|
-
props[:visible] = visible unless visible.nil?
|
|
48
|
-
props[:width] = width unless width.nil?
|
|
49
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
50
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
51
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :blend_mode, :border_radius, :bottom, :col, :content, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :shader, :size_change_interval, :tooltip, :top, :visible, :width, :on_animation_end, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
18
|
+
end
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
52
20
|
end
|
|
53
21
|
end
|
|
54
22
|
end
|
|
@@ -8,50 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "shimmer".freeze
|
|
9
9
|
WIRE = "Shimmer".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
21
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
22
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
23
|
-
props[:badge] = badge unless badge.nil?
|
|
24
|
-
props[:base_color] = base_color unless base_color.nil?
|
|
25
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
26
|
-
props[:col] = col unless col.nil?
|
|
27
|
-
props[:content] = content unless content.nil?
|
|
28
|
-
props[:data] = data unless data.nil?
|
|
29
|
-
props[:direction] = direction unless direction.nil?
|
|
30
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
31
|
-
props[:expand] = expand unless expand.nil?
|
|
32
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
33
|
-
props[:gradient] = gradient unless gradient.nil?
|
|
34
|
-
props[:height] = height unless height.nil?
|
|
35
|
-
props[:highlight_color] = highlight_color unless highlight_color.nil?
|
|
36
|
-
props[:key] = key unless key.nil?
|
|
37
|
-
props[:left] = left unless left.nil?
|
|
38
|
-
props[:loop] = loop unless loop.nil?
|
|
39
|
-
props[:margin] = margin unless margin.nil?
|
|
40
|
-
props[:offset] = offset unless offset.nil?
|
|
41
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
42
|
-
props[:period] = period unless period.nil?
|
|
43
|
-
props[:right] = right unless right.nil?
|
|
44
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
45
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
46
|
-
props[:scale] = scale unless scale.nil?
|
|
47
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
48
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
49
|
-
props[:top] = top unless top.nil?
|
|
50
|
-
props[:visible] = visible unless visible.nil?
|
|
51
|
-
props[:width] = width unless width.nil?
|
|
52
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
53
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
54
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :base_color, :bottom, :col, :content, :data, :direction, :disabled, :expand, :expand_loose, :gradient, :height, :highlight_color, :key, :left, :loop, :margin, :offset, :opacity, :period, :right, :rotate, :rtl, :scale, :size_change_interval, :tooltip, :top, :visible, :width, :on_animation_end, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
18
|
+
end
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
55
20
|
end
|
|
56
21
|
end
|
|
57
22
|
end
|
|
@@ -8,7 +8,50 @@ module Ruflet
|
|
|
8
8
|
TYPE = "stack".freeze
|
|
9
9
|
WIRE = "Stack".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:adaptive, :align, :alignment, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :clip_behavior, :col, :controls, :data, :disabled, :expand, :expand_loose, :fit, :height, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :tooltip, :top, :visible, :width, :on_animation_end, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
adaptive = props[:adaptive]
|
|
17
|
+
align = props[:align]
|
|
18
|
+
alignment = props[:alignment]
|
|
19
|
+
animate_align = props[:animate_align]
|
|
20
|
+
animate_margin = props[:animate_margin]
|
|
21
|
+
animate_offset = props[:animate_offset]
|
|
22
|
+
animate_opacity = props[:animate_opacity]
|
|
23
|
+
animate_position = props[:animate_position]
|
|
24
|
+
animate_rotation = props[:animate_rotation]
|
|
25
|
+
animate_scale = props[:animate_scale]
|
|
26
|
+
animate_size = props[:animate_size]
|
|
27
|
+
aspect_ratio = props[:aspect_ratio]
|
|
28
|
+
badge = props[:badge]
|
|
29
|
+
bottom = props[:bottom]
|
|
30
|
+
clip_behavior = props[:clip_behavior]
|
|
31
|
+
col = props[:col]
|
|
32
|
+
controls = props[:controls]
|
|
33
|
+
data = props[:data]
|
|
34
|
+
disabled = props[:disabled]
|
|
35
|
+
expand = props[:expand]
|
|
36
|
+
expand_loose = props[:expand_loose]
|
|
37
|
+
fit = props[:fit]
|
|
38
|
+
height = props[:height]
|
|
39
|
+
key = props[:key]
|
|
40
|
+
left = props[:left]
|
|
41
|
+
margin = props[:margin]
|
|
42
|
+
offset = props[:offset]
|
|
43
|
+
opacity = props[:opacity]
|
|
44
|
+
right = props[:right]
|
|
45
|
+
rotate = props[:rotate]
|
|
46
|
+
rtl = props[:rtl]
|
|
47
|
+
scale = props[:scale]
|
|
48
|
+
size_change_interval = props[:size_change_interval]
|
|
49
|
+
tooltip = props[:tooltip]
|
|
50
|
+
top = props[:top]
|
|
51
|
+
visible = props[:visible]
|
|
52
|
+
width = props[:width]
|
|
53
|
+
on_animation_end = props[:on_animation_end]
|
|
54
|
+
on_size_change = props[:on_size_change]
|
|
12
55
|
clip_behavior = "hardEdge" if clip_behavior.nil?
|
|
13
56
|
fit = "loose" if fit.nil?
|
|
14
57
|
|
|
@@ -8,41 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "text".freeze
|
|
9
9
|
WIRE = "Text".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:font_family_fallback] = font_family_fallback unless font_family_fallback.nil?
|
|
21
|
-
props[:italic] = italic unless italic.nil?
|
|
22
|
-
props[:key] = key unless key.nil?
|
|
23
|
-
props[:max_lines] = max_lines unless max_lines.nil?
|
|
24
|
-
props[:max_width] = max_width unless max_width.nil?
|
|
25
|
-
props[:no_wrap] = no_wrap unless no_wrap.nil?
|
|
26
|
-
props[:overflow] = overflow unless overflow.nil?
|
|
27
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
28
|
-
props[:selectable] = selectable unless selectable.nil?
|
|
29
|
-
props[:selection_cursor_color] = selection_cursor_color unless selection_cursor_color.nil?
|
|
30
|
-
props[:selection_cursor_height] = selection_cursor_height unless selection_cursor_height.nil?
|
|
31
|
-
props[:selection_cursor_width] = selection_cursor_width unless selection_cursor_width.nil?
|
|
32
|
-
props[:semantics_label] = semantics_label unless semantics_label.nil?
|
|
33
|
-
props[:show_selection_cursor] = show_selection_cursor unless show_selection_cursor.nil?
|
|
34
|
-
props[:size] = size unless size.nil?
|
|
35
|
-
props[:spans] = spans unless spans.nil?
|
|
36
|
-
props[:style] = style unless style.nil?
|
|
37
|
-
props[:text_align] = text_align unless text_align.nil?
|
|
38
|
-
props[:theme_style] = theme_style unless theme_style.nil?
|
|
39
|
-
props[:value] = value unless value.nil?
|
|
40
|
-
props[:weight] = weight unless weight.nil?
|
|
41
|
-
props[:x] = x unless x.nil?
|
|
42
|
-
props[:y] = y unless y.nil?
|
|
43
|
-
props[:on_selection_change] = on_selection_change unless on_selection_change.nil?
|
|
44
|
-
props[:on_tap] = on_tap unless on_tap.nil?
|
|
45
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:alignment, :bgcolor, :color, :data, :ellipsis, :enable_interactive_selection, :font_family, :font_family_fallback, :italic, :key, :max_lines, :max_width, :no_wrap, :overflow, :rotate, :selectable, :selection_cursor_color, :selection_cursor_height, :selection_cursor_width, :semantics_label, :show_selection_cursor, :size, :spans, :style, :text_align, :theme_style, :value, :weight, :x, :y, :on_selection_change, :on_tap].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
18
|
+
end
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
46
20
|
end
|
|
47
21
|
end
|
|
48
22
|
end
|
|
@@ -8,44 +8,15 @@ module Ruflet
|
|
|
8
8
|
TYPE = "transparentpointer".freeze
|
|
9
9
|
WIRE = "TransparentPointer".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
props
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
props[:animate_scale] = animate_scale unless animate_scale.nil?
|
|
21
|
-
props[:animate_size] = animate_size unless animate_size.nil?
|
|
22
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
23
|
-
props[:badge] = badge unless badge.nil?
|
|
24
|
-
props[:bottom] = bottom unless bottom.nil?
|
|
25
|
-
props[:col] = col unless col.nil?
|
|
26
|
-
props[:content] = content unless content.nil?
|
|
27
|
-
props[:data] = data unless data.nil?
|
|
28
|
-
props[:disabled] = disabled unless disabled.nil?
|
|
29
|
-
props[:expand] = expand unless expand.nil?
|
|
30
|
-
props[:expand_loose] = expand_loose unless expand_loose.nil?
|
|
31
|
-
props[:height] = height unless height.nil?
|
|
32
|
-
props[:key] = key unless key.nil?
|
|
33
|
-
props[:left] = left unless left.nil?
|
|
34
|
-
props[:margin] = margin unless margin.nil?
|
|
35
|
-
props[:offset] = offset unless offset.nil?
|
|
36
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
37
|
-
props[:right] = right unless right.nil?
|
|
38
|
-
props[:rotate] = rotate unless rotate.nil?
|
|
39
|
-
props[:rtl] = rtl unless rtl.nil?
|
|
40
|
-
props[:scale] = scale unless scale.nil?
|
|
41
|
-
props[:size_change_interval] = size_change_interval unless size_change_interval.nil?
|
|
42
|
-
props[:tooltip] = tooltip unless tooltip.nil?
|
|
43
|
-
props[:top] = top unless top.nil?
|
|
44
|
-
props[:visible] = visible unless visible.nil?
|
|
45
|
-
props[:width] = width unless width.nil?
|
|
46
|
-
props[:on_animation_end] = on_animation_end unless on_animation_end.nil?
|
|
47
|
-
props[:on_size_change] = on_size_change unless on_size_change.nil?
|
|
48
|
-
super(type: TYPE, id: id, **props)
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :col, :content, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :tooltip, :top, :visible, :width, :on_animation_end, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
compact = {}
|
|
15
|
+
props.each do |key, value|
|
|
16
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
17
|
+
compact[key] = value unless value.nil?
|
|
18
|
+
end
|
|
19
|
+
super(type: TYPE, id: id, **compact)
|
|
49
20
|
end
|
|
50
21
|
end
|
|
51
22
|
end
|
|
@@ -8,7 +8,69 @@ module Ruflet
|
|
|
8
8
|
TYPE = "view".freeze
|
|
9
9
|
WIRE = "View".freeze
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :appbar, :aspect_ratio, :auto_scroll, :badge, :bgcolor, :bottom, :bottom_appbar, :can_pop, :col, :controls, :data, :decoration, :disabled, :drawer, :end_drawer, :expand, :expand_loose, :floating_action_button, :floating_action_button_location, :foreground_decoration, :fullscreen_dialog, :height, :horizontal_alignment, :key, :left, :margin, :navigation_bar, :offset, :opacity, :padding, :right, :rotate, :route, :rtl, :scale, :scroll, :scroll_interval, :services, :size_change_interval, :spacing, :tooltip, :top, :vertical_alignment, :visible, :width, :on_animation_end, :on_confirm_pop, :on_scroll, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
align = props[:align]
|
|
17
|
+
animate_align = props[:animate_align]
|
|
18
|
+
animate_margin = props[:animate_margin]
|
|
19
|
+
animate_offset = props[:animate_offset]
|
|
20
|
+
animate_opacity = props[:animate_opacity]
|
|
21
|
+
animate_position = props[:animate_position]
|
|
22
|
+
animate_rotation = props[:animate_rotation]
|
|
23
|
+
animate_scale = props[:animate_scale]
|
|
24
|
+
animate_size = props[:animate_size]
|
|
25
|
+
appbar = props[:appbar]
|
|
26
|
+
aspect_ratio = props[:aspect_ratio]
|
|
27
|
+
auto_scroll = props[:auto_scroll]
|
|
28
|
+
badge = props[:badge]
|
|
29
|
+
bgcolor = props[:bgcolor]
|
|
30
|
+
bottom = props[:bottom]
|
|
31
|
+
bottom_appbar = props[:bottom_appbar]
|
|
32
|
+
can_pop = props[:can_pop]
|
|
33
|
+
col = props[:col]
|
|
34
|
+
controls = props[:controls]
|
|
35
|
+
data = props[:data]
|
|
36
|
+
decoration = props[:decoration]
|
|
37
|
+
disabled = props[:disabled]
|
|
38
|
+
drawer = props[:drawer]
|
|
39
|
+
end_drawer = props[:end_drawer]
|
|
40
|
+
expand = props[:expand]
|
|
41
|
+
expand_loose = props[:expand_loose]
|
|
42
|
+
floating_action_button = props[:floating_action_button]
|
|
43
|
+
floating_action_button_location = props[:floating_action_button_location]
|
|
44
|
+
foreground_decoration = props[:foreground_decoration]
|
|
45
|
+
fullscreen_dialog = props[:fullscreen_dialog]
|
|
46
|
+
height = props[:height]
|
|
47
|
+
horizontal_alignment = props[:horizontal_alignment]
|
|
48
|
+
key = props[:key]
|
|
49
|
+
left = props[:left]
|
|
50
|
+
margin = props[:margin]
|
|
51
|
+
navigation_bar = props[:navigation_bar]
|
|
52
|
+
offset = props[:offset]
|
|
53
|
+
opacity = props[:opacity]
|
|
54
|
+
padding = props[:padding]
|
|
55
|
+
right = props[:right]
|
|
56
|
+
rotate = props[:rotate]
|
|
57
|
+
route = props[:route]
|
|
58
|
+
rtl = props[:rtl]
|
|
59
|
+
scale = props[:scale]
|
|
60
|
+
scroll = props[:scroll]
|
|
61
|
+
scroll_interval = props[:scroll_interval]
|
|
62
|
+
services = props[:services]
|
|
63
|
+
size_change_interval = props[:size_change_interval]
|
|
64
|
+
spacing = props[:spacing]
|
|
65
|
+
tooltip = props[:tooltip]
|
|
66
|
+
top = props[:top]
|
|
67
|
+
vertical_alignment = props[:vertical_alignment]
|
|
68
|
+
visible = props[:visible]
|
|
69
|
+
width = props[:width]
|
|
70
|
+
on_animation_end = props[:on_animation_end]
|
|
71
|
+
on_confirm_pop = props[:on_confirm_pop]
|
|
72
|
+
on_scroll = props[:on_scroll]
|
|
73
|
+
on_size_change = props[:on_size_change]
|
|
12
74
|
can_pop = true if can_pop.nil?
|
|
13
75
|
fullscreen_dialog = false if fullscreen_dialog.nil?
|
|
14
76
|
horizontal_alignment = "start" if horizontal_alignment.nil?
|
|
@@ -7,78 +7,46 @@ module Ruflet
|
|
|
7
7
|
class WindowControl < Ruflet::Control
|
|
8
8
|
TYPE = "window".freeze
|
|
9
9
|
WIRE = "Window".freeze
|
|
10
|
+
RESIZE_EDGES = {
|
|
11
|
+
"top" => "top",
|
|
12
|
+
"left" => "left",
|
|
13
|
+
"right" => "right",
|
|
14
|
+
"bottom" => "bottom",
|
|
15
|
+
"top_left" => "topLeft",
|
|
16
|
+
"bottom_left" => "bottomLeft",
|
|
17
|
+
"top_right" => "topRight",
|
|
18
|
+
"bottom_right" => "bottomRight"
|
|
19
|
+
}.freeze
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
props = {}
|
|
13
|
-
props[:alignment] = alignment unless alignment.nil?
|
|
14
|
-
props[:always_on_bottom] = always_on_bottom unless always_on_bottom.nil?
|
|
15
|
-
props[:always_on_top] = always_on_top unless always_on_top.nil?
|
|
16
|
-
props[:aspect_ratio] = aspect_ratio unless aspect_ratio.nil?
|
|
17
|
-
props[:badge_label] = badge_label unless badge_label.nil?
|
|
18
|
-
props[:bgcolor] = bgcolor unless bgcolor.nil?
|
|
19
|
-
props[:brightness] = brightness unless brightness.nil?
|
|
20
|
-
props[:data] = data unless data.nil?
|
|
21
|
-
props[:focused] = focused unless focused.nil?
|
|
22
|
-
props[:frameless] = frameless unless frameless.nil?
|
|
23
|
-
props[:full_screen] = full_screen unless full_screen.nil?
|
|
24
|
-
props[:height] = height unless height.nil?
|
|
25
|
-
props[:icon] = icon unless icon.nil?
|
|
26
|
-
props[:ignore_mouse_events] = ignore_mouse_events unless ignore_mouse_events.nil?
|
|
27
|
-
props[:key] = key unless key.nil?
|
|
28
|
-
props[:left] = left unless left.nil?
|
|
29
|
-
props[:max_height] = max_height unless max_height.nil?
|
|
30
|
-
props[:max_width] = max_width unless max_width.nil?
|
|
31
|
-
props[:maximizable] = maximizable unless maximizable.nil?
|
|
32
|
-
props[:maximized] = maximized unless maximized.nil?
|
|
33
|
-
props[:min_height] = min_height unless min_height.nil?
|
|
34
|
-
props[:min_width] = min_width unless min_width.nil?
|
|
35
|
-
props[:minimizable] = minimizable unless minimizable.nil?
|
|
36
|
-
props[:minimized] = minimized unless minimized.nil?
|
|
37
|
-
props[:movable] = movable unless movable.nil?
|
|
38
|
-
props[:opacity] = opacity unless opacity.nil?
|
|
39
|
-
props[:prevent_close] = prevent_close unless prevent_close.nil?
|
|
40
|
-
props[:progress_bar] = progress_bar unless progress_bar.nil?
|
|
41
|
-
props[:resizable] = resizable unless resizable.nil?
|
|
42
|
-
props[:shadow] = shadow unless shadow.nil?
|
|
43
|
-
props[:skip_task_bar] = skip_task_bar unless skip_task_bar.nil?
|
|
44
|
-
props[:title_bar_buttons_hidden] = title_bar_buttons_hidden unless title_bar_buttons_hidden.nil?
|
|
45
|
-
props[:title_bar_hidden] = title_bar_hidden unless title_bar_hidden.nil?
|
|
46
|
-
props[:top] = top unless top.nil?
|
|
47
|
-
props[:visible] = visible unless visible.nil?
|
|
48
|
-
props[:width] = width unless width.nil?
|
|
49
|
-
props[:on_event] = on_event unless on_event.nil?
|
|
50
|
-
super(type: TYPE, id: id, **props)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def wait_until_ready_to_show(timeout: 10, on_result: nil)
|
|
54
|
-
invoke_window_method("wait_until_ready_to_show", timeout: timeout, on_result: on_result)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def to_front(timeout: 10, on_result: nil)
|
|
58
|
-
invoke_window_method("to_front", timeout: timeout, on_result: on_result)
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def center(timeout: 10, on_result: nil)
|
|
62
|
-
invoke_window_method("center", timeout: timeout, on_result: on_result)
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def close(timeout: 10, on_result: nil)
|
|
66
|
-
invoke_window_method("close", timeout: timeout, on_result: on_result)
|
|
67
|
-
end
|
|
21
|
+
KEYWORDS = [:alignment, :always_on_bottom, :always_on_top, :aspect_ratio, :badge_label, :bgcolor, :brightness, :data, :focused, :frameless, :full_screen, :height, :icon, :ignore_mouse_events, :key, :left, :max_height, :max_width, :maximizable, :maximized, :min_height, :min_width, :minimizable, :minimized, :movable, :opacity, :prevent_close, :progress_bar, :resizable, :shadow, :skip_task_bar, :title_bar_buttons_hidden, :title_bar_hidden, :top, :visible, :width, :on_event].freeze
|
|
68
22
|
|
|
69
|
-
def
|
|
70
|
-
|
|
23
|
+
def initialize(id: nil, **props)
|
|
24
|
+
compact = {}
|
|
25
|
+
props.each do |key, value|
|
|
26
|
+
raise ArgumentError, "unknown keyword: :#{key}" unless KEYWORDS.include?(key)
|
|
27
|
+
compact[key] = value unless value.nil?
|
|
28
|
+
end
|
|
29
|
+
super(type: TYPE, id: id, **compact)
|
|
71
30
|
end
|
|
72
31
|
|
|
73
|
-
|
|
74
|
-
|
|
32
|
+
%w[
|
|
33
|
+
wait_until_ready_to_show
|
|
34
|
+
destroy
|
|
35
|
+
center
|
|
36
|
+
close
|
|
37
|
+
to_front
|
|
38
|
+
start_dragging
|
|
39
|
+
].each do |method_name|
|
|
40
|
+
define_method(method_name) do |timeout: 10, on_result: nil|
|
|
41
|
+
invoke_window(method_name, timeout: timeout, on_result: on_result)
|
|
42
|
+
end
|
|
75
43
|
end
|
|
76
44
|
|
|
77
45
|
def start_resizing(edge, timeout: 10, on_result: nil)
|
|
78
|
-
|
|
79
|
-
|
|
46
|
+
edge_value = RESIZE_EDGES.fetch(edge.to_s, edge.to_s)
|
|
47
|
+
invoke_window(
|
|
80
48
|
"start_resizing",
|
|
81
|
-
args: { "edge" =>
|
|
49
|
+
args: { "edge" => edge_value },
|
|
82
50
|
timeout: timeout,
|
|
83
51
|
on_result: on_result
|
|
84
52
|
)
|
|
@@ -86,8 +54,14 @@ module Ruflet
|
|
|
86
54
|
|
|
87
55
|
private
|
|
88
56
|
|
|
89
|
-
def
|
|
90
|
-
runtime_page&.invoke(
|
|
57
|
+
def invoke_window(method_name, args: nil, timeout:, on_result:)
|
|
58
|
+
runtime_page&.invoke(
|
|
59
|
+
self,
|
|
60
|
+
method_name,
|
|
61
|
+
args: args,
|
|
62
|
+
timeout: timeout,
|
|
63
|
+
on_result: on_result
|
|
64
|
+
)
|
|
91
65
|
end
|
|
92
66
|
end
|
|
93
67
|
end
|
|
@@ -8,10 +8,51 @@ module Ruflet
|
|
|
8
8
|
TYPE = "windowdragarea".freeze
|
|
9
9
|
WIRE = "WindowDragArea".freeze
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
KEYWORDS = [:align, :animate_align, :animate_margin, :animate_offset, :animate_opacity, :animate_position, :animate_rotation, :animate_scale, :animate_size, :aspect_ratio, :badge, :bottom, :col, :content, :data, :disabled, :expand, :expand_loose, :height, :key, :left, :margin, :maximizable, :offset, :opacity, :right, :rotate, :rtl, :scale, :size_change_interval, :tooltip, :top, :visible, :width, :on_animation_end, :on_double_tap, :on_drag_end, :on_drag_start, :on_size_change].freeze
|
|
12
|
+
|
|
13
|
+
def initialize(id: nil, **props)
|
|
14
|
+
unknown = props.keys.reject { |key| KEYWORDS.include?(key) }
|
|
15
|
+
raise ArgumentError, "unknown keywords: #{unknown.join(', ')}" unless unknown.empty?
|
|
16
|
+
align = props[:align]
|
|
17
|
+
animate_align = props[:animate_align]
|
|
18
|
+
animate_margin = props[:animate_margin]
|
|
19
|
+
animate_offset = props[:animate_offset]
|
|
20
|
+
animate_opacity = props[:animate_opacity]
|
|
21
|
+
animate_position = props[:animate_position]
|
|
22
|
+
animate_rotation = props[:animate_rotation]
|
|
23
|
+
animate_scale = props[:animate_scale]
|
|
24
|
+
animate_size = props[:animate_size]
|
|
25
|
+
aspect_ratio = props[:aspect_ratio]
|
|
26
|
+
badge = props[:badge]
|
|
27
|
+
bottom = props[:bottom]
|
|
28
|
+
col = props[:col]
|
|
29
|
+
content = props[:content]
|
|
30
|
+
data = props[:data]
|
|
31
|
+
disabled = props[:disabled]
|
|
32
|
+
expand = props[:expand]
|
|
33
|
+
expand_loose = props[:expand_loose]
|
|
34
|
+
height = props[:height]
|
|
35
|
+
key = props[:key]
|
|
36
|
+
left = props[:left]
|
|
37
|
+
margin = props[:margin]
|
|
38
|
+
maximizable = props[:maximizable]
|
|
39
|
+
offset = props[:offset]
|
|
40
|
+
opacity = props[:opacity]
|
|
41
|
+
right = props[:right]
|
|
42
|
+
rotate = props[:rotate]
|
|
43
|
+
rtl = props[:rtl]
|
|
44
|
+
scale = props[:scale]
|
|
45
|
+
size_change_interval = props[:size_change_interval]
|
|
46
|
+
tooltip = props[:tooltip]
|
|
47
|
+
top = props[:top]
|
|
48
|
+
visible = props[:visible]
|
|
49
|
+
width = props[:width]
|
|
50
|
+
on_animation_end = props[:on_animation_end]
|
|
51
|
+
on_double_tap = props[:on_double_tap]
|
|
52
|
+
on_drag_end = props[:on_drag_end]
|
|
53
|
+
on_drag_start = props[:on_drag_start]
|
|
54
|
+
on_size_change = props[:on_size_change]
|
|
55
|
+
raise ArgumentError, "window_drag_area requires content" if content.nil?
|
|
15
56
|
|
|
16
57
|
maximizable = true if maximizable.nil?
|
|
17
58
|
|