white_gold 0.0.1 → 0.0.2

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.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/white_gold/abi/enum.rb +0 -8
  3. data/lib/white_gold/convention/container_widgets.rb +26 -29
  4. data/lib/white_gold/convention/page.rb +2 -2
  5. data/lib/white_gold/{dsl → convention}/theme/color_attribute.rb +2 -0
  6. data/lib/white_gold/{dsl → convention}/theme/outline_attribute.rb +2 -0
  7. data/lib/white_gold/{dsl → convention}/theme/texture_attribute.rb +2 -0
  8. data/lib/white_gold/{dsl → convention}/theme/theme_attributed.rb +3 -17
  9. data/lib/white_gold/{dsl → convention}/theme/theme_component.rb +14 -3
  10. data/lib/white_gold/convention/theme_attributes.rb +49 -0
  11. data/lib/white_gold/dsl/button_base.rb +17 -2
  12. data/lib/white_gold/dsl/chat_box.rb +11 -0
  13. data/lib/white_gold/dsl/child_window.rb +21 -0
  14. data/lib/white_gold/dsl/color_picker.rb +9 -0
  15. data/lib/white_gold/dsl/combo_box.rb +28 -0
  16. data/lib/white_gold/dsl/edit_box.rb +29 -0
  17. data/lib/white_gold/dsl/file_dialog.rb +17 -0
  18. data/lib/white_gold/dsl/group.rb +5 -0
  19. data/lib/white_gold/dsl/knob.rb +10 -0
  20. data/lib/white_gold/dsl/label.rb +14 -0
  21. data/lib/white_gold/dsl/list_box.rb +20 -0
  22. data/lib/white_gold/dsl/list_view.rb +23 -0
  23. data/lib/white_gold/dsl/menu_bar.rb +16 -0
  24. data/lib/white_gold/dsl/message_box.rb +6 -0
  25. data/lib/white_gold/dsl/progress_bar.rb +14 -0
  26. data/lib/white_gold/dsl/radio_button.rb +25 -0
  27. data/lib/white_gold/dsl/range_slider.rb +8 -0
  28. data/lib/white_gold/dsl/scrollbar.rb +19 -0
  29. data/lib/white_gold/dsl/separator_line.rb +5 -0
  30. data/lib/white_gold/dsl/slider.rb +15 -0
  31. data/lib/white_gold/dsl/spin_button.rb +14 -0
  32. data/lib/white_gold/dsl/tabs.rb +24 -0
  33. data/lib/white_gold/dsl/text_area.rb +16 -0
  34. data/lib/white_gold/dsl/theme.rb +11 -51
  35. data/lib/white_gold/dsl/tree_view.rb +20 -0
  36. data/lib/white_gold/dsl/widget.rb +11 -2
  37. data/lib/white_gold/library/theme/light.rb +15 -3
  38. data/lib/white_gold/master.rb +1 -1
  39. data/lib/white_gold/path/object.path.rb +0 -11
  40. data/lib/white_gold/tgui-abi.rb +1 -0
  41. metadata +13 -37
  42. data/lib/white_gold/dsl/theme/button_theme.rb +0 -19
  43. data/lib/white_gold/dsl/theme/chat_box_theme.rb +0 -16
  44. data/lib/white_gold/dsl/theme/child_window_theme.rb +0 -25
  45. data/lib/white_gold/dsl/theme/color_picker_theme.rb +0 -14
  46. data/lib/white_gold/dsl/theme/combo_box_theme.rb +0 -33
  47. data/lib/white_gold/dsl/theme/common_renderer.rb +0 -7
  48. data/lib/white_gold/dsl/theme/edit_box_theme.rb +0 -34
  49. data/lib/white_gold/dsl/theme/file_dialog_theme.rb +0 -22
  50. data/lib/white_gold/dsl/theme/group_theme.rb +0 -9
  51. data/lib/white_gold/dsl/theme/knob_theme.rb +0 -15
  52. data/lib/white_gold/dsl/theme/label_theme.rb +0 -20
  53. data/lib/white_gold/dsl/theme/list_box_theme.rb +0 -25
  54. data/lib/white_gold/dsl/theme/list_view_theme.rb +0 -27
  55. data/lib/white_gold/dsl/theme/menu_bar_theme.rb +0 -21
  56. data/lib/white_gold/dsl/theme/message_box_theme.rb +0 -11
  57. data/lib/white_gold/dsl/theme/progress_bar_theme.rb +0 -19
  58. data/lib/white_gold/dsl/theme/radio_button_theme.rb +0 -30
  59. data/lib/white_gold/dsl/theme/scrollbar_theme.rb +0 -24
  60. data/lib/white_gold/dsl/theme/separator_line_theme.rb +0 -9
  61. data/lib/white_gold/dsl/theme/slider_theme.rb +0 -20
  62. data/lib/white_gold/dsl/theme/spin_button_theme.rb +0 -19
  63. data/lib/white_gold/dsl/theme/tabs_theme.rb +0 -29
  64. data/lib/white_gold/dsl/theme/text_area_theme.rb +0 -22
  65. data/lib/white_gold/dsl/theme/tree_view_theme.rb +0 -26
  66. data/lib/white_gold/dsl/theme/widget_theme.rb +0 -12
  67. /data/lib/white_gold/{dsl → convention}/theme/boolean_attribute.rb +0 -0
  68. /data/lib/white_gold/{dsl → convention}/theme/float_attribute.rb +0 -0
  69. /data/lib/white_gold/{dsl → convention}/theme/text_styles_attribute.rb +0 -0
  70. /data/lib/white_gold/dsl/{checkbox.rb → check_box.rb} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2602400f722a11d0ea3f31366f29c3b31471fa0b001061e3c614518c0ae4f52e
