commit 2bb04613581b5bea5791c3fbfeb813dcef8d264a
parent 337aabee7d011a4a5d6ee77b16c1bf00fd35fdc9
Author: Dan Callaghan <djc@djc.id.au>
Date: Sun, 12 Sep 2010 20:38:40 +1000
accessibility stuff
Diffstat:
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/src/ImageMetadata.vala b/src/ImageMetadata.vala
@@ -46,6 +46,7 @@ private class Description : Gtk.Table, PropertyEditor {
var label = new Gtk.Label(prop_display_name());
label.xalign = 0;
+ label.mnemonic_widget = text_view;
attach(label,
0, 1, 0, 1,
Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND, 0,
diff --git a/src/MainWindow.vala b/src/MainWindow.vala
@@ -15,28 +15,37 @@ public class MainWindow : Gtk.Window {
image_metadata = new ImageMetadata(path);
image_metadata.load();
table = new Gtk.Table(/* rows */ 2, /* cols */ 2, /* homogeneous */ false);
- image_preview = new Gtk.Image.from_pixbuf(new Gdk.Pixbuf.from_file_at_scale(path, 320, 320, /* preserve aspect */ true));
- tree_view_scrolled = new Gtk.ScrolledWindow(null, null);
- tree_view = new MetadataTreeView.connected_to(image_metadata);
- detail_view = new PropertyDetailView.connected_to(image_metadata, tree_view);
+ var file = File.new_for_path(path);
- title = File.new_for_path(path).get_basename();
+ title = file.get_basename();
default_width = 640;
default_height = 480;
allow_shrink = true;
+ image_preview = new Gtk.Image.from_pixbuf(new Gdk.Pixbuf.from_file_at_scale(path, 320, 320, /* preserve aspect */ true));
+ ((Atk.Object) image_preview.get_accessible())
+ .set_name("Image preview");
+ ((Atk.Object) image_preview.get_accessible())
+ .set_role(Atk.Role.IMAGE);
+ ((Atk.Image) image_preview.get_accessible())
+ .set_image_description(@"Preview of $(file.get_basename())");
table.attach(image_preview,
1, 2, 0, 1,
Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND, 0,
10, 10);
-
+
+ tree_view = new MetadataTreeView.connected_to(image_metadata);
+ ((Atk.Object) tree_view.get_accessible())
+ .set_name("Image properties");
+ tree_view_scrolled = new Gtk.ScrolledWindow(null, null);
tree_view_scrolled.add(tree_view);
tree_view_scrolled.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
table.attach(tree_view_scrolled,
0, 1, 0, 2,
Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND,
0, 0);
-
+
+ detail_view = new PropertyDetailView.connected_to(image_metadata, tree_view);
table.attach(detail_view,
1, 2, 1, 2,
Gtk.AttachOptions.FILL | Gtk.AttachOptions.EXPAND,