13
0

allow to float detached monitor-section window

This commit is contained in:
Robin Gareus 2015-12-21 14:38:45 +01:00
parent 0d9f15dd80
commit d556692192
4 changed files with 22 additions and 2 deletions

View 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);

View 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());

View 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;

View 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)