Connect add and remove buttons
This commit is contained in:
@@ -8,8 +8,11 @@ struct VRAMImage {
|
||||
}
|
||||
|
||||
export component MainTab inherits Rectangle {
|
||||
in property <[StandardListViewItem]> vram_file_list: [];
|
||||
in property <[VRAMImage]> vram_images: [];
|
||||
in-out property <[StandardListViewItem]> vram_files: [];
|
||||
in-out property <[VRAMImage]> vram_images: [];
|
||||
|
||||
callback add_file_clicked();
|
||||
callback remove_file_clicked(int);
|
||||
|
||||
width: group.width + group.x*2;
|
||||
height: group.height + group.y*2 + 32px;
|
||||
@@ -49,19 +52,23 @@ export component MainTab inherits Rectangle {
|
||||
VerticalLayout {
|
||||
alignment: start;
|
||||
padding: 4px;
|
||||
StandardListView {
|
||||
width: background_image.width/2;
|
||||
vram_files_list := StandardListView {
|
||||
width: background_image.width/2;
|
||||
height: 128px;
|
||||
|
||||
model: root.vram_file_list;
|
||||
model: root.vram_files;
|
||||
}
|
||||
HorizontalLayout {
|
||||
padding: 4px;
|
||||
Button {
|
||||
text: "Add File";
|
||||
clicked => {root.add_file_clicked();}
|
||||
}
|
||||
Button {
|
||||
text: "Remove File";
|
||||
clicked => {
|
||||
root.remove_file_clicked(vram_files_list.current_item);
|
||||
vram_files_list.current-item = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user