From f8279f179f3ec8471fcf7ea92e7c82ec3cf504ae Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 30 Oct 2018 13:22:45 +0800 Subject: [PATCH] Clones.bjs Clones.vala --- Clones.bjs | 2 +- Clones.vala | 28 +++++++++++----------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/Clones.bjs b/Clones.bjs index f38739cd..f2543cf7 100644 --- a/Clones.bjs +++ b/Clones.bjs @@ -13,7 +13,7 @@ "response" : "(self, response_id) => { \n \n this.el.hide();\n \n}" }, "default_width" : 600, - "| void show" : "() {\n\n \n this.el.set_deletable(false);\n this.el.show_all();\n // load clones..\n// this.get('/reposStore').load();\n \n //this.get('/ok_button').el.set_sensitive(false);\n \n // block until we return.\n// var run_ret = this.el.run();\n// if (run_ret < 1 ) {\n// return \"DONE\";\n// }\n// print(\"RUN RETURN : \" + run_ret);\n// return \"DONE\";\n //print(JSON.stringify(this.get('bug').getValue()));\n // return this.get('bug').getValue();\n //this.success = c.success;\n}\n", + "| 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\tthis.view.el.grab_focus();\n}\n", "$ deletable" : true, "title" : "Manage Clones", "xtype" : "Popover", diff --git a/Clones.vala b/Clones.vala index 2c6acde0..57c2a3fb 100644 --- a/Clones.vala +++ b/Clones.vala @@ -62,26 +62,20 @@ public class Clones : Object } // user defined functions - public void show () { + public void show (Gtk.Widget button) { - this.el.set_deletable(false); this.el.show_all(); - // load clones.. - // this.get('/reposStore').load(); - - //this.get('/ok_button').el.set_sensitive(false); - - // block until we return. - // var run_ret = this.el.run(); - // if (run_ret < 1 ) { - // return "DONE"; - // } - // print("RUN RETURN : " + run_ret); - // return "DONE"; - //print(JSON.stringify(this.get('bug').getValue())); - // return this.get('bug').getValue(); - //this.success = c.success; + //console.log('show all'); + this.el.set_modal(true); + this.el.set_relative_to(btn); + + this.el.set_position(Gtk.PositionType.RIGHT); + + // window + header? + this.el.show_all(); + this.el.set_size_request(800,500); + this.view.el.grab_focus(); } public class Xcls_Box2 : Object { -- 2.39.2