Skip to content

Commit 75030f7

Browse files
committed
[ADD] - Conversion Image
An image inbetween the two existing ones that showcases that the original images is being changed to the other one.
1 parent 97cd341 commit 75030f7

File tree

2 files changed

+31
-17
lines changed

2 files changed

+31
-17
lines changed

src/assets/images/arrow.png

40.8 KB
Loading

src/gtk_gui.c

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -151,47 +151,61 @@ static void activate(GtkApplication *app, gpointer user_data)
151151
// include box container in window
152152
gtk_window_set_child(GTK_WINDOW(window), box);
153153

154-
// Create a horizontal box container for the images
154+
// create a horizontal box container for the images
155155
GtkWidget *image_container = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
156156
gtk_widget_set_halign(image_container, GTK_ALIGN_CENTER);
157-
gtk_widget_set_valign(image_container, GTK_ALIGN_CENTER); // Center vertically
158-
// Append the image container to the main vertical box
157+
gtk_widget_set_valign(image_container, GTK_ALIGN_CENTER);
158+
// append the image container to the main vertical box
159159
gtk_box_append(GTK_BOX(box), image_container);
160160

161161
// Create a vertical box container for the user image
162162
user_image_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
163163
gtk_widget_set_halign(user_image_box, GTK_ALIGN_CENTER);
164-
gtk_widget_set_valign(user_image_box, GTK_ALIGN_CENTER); // Center vertically
165-
// Append the user image container to the horizontal image container
164+
gtk_widget_set_valign(user_image_box, GTK_ALIGN_CENTER);
165+
// append the user image container to the horizontal image container
166166
gtk_box_append(GTK_BOX(image_container), user_image_box);
167167

168-
// Create image widget for user image
168+
// create image widget for user image
169169
image = gtk_image_new_from_file("assets/images/test_image.bmp");
170170
gtk_image_set_pixel_size(GTK_IMAGE(image), 250);
171-
// Set horizontal alignment to center for the image
171+
// set horizontal alignment to center for the image
172172
gtk_widget_set_halign(image, GTK_ALIGN_CENTER);
173-
// Append the user image widget to the user image container
173+
// append the user image widget to the user image container
174174
gtk_box_append(GTK_BOX(user_image_box), image);
175175

176-
// Set a top margin for the user image to raise it within the layout
177-
gtk_widget_set_margin_top(image, 50); // Adjust the margin as needed
176+
// set a top margin for the user image to raise it within the layout
177+
gtk_widget_set_margin_top(image, 50);
178+
179+
GtkWidget *new_image = gtk_image_new_from_file("assets/images/arrow.png");
180+
gtk_image_set_pixel_size(GTK_IMAGE(new_image), 250);
181+
gtk_widget_set_halign(new_image, GTK_ALIGN_CENTER);
182+
183+
// create a new container for the new image
184+
GtkWidget *new_image_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
185+
gtk_widget_set_halign(new_image_box, GTK_ALIGN_CENTER);
186+
gtk_widget_set_valign(new_image_box, GTK_ALIGN_CENTER);
187+
gtk_box_append(GTK_BOX(image_container), new_image_box);
188+
189+
// append the new image widget to the new image container
190+
gtk_box_append(GTK_BOX(new_image_box), new_image);
191+
gtk_widget_set_margin_top(new_image, 50);
178192

179-
// Create a vertical box container for the filtered image
193+
// create a vertical box container for the filtered image
180194
filtered_image_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
181195
gtk_widget_set_halign(filtered_image_box, GTK_ALIGN_CENTER);
182-
gtk_widget_set_valign(filtered_image_box, GTK_ALIGN_CENTER); // Center vertically
183-
// Append the filtered image container to the horizontal image container
196+
gtk_widget_set_valign(filtered_image_box, GTK_ALIGN_CENTER);
197+
// append the filtered image container to the horizontal image container
184198
gtk_box_append(GTK_BOX(image_container), filtered_image_box);
185199

186-
// Create image widget for filtered image
200+
// create image widget for filtered image
187201
image = gtk_image_new_from_file("assets/images/test_image.bmp");
188202
gtk_image_set_pixel_size(GTK_IMAGE(image), 250);
189-
// Set horizontal alignment to center for the image
203+
// set horizontal alignment to center for the image
190204
gtk_widget_set_halign(image, GTK_ALIGN_CENTER);
191-
// Append the filtered image widget to the filtered image container
205+
// append the filtered image widget to the filtered image container
192206
gtk_box_append(GTK_BOX(filtered_image_box), image);
193207

194-
// Set a top margin for the filtered image to raise it within the layout
208+
// set a top margin for the filtered image to raise it within the layout
195209
gtk_widget_set_margin_top(image, 50);
196210

197211
// create new horizontal box container for buttons

0 commit comments

Comments
 (0)