allow to float detached monitor-section window
authorRobin Gareus <robin@gareus.org>
Mon, 21 Dec 2015 13:38:45 +0000 (14:38 +0100)
committerRobin Gareus <robin@gareus.org>
Mon, 21 Dec 2015 13:38:45 +0000 (14:38 +0100)
gtk2_ardour/monitor_section.cc
gtk2_ardour/theme_manager.cc
gtk2_ardour/theme_manager.h
gtk2_ardour/ui_config_vars.h

index 6bab29bdfb81bcd3d455a20e16d171e028e0b27a..6f7caf99e6e5f966a25de992bc13a4d7be199954 100644 (file)
@@ -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);
 
index 884a970e284aaef3b078fbf9f745d9aebf7e061d..9cd36043e1f9611edb92cea5c59384d138ba7d54 100644 (file)
@@ -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());
index 6ed58207fa8b0a86a45a58962e3e8c5f49e6b8d7..36e85e5dd9febc3447a99c8c4d7e4320d92f3afe 100644 (file)
@@ -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;
index 3a46b53ef9e5b0b3740c229b3c66564521df30d2..2cf285539055e8caba115a61bff6e084b9103d37 100644 (file)
@@ -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)