projects
/
gitlive
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f8279f1
)
Clones.bjs
author
Alan Knowles
<alan@roojs.com>
Tue, 30 Oct 2018 05:39:20 +0000
(13:39 +0800)
committer
Alan Knowles
<alan@roojs.com>
Tue, 30 Oct 2018 05:39:20 +0000
(13:39 +0800)
Clones.vala
Clones.bjs
patch
|
blob
|
history
Clones.vala
patch
|
blob
|
history
diff --git
a/Clones.bjs
b/Clones.bjs
index
f2543cf
..
e4d28b6
100644
(file)
--- a/
Clones.bjs
+++ b/
Clones.bjs
@@
-8,12
+8,8
@@
"build_module" : "",
"items" : [
{
"build_module" : "",
"items" : [
{
- "listeners" : {
- "delete_event" : "(self, event) => {\n this.el.hide();\n return true; \n //test \n}\n ",
- "response" : "(self, response_id) => { \n \n this.el.hide();\n \n}"
- },
"default_width" : 600,
"default_width" : 600,
- "| void show" : "(Gtk.
Widget button) {\n\n this.el.set_deletable(false);\n this.el.show_all();\n \t//console.log('show all');\n\tthis.el.set_modal(true);\n\tthis.el.set_relative_to(btn);\n\n\tthis.el.set_position(Gtk.PositionType.RIGHT);\n\n\t// window + header?\n\tthis.el.show_all();\n\tthis.el.set_size_request(800,500);\n\t
this.view.el.grab_focus();\n}\n",
+ "| void show" : "(Gtk.
StatusIcon icon) {\n\n Gdk.Rectangle area;\n Gdk.Screen screen;\n Gtk.Orientation ori;\n \n icon.get_geometry(out screen, out area, out ori);\n \n\tthis.el.set_pointing_to(area);\n \n \t//console.log('show all');\n\tthis.el.set_modal(true);\n\n\n\tthis.el.set_position(Gtk.PositionType.TOP);\n//\tthis.el.popup();\n\t// window + header?\n\tthis.el.show_all();\n\tthis.el.set_size_request(800,500);\n\n\t//
this.view.el.grab_focus();\n}\n",
"$ deletable" : true,
"title" : "Manage Clones",
"xtype" : "Popover",
"$ deletable" : true,
"title" : "Manage Clones",
"xtype" : "Popover",
@@
-24,7
+20,7
@@
"items" : [
{
"xtype" : "Box",
"items" : [
{
"xtype" : "Box",
- "$ pack" : "
get_content_area().add
",
+ "$ pack" : "
add
",
"$ xns" : "Gtk",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
"items" : [
"$ xns" : "Gtk",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
"items" : [
@@
-223,15
+219,15
@@
]
}
]
]
}
]
+ },
+ {
+ "label" : "Close",
+ "id" : "ok_button",
+ "* pack" : "add",
+ "xtype" : "Button",
+ "$ xns" : "Gtk"
}
]
}
]
- },
- {
- "label" : "Close",
- "id" : "ok_button",
- "* pack" : "add_action_widget,1 ",
- "xtype" : "Button",
- "$ xns" : "Gtk"
}
]
}
}
]
}
diff --git
a/Clones.vala
b/Clones.vala
index
57c2a3f
..
45caad8
100644
(file)
--- a/
Clones.vala
+++ b/
Clones.vala
@@
-43,39
+43,31
@@
public class Clones : Object
this.el.modal = true;
var child_0 = new Xcls_Box2( _this );
child_0.ref();
this.el.modal = true;
var child_0 = new Xcls_Box2( _this );
child_0.ref();
- this.el.get_content_area().add ( child_0.el );
- var child_1 = new Xcls_ok_button( _this );
- child_1.ref();
- this.el.add_action_widget ( child_1.el , 1 );
-
- //listeners
- this.el.delete_event.connect( (self, event) => {
- this.el.hide();
- return true;
- //test
- });
- this.el.response.connect( (self, response_id) => {
-
- this.el.hide();
-
- });
+ this.el.add ( child_0.el );
}
// user defined functions
}
// user defined functions
- public void show (Gtk.
Widget butt
on) {
+ public void show (Gtk.
StatusIcon ic
on) {
- this.el.set_deletable(false);
- this.el.show_all();
+ Gdk.Rectangle area;
+ Gdk.Screen screen;
+ Gtk.Orientation ori;
+
+ icon.get_geometry(out screen, out area, out ori);
+
+ this.el.set_pointing_to(area);
+
//console.log('show all');
this.el.set_modal(true);
//console.log('show all');
this.el.set_modal(true);
- this.el.set_relative_to(btn);
- this.el.set_position(Gtk.PositionType.RIGHT);
+ this.el.set_position(Gtk.PositionType.TOP);
+ // this.el.popup();
// window + header?
this.el.show_all();
this.el.set_size_request(800,500);
// window + header?
this.el.show_all();
this.el.set_size_request(800,500);
- this.view.el.grab_focus();
+
+ //this.view.el.grab_focus();
}
public class Xcls_Box2 : Object
{
}
public class Xcls_Box2 : Object
{
@@
-100,6
+92,9
@@
public class Clones : Object
var child_1 = new Xcls_ScrolledWindow9( _this );
child_1.ref();
this.el.add ( child_1.el );
var child_1 = new Xcls_ScrolledWindow9( _this );
child_1.ref();
this.el.add ( child_1.el );
+ var child_2 = new Xcls_ok_button( _this );
+ child_2.ref();
+ this.el.add ( child_2.el );
}
// user defined functions
}
// user defined functions
@@
-937,7
+932,6
@@
public class Clones : Object
-
public class Xcls_ok_button : Object
{
public Gtk.Button el;
public class Xcls_ok_button : Object
{
public Gtk.Button el;
@@
-962,4
+956,5
@@
public class Clones : Object
// user defined functions
}
// user defined functions
}
+
}
}