Display size of image
This commit is contained in:
parent
58b2f62d2f
commit
6375183624
|
@ -25,8 +25,11 @@ impl FileTab {
|
|||
self.update_palette(palette);
|
||||
|
||||
let main_window = self.main_window.borrow();
|
||||
let image_size = image.size();
|
||||
|
||||
main_window.set_file_tab_image_data(image);
|
||||
main_window.set_file_tab_image_width(image_size.width as i32);
|
||||
main_window.set_file_tab_image_height(image_size.height as i32);
|
||||
if let Some(file_name) = file_name {
|
||||
main_window.set_file_tab_image_name(file_name.into());
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@ export component MainWindow inherits Window {
|
|||
// Convert Image values
|
||||
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;
|
||||
in-out property file_tab-image_height <=> file_tab.conv-image_height;
|
||||
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;
|
||||
|
|
|
@ -15,6 +15,8 @@ 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;
|
||||
|
@ -59,6 +61,7 @@ component ConvertImageWidget inherits Rectangle {
|
|||
padding: 4px;
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
VerticalLayout {
|
||||
Rectangle {
|
||||
width: 256px + 2*4px; // < Because of border
|
||||
height: 256px + 2*4px; // < Because of border
|
||||
|
@ -73,6 +76,19 @@ component ConvertImageWidget inherits Rectangle {
|
|||
image-rendering: pixelated;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Text {
|
||||
text: "Width: " + root.image-width;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
Text {
|
||||
text: "Height: " + root.image-height;
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
// Fake padding because the padding setting for the HorizontalLayout would not work
|
||||
width: 4px;
|
||||
|
@ -172,17 +188,17 @@ component ConvertImageWidget inherits Rectangle {
|
|||
}
|
||||
|
||||
export component FileTab inherits Rectangle {
|
||||
// TODO: Names are messed up here!
|
||||
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);
|
||||
callback conv-image_browse_clicked;
|
||||
|
@ -220,6 +236,8 @@ export component FileTab inherits Rectangle {
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue