Skip to content

Commit dd70901

Browse files
committed
Selectable stuff added
1 parent 4b07d45 commit dd70901

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

data_grid.py

+11-12
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class HeaderLabel(Label):
4848

4949
header = ['ID', 'Nome', 'Preco', 'IVA']
5050
col_size = [0.1, 0.5, 0.2, 0.2]
51-
body_alignment = ["left", "left", "right", "right"]
51+
body_alignment = ["center", "left", "right", "right"]
5252

5353
products_list = []
5454

@@ -84,22 +84,21 @@ def __init__(self, header_data, body_data, b_align, cols_size, **kwargs):
8484
for item in bcell:
8585

8686
cell = CLabel(text=('[color=1b799c]' + item + '[/color]'),
87-
background_color=(0,0,0,0),
88-
halign=b_align[n],
87+
_background_color=(0,0,0,0),
88+
background_normal="background_normal.png",
89+
background_down="background_pressed.png",
90+
halign=b_align[n],
8991
markup=True,
9092
text_size=(300, None),
9193
size_hint_x=cols_size[n],
9294
id=("row_" + str(counter) + "_col_" + str(n)))
9395

94-
tmp = Window.size[0] * cell.size_hint_x
95-
print tmp
96-
#cell.halign="right"
97-
cell.text_size=(tmp, None)
98-
#cell.bind(text_size=(tmp, None), halign="right")
99-
print cell.id
100-
print cell.size_hint_x
101-
print Window.size[0]
102-
print (Window.size[0] * cell.size_hint_x)
96+
cell_width = Window.size[0] * cell.size_hint_x
97+
cell.text_size=(cell_width - 30, None)
98+
# print cell.id
99+
# print cell.size_hint_x
100+
# print Window.size[0]
101+
# print (Window.size[0] * cell.size_hint_x)
103102
# def on_pressed_cell(self):
104103
# self.row_10_col_1.bind(state = "Down")
105104
# print self

0 commit comments

Comments
 (0)