Доработка. Ширина колонки

This commit is contained in:
sasha80
2023-08-18 14:35:15 +03:00
parent 2f6dc271da
commit 19d0f4816a
2 changed files with 5 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ const TABLE_HEADER = [ TableHeader, TableHeader, TableHeader, Tabl
const TABLE_ROW = [ CellLineEdit, CellLineEdit, CellLineEdit, CellLineEdit ] ## Описание ряда.
const TABLE_COLUMN_PARAM = ['id', 'aoa', 'freq', 'proto' ] ## Параметры цели отображаемые в таблице.
const TABLE_HEADERS_TEXT = ['Номер', 'Пеленг', 'Частота, МГц', 'Протокол' ] ## Заголовки таблицы.
const TABLE_COLUMN_SIZE = [ 50, 140, 140, 100 ] ## Ширины колонок.
const TABLE_COLUMN_SIZE = [ 60, 140, 140, 90 ] ## Ширины колонок.
func on_row_pressed(i_row: int):

View File

@@ -319,11 +319,11 @@ func add_row(row_types: Array) -> void:
var node = node_type.instantiate()
assert(node.name == node.name, 'ошибка: экземпляр не имеет поля \"name\"')
var head = nodes[HEAD_KEY_FORMAT % [0, i_col]]
custom_minimum_size.x = head.custom_minimum_size.x
node.set_deferred('size.x', head.size.x)
var node_key: String = NODE_KEY_FORMAT % [i_row, i_col]
node.name = node_key
add_child(node)
node.custom_minimum_size.x = head.custom_minimum_size.x
node.set_deferred('size.x', head.size.x)
nodes[node_key] = node
var conn = Callable(self, '_on_focus_entered').bind(node)
node.connect('focus_entered', conn)
@@ -346,11 +346,10 @@ func set_header(header_types: Array):
var do_adj: = false
if not header:
header = GridContainer.new()
header.position = position
header.columns = header_types.size()
header.size.x = size.x
var parent = scroll.get_parent()
parent.add_child(header)
header.position = position
header.columns = header_types.size()
do_adj = true
else:
var childrens = header.get_children()