don't run meter in import-dialog if the dialog is not visible
[ardour.git] / gtk2_ardour / theme_manager.cc
index 1fc06bf0a862a854949c12f128ec1f097856d28a..5f707e3212cb6bef9b03222a8c7c344e84bca014 100644 (file)
@@ -31,6 +31,7 @@
 #include "gtkmm2ext/cell_renderer_color_selector.h"
 
 #include "pbd/file_utils.h"
+#include "pbd/compose.h"
 
 #include "ardour/filesystem_paths.h"
 
@@ -57,6 +58,7 @@ ThemeManager::ThemeManager()
        , light_button (_("Light Theme"))
        , reset_button (_("Restore Defaults"))
        , flat_buttons (_("Draw \"flat\" buttons"))
+       , all_dialogs (_("All floating windows are dialogs"))
        , gradient_waveforms (_("Draw waveforms with color gradient"))
 {
        set_title (_("Theme Manager"));
@@ -92,6 +94,9 @@ ThemeManager::ThemeManager()
        vbox->set_homogeneous (false);
        vbox->pack_start (theme_selection_hbox, PACK_SHRINK);
        vbox->pack_start (reset_button, PACK_SHRINK);
+#ifndef __APPLE__
+       vbox->pack_start (all_dialogs, PACK_SHRINK);
+#endif
        vbox->pack_start (flat_buttons, PACK_SHRINK);
        vbox->pack_start (gradient_waveforms, PACK_SHRINK);
        vbox->pack_start (scroller);
@@ -111,8 +116,14 @@ ThemeManager::ThemeManager()
        light_button.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_light_theme_button_toggled));
        reset_button.signal_clicked().connect (sigc::mem_fun (*this, &ThemeManager::reset_canvas_colors));
        flat_buttons.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_flat_buttons_toggled));
+       all_dialogs.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_all_dialogs_toggled));
        gradient_waveforms.signal_toggled().connect (sigc::mem_fun (*this, &ThemeManager::on_gradient_waveforms_toggled));
 
+       Gtkmm2ext::UI::instance()->set_tip (all_dialogs, 
+                                           string_compose (_("Mark all floating windows to be type \"Dialog\" rather than using \"Utility\" for some.\n"
+                                                             "This may help with some window managers. This requires a restart of %1 to take effect"),
+                                                           PROGRAM_NAME));
+
        set_size_request (-1, 400);
        setup_theme ();
 }
@@ -248,6 +259,13 @@ ThemeManager::on_flat_buttons_toggled ()
        gtk_rc_reset_styles (gtk_settings_get_default());
 }
 
+void
+ThemeManager::on_all_dialogs_toggled ()
+{
+       ARDOUR_UI::config()->all_floating_windows_are_dialogs.set (all_dialogs.get_active());
+       ARDOUR_UI::config()->set_dirty ();
+}
+
 void
 ThemeManager::on_gradient_waveforms_toggled ()
 {
@@ -369,6 +387,7 @@ ThemeManager::setup_theme ()
        }
        
        flat_buttons.set_active (ARDOUR_UI::config()->flat_buttons.get());
+       all_dialogs.set_active (ARDOUR_UI::config()->all_floating_windows_are_dialogs.get());
        gradient_waveforms.set_active (ARDOUR_UI::config()->gradient_waveforms.get());
        
        load_rc_file(rcfile, false);