4
- data.tar.gz: d1c55ab3f33f03c59d389fe2739bd6ddcc10d13d9ecab594b826a365a9d41ec3
3
+ metadata.gz: a41be86fed471b6d1a5df24594b8e4eea51175c94227abedc23254fe604242af
4
+ data.tar.gz: 1c28e36a0ec7a9b71beecc5003dcac4004656d41bec972c458ad637f85b39d68
5
5
  SHA512:
6
- metadata.gz: fe6e0e9ce7881149ed8d5912fda0dc7dcbcb3e4ae4ca8dcc242765a35f8066499eb89fed57d05a47906ab66e910e92a48ff6e60522473cff7604974498b1bdb3
7
- data.tar.gz: 3ec8c60dcd97eacd677ddcd158c71db4e7947036f1f6313ec3805f9e7b18c4e1160fbfb996524143dc9bf3b4d30770e679f7666a4a5ddfeb234fe90a7ed2eb41
6
+ metadata.gz: 2d03d3ea86908238aab6fd22217530162f7f120bce1a3020be5255aa1f5dcb3d1a9cd635e327c71a8f5876b28261296e93c2a75fcb44a3cb4ba2e13e1feae9c3
7
+ data.tar.gz: ef710195d005845169be0a51dedba2ea1fd390a8b2eb23a08c3f458c377b75088d47d2f8a0792e3b62b1dc795a9423bef57ad7ecf7cff6e982df8a4d7f885dea
@@ -32,12 +32,4 @@ class Enum
32
32
  def symbols
33
33
  @symbol_to_int
34
34
  end
35
-
36
- def to_abi o
37
- self[o]
38
- end
39
-
40
- def to_api o
41
- self[o]
42
- end
43
35
  end
@@ -3,45 +3,45 @@ require_relative '../convention/api_child'
3
3
  module Tgui
4
4
 
