From 2cade77a1e246e56f0fc1d1ccbb6e6844bef57d9 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 9 Jul 2024 09:42:08 +0600 Subject: [PATCH 01/10] Test resizable images borders shrink --- source/ubinstall-gtk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index bf2cbf8..c8103af 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -234,8 +234,8 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); - int newImgWidthDef = (width <= 217) ? width : width - 217; - int newImgHeightDef = (height <= 120) ? height : height - 217; + int newImgWidthDef = (width <= 10) ? width : width - 10; + int newImgHeightDef = (height <= 10) ? height : height - 10; GdkPixbuf *pixBuf = pixbuf_unscaled; int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef)); if (newImgHeight > newImgHeightDef) { -- 2.35.1 From a70410e0ad5a046ae440d29254bbd3a1a79caee9 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 9 Jul 2024 10:09:52 +0600 Subject: [PATCH 02/10] Increased border size --- source/ubinstall-gtk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index c8103af..28c26c5 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -234,8 +234,8 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); - int newImgWidthDef = (width <= 10) ? width : width - 10; - int newImgHeightDef = (height <= 10) ? height : height - 10; + int newImgWidthDef = (width <= 30) ? width : width - 30; + int newImgHeightDef = (height <= 30) ? height : height - 30; GdkPixbuf *pixBuf = pixbuf_unscaled; int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef)); if (newImgHeight > newImgHeightDef) { -- 2.35.1 From a979a06eafd5f95777747762e0380ffe84c3c4fe Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 9 Jul 2024 10:12:12 +0600 Subject: [PATCH 03/10] Decreased vertical border size --- source/ubinstall-gtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 28c26c5..45f138e 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -235,7 +235,7 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int newImgWidthDef = (width <= 30) ? width : width - 30; - int newImgHeightDef = (height <= 30) ? height : height - 30; + int newImgHeightDef = (height <= 10) ? height : height - 30; GdkPixbuf *pixBuf = pixbuf_unscaled; int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef)); if (newImgHeight > newImgHeightDef) { -- 2.35.1 From 5ff1922e4c7629c7cf7eb520ba19bbc974daf902 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 9 Jul 2024 10:17:07 +0600 Subject: [PATCH 04/10] Increased vertical border size --- source/ubinstall-gtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 45f138e..9257951 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -235,7 +235,7 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int newImgWidthDef = (width <= 30) ? width : width - 30; - int newImgHeightDef = (height <= 10) ? height : height - 30; + int newImgHeightDef = (height <= 50) ? height : height - 30; GdkPixbuf *pixBuf = pixbuf_unscaled; int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef)); if (newImgHeight > newImgHeightDef) { -- 2.35.1 From e8e2e2201a38f760f6cb8982f303e5d804e20c45 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 9 Jul 2024 10:52:01 +0600 Subject: [PATCH 05/10] Test fix --- source/ubinstall-gtk.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 9257951..ebe1812 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -235,7 +235,7 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int newImgWidthDef = (width <= 30) ? width : width - 30; - int newImgHeightDef = (height <= 50) ? height : height - 30; + int newImgHeightDef = (height <= 50) ? height : height - 50; GdkPixbuf *pixBuf = pixbuf_unscaled; int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef)); if (newImgHeight > newImgHeightDef) { @@ -252,18 +252,9 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled void on_region_resized(GtkWidget *,main_window *widgets); void on_region_resized(GtkWidget *,main_window *widgets){ int page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)); - switch(page){ - case YON_PAGE_INSTALLATION: { yon_image_resize_from_container(GTK_IMAGE(widgets->SlidesImage), widgets->slides_original); - } break; - case YON_PAGE_REGION: { yon_image_resize_from_container(GTK_IMAGE(widgets->RegionImage), widgets->regions_original); - - } break; - case YON_PAGE_KEYBOARD: { yon_image_resize_from_container(GTK_IMAGE(widgets->KeyboardImage), widgets->keyboard_original); - } break; - } } void on_toggle_block(GtkToggleButton *self); -- 2.35.1 From 761a18c64b384d565954c7bd2e80689e4fcc19dd Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 9 Jul 2024 10:53:10 +0600 Subject: [PATCH 06/10] Removed unused variable --- source/ubinstall-gtk.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index ebe1812..49d8ffd 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -251,7 +251,6 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled void on_region_resized(GtkWidget *,main_window *widgets); void on_region_resized(GtkWidget *,main_window *widgets){ - int page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook)); yon_image_resize_from_container(GTK_IMAGE(widgets->SlidesImage), widgets->slides_original); yon_image_resize_from_container(GTK_IMAGE(widgets->RegionImage), widgets->regions_original); yon_image_resize_from_container(GTK_IMAGE(widgets->KeyboardImage), widgets->keyboard_original); -- 2.35.1 From 3b1b89462dedba514be8464f3c99ca149e54695a Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 9 Jul 2024 12:25:46 +0600 Subject: [PATCH 07/10] fixes --- source/ubinstall-gtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 49d8ffd..4f232d9 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -235,7 +235,7 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int newImgWidthDef = (width <= 30) ? width : width - 30; - int newImgHeightDef = (height <= 50) ? height : height - 50; + int newImgHeightDef = (height <= 30) ? height : height - 50; GdkPixbuf *pixBuf = pixbuf_unscaled; int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef)); if (newImgHeight > newImgHeightDef) { -- 2.35.1 From dd00452780b62ef1f0ccb5f2d7b9b8e9e0f3867e Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 9 Jul 2024 12:28:35 +0600 Subject: [PATCH 08/10] fixes --- source/ubinstall-gtk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 4f232d9..5576649 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -234,8 +234,8 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); - int newImgWidthDef = (width <= 30) ? width : width - 30; - int newImgHeightDef = (height <= 30) ? height : height - 50; + int newImgWidthDef = (width <= 217) ? width : width - 217; + int newImgHeightDef = (height <= 217) ? height : height - 120; GdkPixbuf *pixBuf = pixbuf_unscaled; int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef)); if (newImgHeight > newImgHeightDef) { -- 2.35.1 From 5811131a0afd4d6865396473d7180482f1f6b513 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 9 Jul 2024 12:42:03 +0600 Subject: [PATCH 09/10] fixes --- source/ubinstall-gtk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 5576649..d724d95 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -234,8 +234,8 @@ int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled int width = gtk_widget_get_allocated_width(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); int height = gtk_widget_get_allocated_height(gtk_widget_get_parent(gtk_widget_get_parent(GTK_WIDGET(target)))); - int newImgWidthDef = (width <= 217) ? width : width - 217; - int newImgHeightDef = (height <= 217) ? height : height - 120; + int newImgWidthDef = (width <= 50) ? width : width - 50; + int newImgHeightDef = (height <= 50) ? height : height - 30; GdkPixbuf *pixBuf = pixbuf_unscaled; int newImgHeight = (int)(gdk_pixbuf_get_height(pixBuf) / ((double) gdk_pixbuf_get_width(pixBuf) / newImgWidthDef)); if (newImgHeight > newImgHeightDef) { -- 2.35.1 From 726c0e61ebba67ae1a00b45add473bc02b1471ca Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 9 Jul 2024 14:32:42 +0600 Subject: [PATCH 10/10] Switched back move and part modes registration --- source/ubinstall-gtk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index d724d95..697503e 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -646,7 +646,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ char *device_name = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->NextInstallationSectionNameEntry)); char *part; gtk_tree_model_get(model,&iter,0,&part,-1); - yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"part"); + yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"next"); yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device); yon_config_register(AUTOSTART_PARTS,AUTOSTART_PARTS_command,part); yon_config_register(device_label_parameter,device_label_parameter_command,device_name); @@ -684,7 +684,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ char *device_name = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry)); char *part; gtk_tree_model_get(model,&iter,0,&part,-1); - yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"next"); + yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"part"); yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device); yon_config_register(AUTOSTART_PARTS,AUTOSTART_PARTS_command,part); yon_config_register(device_label_parameter,device_label_parameter_command,device_name); -- 2.35.1