diff options
| author | Mattias Andrée <m@maandree.se> | 2026-10-11 23:01:38 +0200 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-10-11 23:29:28 +0200 |
| commit | 94659550993f454e12e4bcb8cf93a5ff258bc08c (patch) | |
| tree | f8e1cfe9fbcdec6f09b6cc18c761684dc34505d2 /properties.c | |
| parent | First commit (diff) | |
| download | gbild-94659550993f454e12e4bcb8cf93a5ff258bc08c.tar.gz gbild-94659550993f454e12e4bcb8cf93a5ff258bc08c.tar.bz2 gbild-94659550993f454e12e4bcb8cf93a5ff258bc08c.tar.xz | |
Second commit
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
| -rw-r--r-- | properties.c | 28 |
1 files changed, 28 insertions, 0 deletions
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); +} |