5
5
  WIDGETS_COLLECTION = {
6
- label: Tgui::Label,
6
+ bitmap_button: Tgui::BitmapButton,
7
7
  button: Tgui::Button,
8
- radio: false,
9
- radio_button: Tgui::RadioButton,
8
+ chatbox: Tgui::ChatBox,
10
9
  checkbox: Tgui::CheckBox,
11
10
  child_window: Tgui::ChildWindow,
12
- editbox: Tgui::EditBox,
13
- combobox: Tgui::ComboBox,
14
11
  color_picker: Tgui::ColorPicker,
12
+ combobox: Tgui::ComboBox,
13
+ editbox: Tgui::EditBox,
14
+ file_dialog: Tgui::FileDialog,
15
+ grid: Tgui::Grid,
16
+ group: Tgui::Group,
15
17
  hola: Tgui::HorizontalLayout,
16
- vela: Tgui::VerticalLayout,
17
18
  howr: Tgui::HorizontalWrap,
18
- group: Tgui::Group,
19
- radio_button_group: Tgui::RadioButtonGroup,
20
- grid: Tgui::Grid,
21
- list_view: Tgui::ListView,
22
- picture: false,
23
- bitmap_button: Tgui::BitmapButton,
24
19
  knob: Tgui::Knob,
25
- message_box: Tgui::MessageBox,
26
- file_dialog: Tgui::FileDialog,
20
+ label: Tgui::Label,
27
21
  listbox: Tgui::ListBox,
22
+ listview: Tgui::ListView,
28
23
  menu: Tgui::MenuBar,
29
- panel_list_box: Tgui::PanelListBox,
30
- progress_bar: Tgui::ProgressBar,
24
+ messagebox: Tgui::MessageBox,
25
+ panel: Tgui::Panel,
26
+ panel_listbox: Tgui::PanelListBox,
27
+ panel_tabs: Tgui::TabContainer,
28
+ picture: false,
29
+ progressbar: Tgui::ProgressBar,
30
+ radio: false,
31
+ radio_button: Tgui::RadioButton,
32
+ radio_button_group: Tgui::RadioButtonGroup,
31
33
  range_slider: Tgui::RangeSlider,
32
- rich_text_label: Tgui::RichTextLabel,
33
- separator_line: Tgui::SeparatorLine,
34
+ fancy_label: Tgui::RichTextLabel,
35
+ scrollbar: Tgui::Scrollbar,
36
+ separator: Tgui::SeparatorLine,
34
37
  slider: Tgui::Slider,
35
38
  spin_button: Tgui::SpinButton,
36
39
  spin_control: Tgui::SpinControl,
37
40
  tabs: Tgui::Tabs,
38
- tab_container: Tgui::TabContainer,
39
- text_area: Tgui::TextArea,
41
+ textarea: Tgui::TextArea,
40
42
  toggle_button: Tgui::ToggleButton,
41
- tree_view: Tgui::TreeView,
42
- scrollbar: Tgui::Scrollbar,
43
- panel: Tgui::Panel,
44
- chat_box: Tgui::ChatBox
43
+ treeview: Tgui::TreeView,
44
+ vela: Tgui::VerticalLayout,
45
45
  }.freeze
46
46
 
47
47
  module WidgetOwner
@@ -133,13 +133,10 @@ module Tgui
133
133
  end)
134
134
  end
135
135
 
136
- @@auto_button_name = "Button1"
136
+ @@auto_button_name = "Button0"
137
137
 
138
138
  def! :btn do |text = nil, **na, &on_press|
139
- if !text
140
- text = @@auto_button_name
141
- @@auto_button_name = @@auto_button_name.next
142
- end
139
+ text = @@auto_button_name = @@auto_button_name.next if !text
143
140
  api_bang_button text:, on_press:, **na
144
141
  end
145
142
  end
@@ -72,7 +72,7 @@ class Page < Tgui::Group
72
72
  end
73
73
 
74
74
  def theme
75
- Theme.default
75
+ Tgui::Theme.default
76
76
  end
77
77
 
78
78
  def! :theme do |seed = nil, **na, &b|
@@ -80,7 +80,7 @@ class Page < Tgui::Group
80
80
  if seed
81
81
  theme.reset_attributes
82
82
  upon! theme do
83
- load Theme.loadpath(seed)
83
+ load Tgui::Theme.loadpath(seed)
84
84
  end
85
85
  end
86
86
  upon! theme, **na, &b
@@ -1,3 +1,5 @@
1
+ require_relative '../../dsl/color'
2
+
1
3
  class ColorAttribute
2
4
  def initialize name, value
3
5
  @name = name
@@ -1,3 +1,5 @@
1
+ require_relative '../../dsl/outline'
2
+
1
3
  class OutlineAttribute
2
4
  def initialize name, value
3
5
  @name = name
@@ -1,3 +1,5 @@
1
+ require_relative '../../dsl/texture'
2
+
1
3
  class TextureAttribute
