From 94659550993f454e12e4bcb8cf93a5ff258bc08c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 11 Oct 2026 23:01:38 +0200 Subject: Second commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- properties.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 properties.c (limited to 'properties.c') diff --git a/properties.c b/properties.c new file mode 100644 index 0000000..b9ebce7 --- /dev/null +++ b/properties.c @@ -0,0 +1,28 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + +void +open_properties(struct file *file) +{ + /* TODO What shall "Properties" display? */ + + const char *name; + GtkWidget *dialog; + + if (!file || !file->path || !file->image) + return; + + name = strrchr(file->path, '/'); + name = name ? &name[1u] : file->path; + + dialog = gtk_message_dialog_new(GTK_WINDOW(window), 0, GTK_MESSAGE_INFO, + GTK_BUTTONS_CLOSE, "%s", name); + + gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), + "%i × %i pixels", + gdk_pixbuf_get_width(file->image), + gdk_pixbuf_get_height(file->image)); + + g_signal_connect_swapped(dialog, "response", G_CALLBACK(>k_widget_destroy), dialog); + gtk_widget_show(dialog); +} -- cgit v1.3.1