mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
Anim Editor: List control no longer fills in its background
This commit is contained in:
@@ -138,11 +138,9 @@ class UIControls::List < UIControls::BaseControl
|
||||
end
|
||||
|
||||
def refresh
|
||||
self.bitmap.clear
|
||||
# Draw control outline and background
|
||||
super
|
||||
# Draw control outline
|
||||
self.bitmap.outline_rect(0, 0, width, height, Color.black)
|
||||
self.bitmap.fill_rect(1, 1, width - 2, height - 2, Color.white)
|
||||
draw_area_highlight
|
||||
# Draw text options
|
||||
@values.each_with_index do |val, i|
|
||||
next if i < @top_row || i >= @top_row + @rows_count
|
||||
|
||||
@@ -56,15 +56,24 @@ class UIControls::DropdownList < UIControls::BaseControl
|
||||
|
||||
def make_dropdown_menu
|
||||
menu_height = (UIControls::List::ROW_HEIGHT * [@options.length, @max_rows].min) + (UIControls::List::BORDER_THICKNESS * 2)
|
||||
# Draw menu's background
|
||||
@dropdown_menu_bg = BitmapSprite.new(@button_rect.width, menu_height, self.viewport)
|
||||
@dropdown_menu_bg.x = self.x + @button_rect.x
|
||||
@dropdown_menu_bg.y = self.y + @button_rect.y + @button_rect.height
|
||||
@dropdown_menu_bg.z = self.z + 1
|
||||
@dropdown_menu_bg.bitmap.fill_rect(0, 0, @dropdown_menu_bg.width, @dropdown_menu_bg.height, Color.white)
|
||||
# Create menu
|
||||
@dropdown_menu = UIControls::List.new(@button_rect.width, menu_height, self.viewport, @options)
|
||||
@dropdown_menu.x = self.x + @button_rect.x
|
||||
@dropdown_menu.y = self.y + @button_rect.y + @button_rect.height
|
||||
@dropdown_menu.x = @dropdown_menu_bg.x
|
||||
@dropdown_menu.y = @dropdown_menu_bg.y
|
||||
@dropdown_menu.z = self.z + 2
|
||||
@dropdown_menu.set_interactive_rects
|
||||
@dropdown_menu.repaint
|
||||
end
|
||||
|
||||
def remove_dropdown_menu
|
||||
@dropdown_menu_bg&.dispose
|
||||
@dropdown_menu_bg = nil
|
||||
@dropdown_menu&.dispose
|
||||
@dropdown_menu = nil
|
||||
@captured_area = nil
|
||||
|
||||
@@ -52,15 +52,24 @@ class UIControls::TextBoxDropdownList < UIControls::TextBox
|
||||
|
||||
def make_dropdown_menu
|
||||
menu_height = (UIControls::List::ROW_HEIGHT * [@options.length, @max_rows].min) + (UIControls::List::BORDER_THICKNESS * 2)
|
||||
# Draw menu's background
|
||||
@dropdown_menu_bg = BitmapSprite.new(@text_box_rect.width + @button_rect.width, menu_height, self.viewport)
|
||||
@dropdown_menu_bg.x = self.x + @text_box_rect.x
|
||||
@dropdown_menu_bg.y = self.y + @text_box_rect.y + @text_box_rect.height
|
||||
@dropdown_menu_bg.z = self.z + 1
|
||||
@dropdown_menu_bg.bitmap.fill_rect(0, 0, @dropdown_menu_bg.width, @dropdown_menu_bg.height, Color.white)
|
||||
# Create menu
|
||||
@dropdown_menu = UIControls::List.new(@text_box_rect.width + @button_rect.width, menu_height, self.viewport, @options)
|
||||
@dropdown_menu.x = self.x + @text_box_rect.x
|
||||
@dropdown_menu.y = self.y + @text_box_rect.y + @text_box_rect.height
|
||||
@dropdown_menu.x = @dropdown_menu_bg.x
|
||||
@dropdown_menu.y = @dropdown_menu_bg.y
|
||||
@dropdown_menu.z = self.z + 2
|
||||
@dropdown_menu.set_interactive_rects
|
||||
@dropdown_menu.repaint
|
||||
end
|
||||
|
||||
def remove_dropdown_menu
|
||||
@dropdown_menu_bg&.dispose
|
||||
@dropdown_menu_bg = nil
|
||||
@dropdown_menu&.dispose
|
||||
@dropdown_menu = nil
|
||||
@captured_area = nil
|
||||
|
||||
Reference in New Issue
Block a user