Support loading and displaying of image palette #16
|
@ -26,11 +26,17 @@ impl FileTab {
|
||||||
|
|
||||||
main_window.set_file_tab_image_data(image);
|
main_window.set_file_tab_image_data(image);
|
||||||
if let Some(palette) = palette {
|
if let Some(palette) = palette {
|
||||||
|
let size = palette.size();
|
||||||
|
|
||||||
main_window.set_file_tab_palette_data(palette);
|
main_window.set_file_tab_palette_data(palette);
|
||||||
|
main_window.set_file_tab_palette_width(size.width as i32);
|
||||||
|
main_window.set_file_tab_palette_height(size.height as i32);
|
||||||
main_window.set_file_tab_palette_visible(true);
|
main_window.set_file_tab_palette_visible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
main_window.set_file_tab_palette_width(0);
|
||||||
|
main_window.set_file_tab_palette_height(0);
|
||||||
main_window.set_file_tab_palette_visible(false);
|
main_window.set_file_tab_palette_visible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@ export component MainWindow inherits Window {
|
||||||
in-out property file_tab_browse_path <=> file_tab.conv_image_path;
|
in-out property file_tab_browse_path <=> file_tab.conv_image_path;
|
||||||
in-out property file_tab_image_data <=> file_tab.conv_image_data;
|
in-out property file_tab_image_data <=> file_tab.conv_image_data;
|
||||||
in-out property file_tab_palette_data <=> file_tab.conv_palette_data;
|
in-out property file_tab_palette_data <=> file_tab.conv_palette_data;
|
||||||
|
in-out property file_tab_palette_width <=> file_tab.conv_palette_width;
|
||||||
|
in-out property file_tab_palette_height <=> file_tab.conv_palette_height;
|
||||||
in-out property file_tab_palette_visible <=> file_tab.conv_palette_enable;
|
in-out property file_tab_palette_visible <=> file_tab.conv_palette_enable;
|
||||||
in-out property file_tab_image_name <=> file_tab.conv_image_name;
|
in-out property file_tab_image_name <=> file_tab.conv_image_name;
|
||||||
in-out property file_tab_enable <=> file_tab.conv_enable_view;
|
in-out property file_tab_enable <=> file_tab.conv_enable_view;
|
||||||
|
|
|
@ -13,9 +13,11 @@ component ProjectWidget inherits Rectangle {
|
||||||
|
|
||||||
component ConvertImageWidget inherits Rectangle {
|
component ConvertImageWidget inherits Rectangle {
|
||||||
in-out property <string> image_path;
|
in-out property <string> image_path;
|
||||||
|
in-out property <string> image_name;
|
||||||
in-out property <image> image_data;
|
in-out property <image> image_data;
|
||||||
in-out property <image> palette_data;
|
in-out property <image> palette_data;
|
||||||
in-out property <string> image_name;
|
in-out property <int> palette_width: 0;
|
||||||
|
in-out property <int> palette_height: 0;
|
||||||
in-out property <bool> enable_view: false;
|
in-out property <bool> enable_view: false;
|
||||||
in-out property <bool> palette_visible: false;
|
in-out property <bool> palette_visible: false;
|
||||||
|
|
||||||
|
@ -110,11 +112,13 @@ component ConvertImageWidget inherits Rectangle {
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
LineEdit {
|
LineEdit {
|
||||||
width: 40pt;
|
width: 40pt;
|
||||||
enabled: root.enable_view;
|
enabled: root.palette_visible;
|
||||||
|
text: root.palette_width;
|
||||||
}
|
}
|
||||||
LineEdit {
|
LineEdit {
|
||||||
width: 40pt;
|
width: 40pt;
|
||||||
enabled: root.enable_view;
|
enabled: root.palette_visible;
|
||||||
|
text: root.palette_height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,11 +162,15 @@ component ConvertImageWidget inherits Rectangle {
|
||||||
|
|
||||||
export component FileTab inherits Rectangle {
|
export component FileTab inherits Rectangle {
|
||||||
in-out property <string> conv_image_path;
|
in-out property <string> conv_image_path;
|
||||||
|
in-out property <string> conv_image_name;
|
||||||
in-out property <image> conv_image_data;
|
in-out property <image> conv_image_data;
|
||||||
in-out property <image> conv_palette_data;
|
in-out property <image> conv_palette_data;
|
||||||
|
in-out property <int> conv_palette_width;
|
||||||
|
in-out property <int> conv_palette_height;
|
||||||
in-out property <bool> conv_palette_enable;
|
in-out property <bool> conv_palette_enable;
|
||||||
in-out property <string> conv_image_name;
|
|
||||||
in-out property <bool> conv_enable_view;
|
in-out property <bool> conv_enable_view;
|
||||||
|
|
||||||
|
|
||||||
in-out property <State> state;
|
in-out property <State> state;
|
||||||
callback conv_image_browse_clicked;
|
callback conv_image_browse_clicked;
|
||||||
callback conv_image_add_clicked;
|
callback conv_image_add_clicked;
|
||||||
|
@ -200,6 +208,8 @@ export component FileTab inherits Rectangle {
|
||||||
image_path <=> root.conv_image_path;
|
image_path <=> root.conv_image_path;
|
||||||
image_data <=> root.conv_image_data;
|
image_data <=> root.conv_image_data;
|
||||||
palette_data <=> root.conv_palette_data;
|
palette_data <=> root.conv_palette_data;
|
||||||
|
palette_width <=> root.conv_palette_width;
|
||||||
|
palette_height <=> root.conv_palette_height;
|
||||||
palette_visible <=> root.conv_palette_enable;
|
palette_visible <=> root.conv_palette_enable;
|
||||||
image_name <=> root.conv_image_name;
|
image_name <=> root.conv_image_name;
|
||||||
enable_view <=> root.conv_enable_view;
|
enable_view <=> root.conv_enable_view;
|
||||||
|
|
Loading…
Reference in New Issue