2
4
  def initialize name, value
3
5
  @name = name
@@ -1,6 +1,3 @@
1
- require_relative '../color'
2
- require_relative '../outline'
3
- require_relative '../texture'
4
1
  require_relative 'boolean_attribute'
5
2
  require_relative 'color_attribute'
6
3
  require_relative 'float_attribute'
@@ -29,21 +26,10 @@ module Tgui
29
26
  end
30
27
  end
31
28
 
32
- def theme_comp name, type, tgui_attr_name = nil
33
- attr_name = tgui_attr_name || name.to_s.pascalcase
29
+ def theme_comp name, type
34
30
  def! name do |custom_name = nil, base_name = nil, **na, &b|
35
- if base_name
36
- attribute = attributes[custom_name]
37
- if !attribute || attribute.name != base_name
38
- attribute = attributes[custom_name] = type.new base_name, custom_name
39
- end
40
- else
41
- a_name = custom_name || attr_name
42
- attribute = attributes[a_name]
43
- if !attribute || attribute.name != attr_name
44
- attribute = attributes[a_name] = type.new attr_name, custom_name
45
- end
46
- end
31
+ attribute = type.new(base_name, custom_name)
32
+ attribute = attributes[attribute.name] ||= attribute
47
33
  upon! attribute, **na, &b
48
34
  end
49
35
  end
@@ -1,5 +1,4 @@
1
1
  require_relative 'theme_attributed'
2
- require_relative 'common_renderer'
3
2
 
4
3
  module Tgui
5
4
  class ThemeComponent
@@ -14,9 +13,21 @@ module Tgui
14
13
 
15
14
  attr :name, :attributes
16
15
 
16
+ def default_name
17
+ self.class.name.split("::")[-2]
18
+ end
19
+
20
+ def base_name
21
+ @name || default_name
22
+ end
23
+
24
+ def name
25
+ @custom_name || base_name
26
+ end
27
+
17
28
  def to_theme
18
- return "" if @attributes.empty?
19
- header = @custom_name ? "#{@custom_name} : #{@name}" : @name
29
+ return "" if @attributes.empty? && !@custom_name
30
+ header = @custom_name ? "#{@custom_name} : #{base_name}" : name
20
31
  "#{header} {\n#{@attributes.values.map(&:to_theme).join("\n")}\n}"
21
32
  end
22
33
  end
@@ -0,0 +1,49 @@
1
+ module Tgui
2
+ class Theme
3
+ theme_attr :text_color, :color
4
+ theme_attr :text_color_hover, :color
5
+ theme_attr :text_color_disabled, :color
6
+ theme_attr :background_color, :color
7
+ theme_attr :background_color_hover, :color
8
+ theme_attr :background_color_disabled, :color
9
+ theme_attr :selected_text_color, :color
10
+ theme_attr :selected_text_color_hover, :color
11
+ theme_attr :selected_background_color, :color
12
+ theme_attr :selected_background_color_hover, :color
13
+ theme_attr :border_color, :color
14
+ theme_attr :borders, :outline
15
+ theme_attr :scrollbar_width, :float
16
+ theme_attr :arrow_background_color, :color
17
+ theme_attr :arrow_background_color_hover, :color
18
+ theme_attr :arrow_background_color_disabled, :color
19
+ theme_attr :arrow_color, :color
20
+ theme_attr :arrow_color_hover, :color
21
+ theme_attr :arrow_color_disabled, :color
22
+
23
+ theme_comp :button, ButtonBase::Theme
24
+ theme_comp :chatbox, ChatBox::Theme
25
+ theme_comp :child_window, ChildWindow::Theme
26
+ theme_comp :color_picker, ColorPicker::Theme
27
+ theme_comp :combobox, ComboBox::Theme
28
+ theme_comp :editbox, EditBox::Theme
29
+ theme_comp :file_dialog, FileDialog::Theme
30
+ theme_comp :group, Group::Theme
31
+ theme_comp :knob, Knob::Theme
32
+ theme_comp :label, Label::Theme
33
+ theme_comp :listbox, ListBox::Theme
34
+ theme_comp :listview, ListView::Theme
35
+ theme_comp :menu, MenuBar::Theme
36
+ theme_comp :messagebox, MessageBox::Theme
37
+ theme_comp :progressbar, ProgressBar::Theme
38
+ theme_comp :radio_button, RadioButton::Theme
39
+ theme_comp :range_slider, RangeSlider::Theme
40
+ theme_comp :scrollbar, Scrollbar::Theme
41
+ theme_comp :separator, SeparatorLine::Theme
42
+ theme_comp :slider, Slider::Theme
43
+ theme_comp :spin_button, SpinButton::Theme
44
+ theme_comp :tabs, Tabs::Theme
45
+ theme_comp :text_area, TextArea::Theme
46
+ theme_comp :tree_view, TreeView::Theme
47
+ theme_comp :widget, Widget::Theme
48
+ end
49
+ end
@@ -3,8 +3,23 @@ require_relative 'clickable_widget'
3
3
  module Tgui
