~mefrio-g/+junk/dynamic-tabs-fixes

« back to all changes in this revision

Viewing changes to dynamic-tabs.vala

  • Committer: Mario Guerriero
  • Date: 2012-02-07 15:38:49 UTC
  • Revision ID: mefrio.g@gmail.com-20120207153849-o14g4rhxlksxx6hr
added switch_page

Show diffs side-by-side

added added

removed removed

Lines of Context:
226
226
                        break;
227
227
                    case 1:
228
228
                        this.set_active ();
229
 
                        if (e.type == Gdk.EventType.2BUTTON_PRESS && this.tabs.duplicateable){
 
229
                        if (e.type == Gdk.EventType.2BUTTON_PRESS && this.tabs.duplicateable)
230
230
                            this.duplicate ();
231
 
                        else if (e.type == Gdk.EventType.2BUTTON_PRESS && this.tabs.renamable){
 
231
                        //else if (e.type == Gdk.EventType.2BUTTON_PRESS && this.tabs.renamable)
232
232
                            //TODO !!!
233
 
                        }
234
 
                        }else if (this.tabs.reorderable && !this.pinned){
 
233
                        
 
234
                        else if (this.tabs.reorderable && !this.pinned){
235
235
                            moving = true;
236
236
                            this.raise_top ();
237
237
                            o_x = e.x_root;
238
238
                        }
 
239
                        var page_num = (int)(this.x / this.width) % (int)tabs.tabs.length ();
 
240
                        tabs.switch_page (this, page, page_num);
239
241
                        break;
240
242
                }
241
243
                return true;
487
489
         * Tab was dragged outside, you should create a new window and pack Tab into it
488
490
         **/
489
491
        public signal void new_window (tab tab);
 
492
        /**
 
493
         *mSignal for the tab switching
 
494
         */
 
495
        public signal void switch_page (tab tab, Gtk.Widget page, uint page_num);
490
496
        
491
497
        internal int TAB_MIN_WIDTH;
492
498
        internal int TAB_MAX_WIDTH;
503
509
        
504
510
        public DynamicNotebook () {
505
511
            this.name = "DynamicNotebook";
506
 
            
 
512
            this.switch_page.connect ((tab, page, page_num) => {stdout.printf ("\nDT");});
507
513
            this.draw_ref        = new Gtk.Notebook ().get_style_context ();
508
514
            this.fake_background = new Gtk.EventBox ();
509
515
            this.fake_background.get_style_context ().add_region ("tab-background", 0);