Browse Source

Added Window menu items Toggle Directories, Toggle Terminal and Toggle Menu

pipelines/280567345
eidheim 5 years ago
parent
commit
38b92a54af
  1. 2
      CMakeLists.txt
  2. 3
      src/files.hpp
  3. 14
      src/menu.cpp
  4. 9
      src/window.cpp

2
CMakeLists.txt

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
project(juci) project(juci)
set(JUCI_VERSION "1.6.2.1") set(JUCI_VERSION "1.6.2.2")
set(CPACK_PACKAGE_NAME "jucipp") set(CPACK_PACKAGE_NAME "jucipp")
set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim <eidheim@gmail.com>") set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim <eidheim@gmail.com>")

3
src/files.hpp

@ -217,6 +217,9 @@ const std::string default_config_file =
"window_toggle_full_screen": "F11",)RAW" "window_toggle_full_screen": "F11",)RAW"
#endif #endif
R"RAW( R"RAW(
"window_toggle_directories": "",
"window_toggle_terminal": "",
"window_toggle_menu": "",
"window_toggle_tabs": "", "window_toggle_tabs": "",
"window_toggle_zen_mode": "", "window_toggle_zen_mode": "",
"window_clear_terminal": "" "window_clear_terminal": ""

14
src/menu.cpp

@ -518,7 +518,19 @@ const Glib::ustring menu_xml = R"RAW(<interface>
<attribute name='action'>app.window_toggle_full_screen</attribute> <attribute name='action'>app.window_toggle_full_screen</attribute>
</item> </item>
<item> <item>
<attribute name='label' translatable='yes'>_Toggle _Tabs _Visibility</attribute> <attribute name='label' translatable='yes'>_Toggle _Directories</attribute>
<attribute name='action'>app.window_toggle_directories</attribute>
</item>
<item>
<attribute name='label' translatable='yes'>_Toggle _Terminal</attribute>
<attribute name='action'>app.window_toggle_terminal</attribute>
</item>
<item>
<attribute name='label' translatable='yes'>_Toggle _Menu</attribute>
<attribute name='action'>app.window_toggle_menu</attribute>
</item>
<item>
<attribute name='label' translatable='yes'>_Toggle _Tabs</attribute>
<attribute name='action'>app.window_toggle_tabs</attribute> <attribute name='action'>app.window_toggle_tabs</attribute>
</item> </item>
<item> <item>

9
src/window.cpp

@ -1676,6 +1676,15 @@ void Window::set_menu_actions() {
else else
fullscreen(); fullscreen();
}); });
menu.add_action("window_toggle_directories", [this] {
directories_scrolled_window.set_visible(!directories_scrolled_window.get_visible());
});
menu.add_action("window_toggle_terminal", [this] {
terminal_scrolled_window.set_visible(!terminal_scrolled_window.get_visible());
});
menu.add_action("window_toggle_menu", [this] {
set_show_menubar(!get_show_menubar());
});
menu.add_action("window_toggle_tabs", [] { menu.add_action("window_toggle_tabs", [] {
for(auto &notebook : Notebook::get().notebooks) for(auto &notebook : Notebook::get().notebooks)
notebook.set_show_tabs(!notebook.get_show_tabs()); notebook.set_show_tabs(!notebook.get_show_tabs());

Loading…
Cancel
Save