4
4
  class ButtonBase < ClickableWidget
5
5
 
6
- def theme_comp
7
- :button
6
+ class Theme < Widget::Theme
7
+
8
+ def default_name
9
+ "Button"
10
+ end
11
+
12
+ theme_attr :borders, :outline
13
+ [ '', :_down, :_hover, :_down_hover, :_disabled, :_down_disabled, :_focused, :_down_focused ].each do |v|
14
+ theme_attr "text_color#{v}".to_sym, :color
15
+ theme_attr "background_color#{v}".to_sym, :color
16
+ theme_attr "border_color#{v}".to_sym, :color
17
+ theme_attr "texture#{v}".to_sym, :texture
18
+ theme_attr "text_style#{v}".to_sym, :text_styles
19
+ end
20
+ theme_attr :text_outline_color, :color
21
+ theme_attr :text_outline_thickness, :float
22
+ theme_attr :rounded_border_radius, :float
8
23
  end
9
24
 
10
25
  def abi_pack_text_position_vector o
@@ -1,9 +1,20 @@
1
1
  require_relative 'widget'
2
+ require_relative 'scrollbar'
2
3
  require_relative '../convention/widget_like'
3
4
 
4
5
  module Tgui
5
6
  class ChatBox < Widget
6
7
 
8
+ class Theme < Widget::Theme
9
+ theme_attr :borders, :outline
10
+ theme_attr :padding, :outline
11
+ theme_attr :background_color, :color
12
+ theme_attr :border_color, :color
13
+ theme_attr :texture_background, :texture
14
+ theme_comp :scrollbar, Scrollbar::Theme
15
+ theme_attr :scrollbar_width, :float
16
+ end
17
+
7
18
  api_attr :objects do
8
19
  []
9
20
  end
@@ -1,9 +1,30 @@
1
1
  require_relative 'container'
2
+ require_relative 'button'
2
3
  require_relative 'signal/signal'
3
4
 
4
5
  module Tgui
5
6
  class ChildWindow < Container
6
7
 
8
+ class Theme < Widget::Theme
9
+ theme_attr :borders, :outline
10
+ theme_attr :title_bar_height, :float
11
+ theme_attr :title_bar_color, :color
12
+ theme_attr :title_color, :color
13
+ theme_attr :background_color, :color
14
+ theme_attr :border_color, :color
15
+ theme_attr :border_color_focused, :color
16
+ theme_attr :border_below_title_bar, :float
17
+ theme_attr :distance_to_side, :float
18
+ theme_attr :padding_between_buttons, :float
19
+ theme_attr :minimum_resizable_border_width, :float
20
+ theme_attr :show_text_on_title_buttons, :boolean
21
+ theme_attr :texture_title_bar, :texture
22
+ theme_attr :texture_background, :texture
23
+ theme_comp :close_button, Button::Theme
24
+ theme_comp :maximize_button, Button::Theme
25
+ theme_comp :minimize_button, Button::Theme
26
+ end
27
+
7
28
  class SignalClosing < Tgui::Signal
8
29
  def block_caller &b
9
30
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP]) do |ptr|
@@ -1,9 +1,18 @@
1
1
  require_relative 'child_window'
2
+ require_relative 'button'
3
+ require_relative 'label'
4
+ require_relative 'slider'
2
5
  require_relative 'signal/signal_color'
3
6
 
