Add GUI for palette width/height
This commit is contained in:
parent
1f8fc5100c
commit
e948887faa
|
@ -18,7 +18,7 @@ export component MainWindow inherits Window {
|
||||||
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_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_image_enable;
|
in-out property file_tab_enable <=> file_tab.conv_enable_view;
|
||||||
callback file_tab_browse_convert_image <=> file_tab.conv_image_browse_clicked;
|
callback file_tab_browse_convert_image <=> file_tab.conv_image_browse_clicked;
|
||||||
callback file_tab_add_convert_image <=> file_tab.conv_image_add_clicked;
|
callback file_tab_add_convert_image <=> file_tab.conv_image_add_clicked;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ component ConvertImageWidget inherits Rectangle {
|
||||||
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 <string> image_name;
|
||||||
in-out property <bool> enable_button: false;
|
in-out property <bool> enable_view: false;
|
||||||
in-out property <bool> palette_visible: false;
|
in-out property <bool> palette_visible: false;
|
||||||
|
|
||||||
callback browse_clicked();
|
callback browse_clicked();
|
||||||
|
@ -75,19 +75,48 @@ component ConvertImageWidget inherits Rectangle {
|
||||||
width: 4px;
|
width: 4px;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
}
|
}
|
||||||
Rectangle {
|
VerticalLayout {
|
||||||
width: 256px + 2*4px; // < Because of border
|
Rectangle {
|
||||||
height: 256px + 2*4px; // < Because of border
|
width: 256px + 2*4px; // < Because of border
|
||||||
background: #404040;
|
height: 256px + 2*4px; // < Because of border
|
||||||
border-color: #808080;
|
background: #404040;
|
||||||
border-width: 4px;
|
border-color: #808080;
|
||||||
palette_image := Image {
|
border-width: 4px;
|
||||||
width: 256px;
|
palette_image := Image {
|
||||||
height: 256px;
|
width: 256px;
|
||||||
source: root.palette_data;
|
height: 256px;
|
||||||
visible: root.palette_visible;
|
source: root.palette_data;
|
||||||
image-fit: contain;
|
visible: root.palette_visible;
|
||||||
image-rendering: pixelated;
|
image-fit: contain;
|
||||||
|
image-rendering: pixelated;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HorizontalLayout {
|
||||||
|
alignment: start;
|
||||||
|
VerticalLayout {
|
||||||
|
VerticalLayout {
|
||||||
|
alignment: center;
|
||||||
|
Text {
|
||||||
|
text: "Width: ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
VerticalLayout {
|
||||||
|
alignment: center;
|
||||||
|
Text {
|
||||||
|
text: "Height: ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
VerticalLayout {
|
||||||
|
LineEdit {
|
||||||
|
width: 40pt;
|
||||||
|
enabled: root.enable_view;
|
||||||
|
}
|
||||||
|
LineEdit {
|
||||||
|
width: 40pt;
|
||||||
|
enabled: root.enable_view;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,7 +138,7 @@ component ConvertImageWidget inherits Rectangle {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
Button {
|
Button {
|
||||||
text: "Add Image";
|
text: "Add Image";
|
||||||
enabled: root.enable_button;
|
enabled: root.enable_view;
|
||||||
clicked => {root.add_clicked();}
|
clicked => {root.add_clicked();}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,7 +162,7 @@ export component FileTab inherits Rectangle {
|
||||||
in-out property <image> conv_palette_data;
|
in-out property <image> conv_palette_data;
|
||||||
in-out property <bool> conv_palette_enable;
|
in-out property <bool> conv_palette_enable;
|
||||||
in-out property <string> conv_image_name;
|
in-out property <string> conv_image_name;
|
||||||
in-out property <bool> conv_image_enable;
|
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;
|
||||||
|
@ -173,7 +202,7 @@ export component FileTab inherits Rectangle {
|
||||||
palette_data <=> root.conv_palette_data;
|
palette_data <=> root.conv_palette_data;
|
||||||
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_button <=> root.conv_image_enable;
|
enable_view <=> root.conv_enable_view;
|
||||||
|
|
||||||
browse_clicked => {
|
browse_clicked => {
|
||||||
root.conv_image_browse_clicked();
|
root.conv_image_browse_clicked();
|
||||||
|
|
Loading…
Reference in New Issue