"* pack" : "add",
"Gtk.ShadowType shadow_type" : "Gtk.ShadowType.IN",
"bool expand" : true,
+ "id" : "iconscroll",
"int width_request" : 600,
"items" : [
{
""
],
"* pack" : "add",
+ "bool has_tooltip" : true,
"id" : "iconview",
"int item_width" : 100,
"int markup_column" : 1,
"int pixbuf_column" : 3,
"items" : [
{
- "$ columns" : "typeof(Object), typeof(string), typeof(string), typeof(Gdk.Pixbuf) ",
+ "$ columns" : "typeof(Object), typeof(string), typeof(string), typeof(Gdk.Pixbuf), typeof(Gdk.Pixbuf) ",
"$ xns" : "Gtk",
"* prop" : "model",
"id" : "iconmodel",
" ",
" ",
"}"
+ ],
+ "query_tooltip" : [
+ "(x, y, keyboard_tooltip, tooltip) => {",
+ "",
+ "\tGtk.TreePath path;",
+ "\tGtk.CellRenderer cell;",
+ "\tvar s = _this.iconview.el.get_item_at_pos(x,y + (int) _this.iconscroll.el.vadjustment.value, out path, out cell);",
+ "\t",
+ "\t",
+ " // GLib.debug(\"Tooltip? %d,%d scroll: %d\",x,y, (int)_this.iconscroll.el.vadjustment.value);",
+ "\t ",
+ "\t",
+ "\tif (path == null) {",
+ "\t\t// GLib.debug(\"Tooltip? - no path\");",
+ "\t\treturn false;",
+ "\t}",
+ "\t",
+ "\tGtk.TreeIter iter;",
+ "\t_this.iconmodel.el.get_iter(out iter, path);",
+ "\tGLib.Value val;",
+ "\t_this.iconmodel.el.get_value(iter, 4, out val);",
+ "\t",
+ "\ttooltip.set_icon((Gdk.Pixbuf) val.get_object());",
+ "\t _this.iconview.el.set_tooltip_item(tooltip, path);",
+ "\treturn true;",
+ "}",
+ ""
]
},
"xtype" : "IconView"
" //this.project_title_path.el.text = pr.firstPath();",
" ",
" // file items contains a reference until we reload ...",
- " Gdk.Pixbuf pixbuf = null;",
+ " \t Gdk.Pixbuf pixbuf = null;",
+ " \tGdk.Pixbuf bigpixbuf = null;",
"\t Gtk.TreeIter iter;",
" var m = this.iconmodel.el;",
" m.clear();",
"\t\t var npixbuf = new Gdk.Pixbuf.from_file(fname);",
"\t\t pixbuf = npixbuf.scale_simple(92, (int) (npixbuf.height * 92.0 /npixbuf.width * 1.0 )",
"\t\t\t\t , Gdk.InterpType.NEAREST) ;",
+ "\t\t\t\tbigpixbuf = npixbuf.scale_simple(368, (int) (npixbuf.height * 368.0 /npixbuf.width * 1.0 )",
+ "\t\t\t\t , Gdk.InterpType.NEAREST) ;",
+ "\t\t\t\t",
"\t\t } ",
"\t\t} catch (Error e) {",
"\t\t // noop",
"\t\t _this.missing_thumb_pixbuf.ref();",
"\t\t }",
"\t\t pixbuf = _this.missing_thumb_pixbuf;",
+ "\t\t bigpixbuf = _this.missing_thumb_pixbuf;",
"",
"\t\t } catch (Error e) {",
"\t\t // noop?",
"\t\t",
"\t\t",
" m.set(iter, 3,pixbuf);",
+ " m.set(iter, 4,bigpixbuf);",
" ",
" // this needs to add to the iconview?",
" ",
public Xcls_view view;
public Xcls_model model;
public Xcls_namecol namecol;
+ public Xcls_iconscroll iconscroll;
public Xcls_iconview iconview;
public Xcls_iconmodel iconmodel;
public Xcls_file_container file_container;
//this.project_title_path.el.text = pr.firstPath();
// file items contains a reference until we reload ...
- Gdk.Pixbuf pixbuf = null;
+ Gdk.Pixbuf pixbuf = null;
+ Gdk.Pixbuf bigpixbuf = null;
Gtk.TreeIter iter;
var m = this.iconmodel.el;
m.clear();
var npixbuf = new Gdk.Pixbuf.from_file(fname);
pixbuf = npixbuf.scale_simple(92, (int) (npixbuf.height * 92.0 /npixbuf.width * 1.0 )
, Gdk.InterpType.NEAREST) ;
+ bigpixbuf = npixbuf.scale_simple(368, (int) (npixbuf.height * 368.0 /npixbuf.width * 1.0 )
+ , Gdk.InterpType.NEAREST) ;
+
}
} catch (Error e) {
// noop
_this.missing_thumb_pixbuf.ref();
}
pixbuf = _this.missing_thumb_pixbuf;
+ bigpixbuf = _this.missing_thumb_pixbuf;
} catch (Error e) {
// noop?
m.set(iter, 3,pixbuf);
+ m.set(iter, 4,bigpixbuf);
// this needs to add to the iconview?
var child_0 = new Xcls_ScrolledWindow10( _this );
child_0.ref();
this.el.add ( child_0.el );
- var child_1 = new Xcls_ScrolledWindow15( _this );
+ var child_1 = new Xcls_iconscroll( _this );
child_1.ref();
this.el.add ( child_1.el );
var child_2 = new Xcls_file_container( _this );
- public class Xcls_ScrolledWindow15 : Object
+ public class Xcls_iconscroll : Object
{
public Gtk.ScrolledWindow el;
private Xcls_PopoverFiles _this;
// my vars (def)
// ctor
- public Xcls_ScrolledWindow15(Xcls_PopoverFiles _owner )
+ public Xcls_iconscroll(Xcls_PopoverFiles _owner )
{
_this = _owner;
+ _this.iconscroll = this;
this.el = new Gtk.ScrolledWindow( null, null );
// my vars (dec)
// set gobject values
this.el.markup_column = 1;
this.el.pixbuf_column = 3;
+ this.el.has_tooltip = true;
this.el.item_width = 100;
var child_0 = new Xcls_iconmodel( _this );
child_0.ref();
+ });
+ this.el.query_tooltip.connect( (x, y, keyboard_tooltip, tooltip) => {
+
+ Gtk.TreePath path;
+ Gtk.CellRenderer cell;
+ var s = _this.iconview.el.get_item_at_pos(x,y + (int) _this.iconscroll.el.vadjustment.value, out path, out cell);
+
+
+ // GLib.debug("Tooltip? %d,%d scroll: %d",x,y, (int)_this.iconscroll.el.vadjustment.value);
+
+
+ if (path == null) {
+ // GLib.debug("Tooltip? - no path");
+ return false;
+ }
+
+ Gtk.TreeIter iter;
+ _this.iconmodel.el.get_iter(out iter, path);
+ GLib.Value val;
+ _this.iconmodel.el.get_value(iter, 4, out val);
+
+ tooltip.set_icon((Gdk.Pixbuf) val.get_object());
+ _this.iconview.el.set_tooltip_item(tooltip, path);
+ return true;
});
}
{
_this = _owner;
_this.iconmodel = this;
- this.el = new Gtk.ListStore.newv( { typeof(Object), typeof(string), typeof(string), typeof(Gdk.Pixbuf) } );
+ this.el = new Gtk.ListStore.newv( { typeof(Object), typeof(string), typeof(string), typeof(Gdk.Pixbuf), typeof(Gdk.Pixbuf) } );
// my vars (dec)