X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=src%2FBuilder4%2FMainWindow.bjs;h=c5d391694ca2c93975ab88bdbe63e3a39c153c73;hb=a4d742169ad9fd255e938cebe2e6fec2c7121979;hp=2ffff3b3dbcd41eef2d7148e85f96594a635c6bf;hpb=a3bc4d05fe08b2714d5bca8b7539560ab4858f32;p=roobuilder diff --git a/src/Builder4/MainWindow.bjs b/src/Builder4/MainWindow.bjs index 2ffff3b3d..c5d391694 100644 --- a/src/Builder4/MainWindow.bjs +++ b/src/Builder4/MainWindow.bjs @@ -56,6 +56,72 @@ }, "string tooltip_text" : "Manage Windows (Ctrl-O)", "xtype" : "Button" + }, + { + "$ xns" : "Gtk", + "bool has_frame" : false, + "listeners" : { + "clicked" : [ + "( ) => {", + "\t", + "\tGLib.debug(\"undo clicked\");", + "\tif (_this.windowstate.file.xtype == \"PlainFile\") {", + "\t\t_this.windowstate.code_editor_tab.buffer.el.undo();", + "\t}", + "\tif (!_this.windowstate.file.undoStep(-1)) {", + "\t\treturn;", + "\t}", + "\t", + "\t ", + "\t_this.windowstate.switchState (WindowState.State.PREVIEW); ", + "\t// this triggers loadItems..", + "\t_this.windowstate.left_tree.model.loadFile(", + "\t\t_this.windowstate.file);", + "\t ", + "", + "\t", + " ", + "", + "\t// load it everywhere", + "}", + "" + ] + }, + "string icon_name" : "edit-undo", + "xtype" : "Button" + }, + { + "$ xns" : "Gtk", + "bool has_frame" : false, + "listeners" : { + "clicked" : [ + "( ) => {", + "\t", + "\tGLib.debug(\"undo clicked\");", + "\tif (_this.windowstate.file.xtype == \"PlainFile\") {", + "\t\t_this.windowstate.code_editor_tab.buffer.el.redo();", + "\t}", + "\tif (!_this.windowstate.file.undoStep(1)) {", + "\t\treturn;", + "\t}", + "\t", + "\t ", + "\t_this.windowstate.switchState (WindowState.State.PREVIEW); ", + "\t// this triggers loadItems..", + "\t_this.windowstate.left_tree.model.loadFile(", + "\t\t_this.windowstate.file);", + "\t ", + "", + "\t", + " ", + "", + "\t// load it everywhere", + "}", + "" + ] + }, + "string icon_name" : "edit-redo", + "xtype" : "Button" } ], "xtype" : "Box" @@ -592,7 +658,6 @@ "items" : [ { "$ xns" : "Gtk", - "* prop" : "child", "bool has_tooltip" : true, "bool hexpand" : true, "id" : "filesearch", @@ -717,6 +782,7 @@ "listeners" : { "clicked" : [ " ( ) => {", + " \t_this.splitview.el.show_sidebar = false;", " \t_this.windowstate.showPopoverFiles(this.el, _this.project, false);", "}" ] @@ -1277,7 +1343,7 @@ "\t", "\t_this.treeview.el.set_model(_this.treeselmodel.el);", "\t", - " \t _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;", + " \t_this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;", "\t", " ", "}"