4
7
  module Tgui
5
8
  class ColorPicker < ChildWindow
6
9
 
10
+ class Theme < ChildWindow::Theme
11
+ theme_comp :button, Button::Theme
12
+ theme_comp :label, Label::Theme
13
+ theme_comp :slider, Slider::Theme
14
+ end
15
+
7
16
  abi_attr :color, Color
8
17
  abi_signal :on_color_change, SignalColor
9
18
  abi_signal :on_ok_press, SignalColor
@@ -1,10 +1,38 @@
1
1
  require_relative 'widget'
2
+ require_relative 'list_box'
2
3
  require_relative 'signal/signal_item'
3
4
  require_relative '../convention/widget_like'
4
5
 
5
6
  module Tgui
6
7
  class ComboBox < Widget
7
8
 
9
+ class Theme < Widget::Theme
10
+ theme_attr :borders, :outline
11
+ theme_attr :padding, :outline
12
+ theme_attr :text_style, :text_styles
13
+ theme_attr :default_text_style, :text_styles
14
+ theme_attr :background_color, :color
15
+ theme_attr :background_color_disabled, :color
16
+ theme_attr :text_color, :color
17
+ theme_attr :text_color_disabled, :color
18
+ theme_attr :default_text_color, :color
19
+ theme_attr :arrow_background_color, :color
20
+ theme_attr :arrow_background_color_disabled, :color
21
+ theme_attr :arrow_background_color_hover, :color
22
+ theme_attr :arrow_color, :color
23
+ theme_attr :arrow_color_hover, :color
24
+ theme_attr :arrow_color_disabled, :color
25
+ theme_attr :texture_background, :texture
26
+ theme_attr :texture_background_disabled, :texture
27
+ theme_attr :border_color, :color
28
+ theme_attr :texture_background, :texture
29
+ theme_attr :texture_background_disabled, :texture
30
+ theme_attr :texture_arrow, :texture
31
+ theme_attr :texture_arrow_hover, :texture
32
+ theme_attr :texture_arrow_disabled, :texture
33
+ theme_comp :list_box, ListBox::Theme
34
+ end
35
+
8
36
  class SignalItem < Tgui::SignalItem
9
37
  def block_caller &b
10
38
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP]) do |str1, str2|
@@ -5,6 +5,35 @@ require_relative 'signal/signal_typed_size_t'
5
5
  module Tgui
6
6
  class EditBox < ClickableWidget
7
7
 
8
+ class Theme < Widget::Theme
9
+ theme_attr :text_style, :text_styles
10
+ theme_attr :default_text_style, :text_styles
11
+ theme_attr :borders, :outline
12
+ theme_attr :padding, :outline
13
+ theme_attr :caret_width, :float
14
+ theme_attr :text_color, :color
15
+ theme_attr :text_color_disabled, :color
16
+ theme_attr :text_color_focused, :color
17
+ theme_attr :selected_text_color, :color
18
+ theme_attr :selected_text_background_color, :color
19
+ theme_attr :default_text_color, :color
20
+ theme_attr :background_color, :color
21
+ theme_attr :background_color_hover, :color
22
+ theme_attr :background_color_disabled, :color
23
+ theme_attr :background_color_focused, :color
24
+ theme_attr :caret_color, :color
25
+ theme_attr :caret_color_hover, :color
26
+ theme_attr :caret_color_focused, :color
27
+ theme_attr :border_color, :color
28
+ theme_attr :border_color_hover, :color
29
+ theme_attr :border_color_disabled, :color
30
+ theme_attr :border_color_focused, :color
31
+ theme_attr :texture, :texture
32
+ theme_attr :texture_hover, :texture
33
+ theme_attr :texture_disabled, :texture
34
+ theme_attr :texture_focused, :texture
35
+ end
36
+
8
37
  def abi_pack_integer_range *a
9
38
  if a.size == 1
10
39
  if a[0].is_a? Range
@@ -1,8 +1,25 @@
1
1
  require_relative 'child_window'
2
+ require_relative 'list_view'
3
+ require_relative 'edit_box'
4
+ require_relative 'label'
5
+ require_relative 'combo_box'
6
+ require_relative 'button'
2
7
 
