~am-monkeyd/marlin/marlin-gtk2-test

« back to all changes in this revision

Viewing changes to src/View/Window.vala

  • Committer: am.monkeyd at gmail
  • Date: 2011-03-26 00:39:58 UTC
  • Revision ID: am.monkeyd@gmail.com-20110326003958-22w7v0yuuf26fxvo
contextview toggable panel F7 + start with option

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
 
156
156
            main_box.pack1(tabs, true, true);
157
157
 
158
 
            contextview = new ContextView(this, true);
159
 
            main_box.pack2(contextview, false, false);
 
158
            ((Gtk.ToggleAction) main_actions.get_action("Show Hide Context Pane")).set_active(Preferences.settings.get_boolean("start-with-contextview"));
 
159
 
160
160
            main_box.collapse_mode = CollapseMode.RIGHT;
161
161
            main_box.set_name("app-sidebar"); /* TODO remove later if uneeded - test theming */
162
162
 
353
353
            if (is_maximized == false) 
354
354
                Preferences.settings.set_string("geometry", geometry);
355
355
            Preferences.settings.set_boolean("maximized", is_maximized);
 
356
            
 
357
            Preferences.settings.set_boolean("start-with-contextview",
 
358
                ((Gtk.ToggleAction) main_actions.get_action("Show Hide Context Pane")).get_active());
356
359
        }
357
360
 
358
361
        public Gtk.ActionGroup get_actiongroup () {
385
388
                current_tab.reload();
386
389
        }
387
390
 
388
 
        private void action_show_hide_menubar (Gtk.Action action) {
 
391
        private void action_show_hide_contextview (Gtk.Action action) {
 
392
            if (((Gtk.ToggleAction)action).get_active()) {
 
393
                current_tab.sync_contextview();
 
394
                ((FM.Directory.View) current_tab.slot.view_box).sync_selection();
 
395
            } else {
 
396
                 //main_box.remove (contextview);
 
397
                contextview.destroy();
 
398
                contextview = null;
 
399
            }
 
400
        }
 
401
 
 
402
        /*private void action_show_hide_menubar (Gtk.Action action) {
389
403
            bool vis = true;
390
404
            menu_bar.get("visible", &vis);
391
405
            if (vis)
392
406
                top_menu.app_menu.hide();
393
407
            else
394
408
                top_menu.app_menu.show_all();
395
 
        }
 
409
        }*/
396
410
 
397
411
        /*private void action_show_hide_sidebar (Gtk.Action action) {
398
412
            stdout.printf ("TODO\n");
484
498
  /* tooltip */                  N_("Toggle the display of hidden files in the current window"),
485
499
                                 action_show_hidden_files,
486
500
                                 true },
 
501
  /* name, stock id */         { "Show Hide Context Pane", null,
 
502
  /* label, accelerator */       N_("_Context Pane"), "F7",
 
503
  /* tooltip */                  N_("Change the visibility of the context pane"),
 
504
                                 action_show_hide_contextview,
 
505
  /* is_active */                true },
487
506
  /* name, stock id */         { "Show Hide Menubar", null,
488
507
  /* label, accelerator */       N_("_Menubar"), "F8",
489
508
  /* tooltip */                  N_("Change the visibility of this window's menubar"),
490
 
                                 action_show_hide_menubar,
 
509
                                 /* action_show_hide_menubar, */
 
510
                                 null,
491
511
  /* is_active */                true },
492
512
  /* name, stock id */         { "Show Hide Sidebar", null,
493
513
  /* label, accelerator */       N_("_Side Pane"), "F9",