Add combobox for encoding type
This commit is contained in:
@@ -13,6 +13,7 @@ export component MainWindow inherits Window {
|
||||
callback move_vram_image <=> main_tab.move_vram_image;
|
||||
|
||||
// Convert Image values
|
||||
in-out property file_tab-encoding_options <=> file_tab.conv-encoding_options;
|
||||
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_width <=> file_tab.conv-image_width;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Button, TabWidget, LineEdit, GroupBox } from "std-widgets.slint";
|
||||
import { Button, TabWidget, LineEdit, GroupBox, ComboBox } from "std-widgets.slint";
|
||||
|
||||
export enum State {
|
||||
Project,
|
||||
@@ -12,16 +12,17 @@ component ProjectWidget inherits Rectangle {
|
||||
}
|
||||
|
||||
component ConvertImageWidget inherits Rectangle {
|
||||
in-out property <string> image_path;
|
||||
in-out property <string> image_name;
|
||||
in-out property <image> image_data;
|
||||
in-out property <int> image-width;
|
||||
in-out property <int> image-height;
|
||||
in-out property <image> palette_data;
|
||||
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> palette_visible: false;
|
||||
in-out property <[string]> encoding_options: [];
|
||||
in-out property <string> image_path;
|
||||
in-out property <string> image_name;
|
||||
in-out property <image> image_data;
|
||||
in-out property <int> image-width;
|
||||
in-out property <int> image-height;
|
||||
in-out property <image> palette_data;
|
||||
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> palette_visible: false;
|
||||
|
||||
callback browse_clicked();
|
||||
callback add_clicked();
|
||||
@@ -88,6 +89,13 @@ component ConvertImageWidget inherits Rectangle {
|
||||
text: "Height: " + root.image-height;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
ComboBox {
|
||||
model: root.encoding_options;
|
||||
enabled: root.enable_view;
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
// Fake padding because the padding setting for the HorizontalLayout would not work
|
||||
@@ -188,16 +196,17 @@ component ConvertImageWidget inherits Rectangle {
|
||||
}
|
||||
|
||||
export component FileTab inherits Rectangle {
|
||||
in-out property <string> conv-image_path;
|
||||
in-out property <string> conv-image_name;
|
||||
in-out property <image> conv-image_data;
|
||||
in-out property <int> conv-image_width;
|
||||
in-out property <int> conv-image_height;
|
||||
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-enable_view;
|
||||
in-out property <[string]> conv-encoding_options;
|
||||
in-out property <string> conv-image_path;
|
||||
in-out property <string> conv-image_name;
|
||||
in-out property <image> conv-image_data;
|
||||
in-out property <int> conv-image_width;
|
||||
in-out property <int> conv-image_height;
|
||||
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-enable_view;
|
||||
|
||||
in-out property <State> state;
|
||||
callback conv-image_update_palette_size(int, int);
|
||||
@@ -233,17 +242,19 @@ export component FileTab inherits Rectangle {
|
||||
alignment: start;
|
||||
if root.state == State.Project : ProjectWidget {
|
||||
}
|
||||
|
||||
if root.state == State.ConvertImage : ConvertImageWidget {
|
||||
image_path <=> root.conv-image_path;
|
||||
image_data <=> root.conv-image_data;
|
||||
image-width <=> root.conv-image_width;
|
||||
image-height <=> root.conv-image_height;
|
||||
palette_data <=> root.conv-palette_data;
|
||||
palette_width <=> root.conv-palette_width;
|
||||
palette_height <=> root.conv-palette_height;
|
||||
palette_visible <=> root.conv-palette_enable;
|
||||
image_name <=> root.conv-image_name;
|
||||
enable_view <=> root.conv-enable_view;
|
||||
encoding_options <=> root.conv-encoding_options;
|
||||
image_path <=> root.conv-image_path;
|
||||
image_data <=> root.conv-image_data;
|
||||
image-width <=> root.conv-image_width;
|
||||
image-height <=> root.conv-image_height;
|
||||
palette_data <=> root.conv-palette_data;
|
||||
palette_width <=> root.conv-palette_width;
|
||||
palette_height <=> root.conv-palette_height;
|
||||
palette_visible <=> root.conv-palette_enable;
|
||||
image_name <=> root.conv-image_name;
|
||||
enable_view <=> root.conv-enable_view;
|
||||
|
||||
update_palette_size(width, height) => {
|
||||
root.conv-image_update_palette_size(width, height);
|
||||
|
Reference in New Issue
Block a user