3
8
  module Tgui
4
9
  class FileDialog < ChildWindow
5
10
 
11
+ class Theme < ChildWindow::Theme
12
+ theme_comp :list_view, ListView::Theme
13
+ theme_comp :edit_box, EditBox::Theme
14
+ theme_comp :filename_label, Label::Theme
15
+ theme_comp :file_type_combo_box, ComboBox::Theme
16
+ theme_comp :button, Button::Theme
17
+ theme_comp :back_button, Button::Theme
18
+ theme_comp :forward_button, Button::Theme
19
+ theme_comp :up_button, Button::Theme
20
+ theme_attr :arrow_on_navigation_buttons_visible, :boolean
21
+ end
22
+
6
23
  abi_def :selected_paths, nil => (String..) # not empty only in onFileSelected callback
7
24
  abi_attr :path, String
8
25
  abi_attr :filename, String
@@ -2,5 +2,10 @@ require_relative 'container'
2
2
 
3
3
  module Tgui
4
4
  class Group < Container
5
+
6
+ class Theme < Widget::Theme
7
+ theme_attr :padding, :outline
8
+ end
9
+
5
10
  end
6
11
  end
@@ -4,6 +4,16 @@ require_relative 'signal/signal_float'
4
4
  module Tgui
5
5
  class Knob < Widget
6
6
 
7
+ class Theme < Widget::Theme
8
+ theme_attr :borders, :outline
9
+ theme_attr :background_color, :color
10
+ theme_attr :thumb_color, :color
11
+ theme_attr :border_color, :color
12
+ theme_attr :texture_background, :texture
13
+ theme_attr :texture_foreground, :texture
14
+ theme_attr :image_rotation, :float
15
+ end
16
+
7
17
  abi_attr :start, Float, :start_rotation
8
18
  abi_attr :end, Float, :end_rotation
9
19
  abi_attr :min, Float, :minimum
@@ -4,6 +4,20 @@ require_relative 'scrollbar'
4
4
  module Tgui
5
5
  class Label < ClickableWidget
6
6
 
7
+ class Theme < Widget::Theme
8
+ theme_attr :borders, :outline
9
+ theme_attr :padding, :outline
10
+ theme_attr :text_color, :color
11
+ theme_attr :background_color, :color
12
+ theme_attr :border_color, :color
13
+ theme_attr :text_style, :text_styles
14
+ theme_attr :text_outline_color, :color
15
+ theme_attr :text_outline_thickness, :float
16
+ theme_attr :texture_background, :texture
17
+ theme_comp :scrollbar, Scrollbar::Theme
18
+ theme_attr :scrollbar_width, :float
19
+ end
20
+
7
21
  abi_attr :text, String
8
22
  abi_attr :scrollbar_value, Integer
9
23
  abi_attr :auto_size?, Boolean, :get_
@@ -1,10 +1,30 @@
1
1
  require_relative 'widget'
2
+ require_relative 'scrollbar'
2
3
  require_relative 'signal/signal_item'
3
4
  require_relative 'signal/signal_u_int'
4
5
 
5
6
  module Tgui
6
7
  class ListBox < Widget
7
8
 
9
+ class Theme < Widget::Theme
10
+ theme_attr :borders, :outline
11
+ theme_attr :padding, :outline
12
+ theme_attr :text_style, :text_styles
13
+ theme_attr :selected_text_style, :text_styles
14
+ theme_attr :background_color, :color
15
+ theme_attr :background_color_hover, :color
16
+ theme_attr :selected_background_color, :color
17
+ theme_attr :selected_background_color_hover, :color
18
+ theme_attr :text_color, :color
19
+ theme_attr :text_color_hover, :color
20
+ theme_attr :selected_text_color, :color
21
+ theme_attr :selected_text_color_hover, :color
22
+ theme_attr :border_color, :color
23
+ theme_attr :texture_background, :texture
24
+ theme_comp :scrollbar, Scrollbar::Theme
25
+ theme_attr :scrollbar_width, :float
26
+ end
27
+
8
28
  class SignalItem < Tgui::SignalItem
9
29
  def block_caller &b
10
30
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_VOIDP, Fiddle::TYPE_VOIDP]) do |str1, str2|
@@ -1,10 +1,33 @@
1
1
  require_relative 'widget'
