From d5566921924a5edae953c24bb79cda2563da43d4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 21 Dec 2015 14:38:45 +0100 Subject: allow to float detached monitor-section window --- gtk2_ardour/monitor_section.cc | 8 ++++++-- gtk2_ardour/theme_manager.cc | 13 +++++++++++++ gtk2_ardour/theme_manager.h | 2 ++ gtk2_ardour/ui_config_vars.h | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc index 6bab29bdfb..6f7caf99e6 100644 --- a/gtk2_ardour/monitor_section.cc +++ b/gtk2_ardour/monitor_section.cc @@ -455,8 +455,12 @@ MonitorSection::MonitorSection (Session* s) _tearoff = new TearOff (hpacker); - /* if torn off, make this a normal window */ - _tearoff->tearoff_window().set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL); + if (!UIConfiguration::instance().get_floating_monitor_section()) { + /* if torn off, make this a normal window + * (default is WINDOW_TYPE_HINT_UTILITY in libs/gtkmm2ext/tearoff.cc) + */ + _tearoff->tearoff_window().set_type_hint (Gdk::WINDOW_TYPE_HINT_NORMAL); + } _tearoff->tearoff_window().set_title (X_("Monitor")); _tearoff->tearoff_window().signal_key_press_event().connect (sigc::ptr_fun (forward_key_press), false); diff --git a/gtk2_ardour/theme_manager.cc b/gtk2_ardour/theme_manager.cc index 884a970e28..9cd36043e1 100644 --- a/gtk2_ardour/theme_manager.cc +++ b/gtk2_ardour/theme_manager.cc @@ -35,6 +35,7 @@ #include "pbd/compose.h" #include "ardour/filesystem_paths.h" +#include "ardour/profile.h" #include "canvas/container.h" #include "canvas/rectangle.h" @@ -70,6 +71,7 @@ ThemeManager::ThemeManager() , timeline_item_gradient_depth_label (_("Timeline item gradient depth")) , all_dialogs (_("All floating windows are dialogs")) , transients_follow_front (_("Transient windows follow front window.")) + , floating_monitor_section (_("Float detached monitor-section window")) , icon_set_label (_("Icon Set")) , palette_viewport (*palette_scroller.get_hadjustment(), *palette_scroller.get_vadjustment()) , palette_group (0) @@ -113,6 +115,9 @@ ThemeManager::ThemeManager() #ifndef __APPLE__ pack_start (all_dialogs, PACK_SHRINK); pack_start (transients_follow_front, PACK_SHRINK); + if (!Profile->get_mixbus()) { + pack_start (floating_monitor_section, PACK_SHRINK); + } #endif pack_start (flat_buttons, PACK_SHRINK); pack_start (blink_rec_button, PACK_SHRINK); @@ -183,6 +188,7 @@ ThemeManager::ThemeManager() timeline_item_gradient_depth.signal_value_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_timeline_item_gradient_depth_change)); all_dialogs.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_all_dialogs_toggled)); transients_follow_front.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_transients_follow_front_toggled)); + floating_monitor_section.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_floating_monitor_section_toggled)); icon_set_dropdown.signal_changed().connect (sigc::mem_fun (*this, &ThemeManager::on_icon_set_changed)); Gtkmm2ext::UI::instance()->set_tip (all_dialogs, @@ -305,6 +311,12 @@ ThemeManager::on_transients_follow_front_toggled () UIConfiguration::instance().set_transients_follow_front (transients_follow_front.get_active()); } +void +ThemeManager::on_floating_monitor_section_toggled () +{ + UIConfiguration::instance().set_floating_monitor_section (floating_monitor_section.get_active()); +} + void ThemeManager::on_waveform_gradient_depth_change () { @@ -368,6 +380,7 @@ ThemeManager::set_ui_to_state() */ all_dialogs.set_active (UIConfiguration::instance().get_all_floating_windows_are_dialogs()); transients_follow_front.set_active (UIConfiguration::instance().get_transients_follow_front()); + floating_monitor_section.set_active (UIConfiguration::instance().get_floating_monitor_section()); flat_buttons.set_active (UIConfiguration::instance().get_flat_buttons()); blink_rec_button.set_active (UIConfiguration::instance().get_blink_rec_arm()); region_color_button.set_active (UIConfiguration::instance().get_color_regions_using_track_color()); diff --git a/gtk2_ardour/theme_manager.h b/gtk2_ardour/theme_manager.h index 6ed58207fa..36e85e5dd9 100644 --- a/gtk2_ardour/theme_manager.h +++ b/gtk2_ardour/theme_manager.h @@ -60,6 +60,7 @@ class ThemeManager : public Gtk::VBox void on_timeline_item_gradient_depth_change (); void on_all_dialogs_toggled (); void on_transients_follow_front_toggled (); + void on_floating_monitor_section_toggled (); void on_icon_set_changed (); private: @@ -92,6 +93,7 @@ class ThemeManager : public Gtk::VBox Gtk::Label timeline_item_gradient_depth_label; Gtk::CheckButton all_dialogs; Gtk::CheckButton transients_follow_front; + Gtk::CheckButton floating_monitor_section; Gtk::CheckButton gradient_waveforms; Gtk::Label icon_set_label; Gtk::ComboBoxText icon_set_dropdown; diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h index 3a46b53ef9..2cf2855390 100644 --- a/gtk2_ardour/ui_config_vars.h +++ b/gtk2_ardour/ui_config_vars.h @@ -25,6 +25,7 @@ UI_CONFIG_VARIABLE (bool, blink_rec_arm, "blink-rec-arm", false) UI_CONFIG_VARIABLE (float, waveform_gradient_depth, "waveform-gradient-depth", 0) UI_CONFIG_VARIABLE (float, timeline_item_gradient_depth, "timeline-item-gradient-depth", 0.5) UI_CONFIG_VARIABLE (bool, all_floating_windows_are_dialogs, "all-floating-windows-are-dialogs", false) +UI_CONFIG_VARIABLE (bool, floating_monitor_section, "floating-monitor-section", false) UI_CONFIG_VARIABLE (bool, transients_follow_front, "transients-follow-front", false) UI_CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-track-color", false) UI_CONFIG_VARIABLE (bool, show_waveform_clipping, "show-waveform-clipping", true) -- cgit v1.2.3