1
0
Fork 0
mirror of synced 2024-05-17 19:03:08 +12:00

Hack steal click

This commit is contained in:
Rafał Mikrut 2023-11-19 11:06:42 +01:00
parent dcd30dd6eb
commit ddfb6dc733
2 changed files with 17 additions and 4 deletions

View file

@ -5,8 +5,13 @@ import {CurrentTab, TypeOfOpenedItem} from "common.slint";
import {MainListModel} from "common.slint";
export component MainList {
in-out property <CurrentTab> active-tab;
in-out property <[MainListModel]> empty_folder_model;
in-out property <CurrentTab> active-tab: CurrentTab.EmptyFolders;
in-out property <[MainListModel]> empty_folder_model: [
{checked: false, selected_row: false, header_row: true, val: ["kropkarz", "/Xd1", "24.10.2023"]} ,
{checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} ,
{checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} ,
{checked: true, selected_row: false, header_row: false, val: ["lokkaler", "/Xd1/Vide2", "01.23.1911"]}
];
in-out property <[MainListModel]> empty_files_model;
in-out property <[MainListModel]> similar_images_model;
callback changed_current_tab();
@ -45,6 +50,9 @@ export component MainList {
fileNameIdx: 4;
}
focus_item := FocusScope {
x:0;
width: 0px; // Hack to not steal first click from other components - https://github.com/slint-ui/slint/issues/3503
key-released(event) => {
if (!self.visible || !self.has-focus) {
return accept;

View file

@ -8,8 +8,13 @@ import {GuiState} from "gui_state.slint";
export component SelectableTableView inherits Rectangle {
callback item_opened(string);
in property <[string]> columns;
in-out property <[MainListModel]> values;
in-out property <[length]> column_sizes;
in-out property <[MainListModel]> values: [
{checked: false, selected_row: false, header_row: true, val: ["kropkarz", "/Xd1", "24.10.2023"]} ,
{checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} ,
{checked: false, selected_row: false, header_row: false, val: ["witasphere", "/Xd1/Imagerren2", "25.11.1991"]} ,
{checked: true, selected_row: false, header_row: false, val: ["lokkaler", "/Xd1/Vide2", "01.23.1911"]}
];
in-out property <[length]> column_sizes: [30px, 80px, 150px, 160px];
private property <int> column_number: column-sizes.length + 1;
// This idx, starts from zero, but since first is always a checkbox, and is not in model.val values, remove 1 from idx
in-out property <int> parentPathIdx;