2
+ require_relative 'scrollbar'
2
3
  require_relative '../convention/widget_like'
3
4
  require_relative 'signal/signal_int'
4
5
 
5
6
  module Tgui
6
7
  class ListView < Widget
7
8
 
9
+ class Theme < Widget::Theme
10
+ theme_attr :borders, :outline
11
+ theme_attr :padding, :outline
12
+ theme_attr :background_color, :color
13
+ theme_attr :background_color_hover, :color
14
+ theme_attr :selected_background_color, :color
15
+ theme_attr :selected_background_color_hover, :color
16
+ theme_attr :text_color, :color
17
+ theme_attr :text_color_hover, :color
18
+ theme_attr :selected_text_color, :color
19
+ theme_attr :selected_text_color_hover, :color
20
+ theme_attr :header_background_color, :color
21
+ theme_attr :header_text_color, :color
22
+ theme_attr :border_color, :color
23
+ theme_attr :separator_color, :color
24
+ theme_attr :grid_lines_color, :color
25
+ theme_attr :texture_header_background, :texture
26
+ theme_attr :texture_background, :texture
27
+ theme_comp :scrollbar, Scrollbar::Theme
28
+ theme_attr :scrollbar_width, :float
29
+ end
30
+
8
31
  class ListViewItemSignal < Tgui::SignalInt
9
32
  def block_caller &b
10
33
  Fiddle::Closure::BlockCaller.new(0, [Fiddle::TYPE_INT]) do |index|
@@ -5,6 +5,22 @@ require_relative 'signal/signal_item_hierarchy'
5
5
  module Tgui
6
6
  class MenuBar < Widget
7
7
 
8
+ class Theme < Widget::Theme
9
+ theme_attr :background_color, :color
10
+ theme_attr :selected_background_color, :color
11
+ theme_attr :text_color, :color
12
+ theme_attr :selected_text_color, :color
13
+ theme_attr :text_color_disabled, :color
14
+ theme_attr :separator_color, :color
15
+ theme_attr :texture_background, :texture
16
+ theme_attr :texture_item_background, :texture
17
+ theme_attr :texture_selected_item_background, :texture
18
+ theme_attr :distance_to_side, :float
19
+ theme_attr :separator_thickness, :float
20
+ theme_attr :separator_vertical_padding, :float
21
+ theme_attr :separator_side_padding, :float
22
+ end
23
+
8
24
  class ItemPressSignal
9
25
  def initialize menu_bar, path
10
26
  @menu_bar = menu_bar
@@ -1,3 +1,4 @@
1
+ require_relative 'child_window'
1
2
  require_relative 'button'
2
3
  require_relative 'signal/signal_string'
3
4
  require_relative '../convention/widget_like'
@@ -5,6 +6,11 @@ require_relative '../convention/widget_like'
5
6
  module Tgui
6
7
  class MessageBox < ChildWindow
7
8
 
9
+ class Theme < ChildWindow::Theme
10
+ theme_attr :text_color, :color
11
+ theme_comp :button, Button::Theme
12
+ end
13
+
8
14
  api_attr :format do
9
15
  :to_s
10
16
  end
@@ -5,6 +5,20 @@ require_relative 'signal/signal_u_int'
5
5
  module Tgui
6
6
  class ProgressBar < ClickableWidget
7
7
 
8
+ class Theme < Widget::Theme
9
+ theme_attr :borders, :outline
10
+ theme_attr :text_color, :color
11
+ theme_attr :text_color_filled, :color
12
+ theme_attr :background_color, :color
13
+ theme_attr :fill_color, :color
14
+ theme_attr :border_color, :color
15
+ theme_attr :texture_background, :texture
16
+ theme_attr :texture_fill, :texture
17
+ theme_attr :text_style, :text_styles
18
+ theme_attr :text_outline_color, :color
19
+ theme_attr :text_outline_thickness, :float
20
+ end
21
+
8
22
  abi_enum "FillDirection", :left_to_right, :right_to_left, :top_to_bottom, :bottom_to_top
9
23
  abi_attr :min, Float, :minimum
10
24
  abi_attr :max, Float, :maximum