work work on window mgmt: offer the change to mark all floating windows as Dialogs (in th theme manager), and mark ArdourWindow and ArdourDialog as transient-for on creation, based on current WindowManager (ardour-object) settings
This commit is contained in:
parent
a902737db9
commit
87d502c15b
|
@ -112,6 +112,14 @@ void
|
|||
ArdourDialog::init ()
|
||||
{
|
||||
set_border_width (10);
|
||||
// set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
|
||||
|
||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
|
||||
|
||||
Gtk::Window* parent = WindowManager::instance().transient_parent();
|
||||
|
||||
if (parent) {
|
||||
set_transient_for (*parent);
|
||||
}
|
||||
|
||||
ARDOUR_UI::CloseAllDialogs.connect (sigc::bind (sigc::mem_fun (*this, &ArdourDialog::response), RESPONSE_CANCEL));
|
||||
}
|
||||
|
|
|
@ -149,12 +149,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
|||
|
||||
, gui_object_state (new GUIObjectState)
|
||||
|
||||
, _startup (0)
|
||||
, engine (0)
|
||||
, nsm (0)
|
||||
, _was_dirty (false)
|
||||
, _mixer_on_top (false)
|
||||
|
||||
, primary_clock (new MainClock (X_("primary"), false, X_("transport"), true, true, true, false, true))
|
||||
, secondary_clock (new MainClock (X_("secondary"), false, X_("secondary"), true, true, false, false, true))
|
||||
|
||||
|
@ -162,6 +156,14 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
|||
|
||||
, big_clock (new AudioClock (X_("bigclock"), false, "big", true, true, false, false))
|
||||
|
||||
/* start of private members */
|
||||
|
||||
, _startup (0)
|
||||
, engine (0)
|
||||
, nsm (0)
|
||||
, _was_dirty (false)
|
||||
, _mixer_on_top (false)
|
||||
|
||||
/* transport */
|
||||
|
||||
, roll_controllable (new TransportControllable ("transport roll", *this, TransportControllable::Roll))
|
||||
|
|
|
@ -102,8 +102,21 @@ ArdourWindow::init ()
|
|||
vice versa.
|
||||
*/
|
||||
|
||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY);
|
||||
if (ARDOUR_UI::instance()->config()->all_floating_windows_are_dialogs.get()) {
|
||||
cerr << "AW " << get_title() << " => dialog\n";
|
||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_DIALOG);
|
||||
} else {
|
||||
cerr << "AW " << get_title() << " => utility\n";
|
||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_UTILITY);
|
||||
}
|
||||
|
||||
Gtk::Window* parent = WindowManager::instance().transient_parent();
|
||||
|
||||
if (parent) {
|
||||
cerr << "\tmarked as transient for " << parent->get_title() << endl;
|
||||
set_transient_for (*parent);
|
||||
}
|
||||
|
||||
ARDOUR_UI::CloseAllDialogs.connect (sigc::mem_fun (*this, &ArdourWindow::hide));
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -43,6 +43,7 @@ class ThemeManager : public ArdourWindow
|
|||
void on_dark_theme_button_toggled ();
|
||||
void on_light_theme_button_toggled ();
|
||||
void on_flat_buttons_toggled ();
|
||||
void on_all_dialogs_toggled ();
|
||||
void on_gradient_waveforms_toggled ();
|
||||
|
||||
private:
|
||||
|
@ -70,6 +71,7 @@ class ThemeManager : public ArdourWindow
|
|||
Gtk::RadioButton light_button;
|
||||
Gtk::Button reset_button;
|
||||
Gtk::CheckButton flat_buttons;
|
||||
Gtk::CheckButton all_dialogs;
|
||||
Gtk::CheckButton gradient_waveforms;
|
||||
|
||||
bool button_press_event (GdkEventButton*);
|
||||
|
|
|
@ -20,4 +20,5 @@
|
|||
UI_CONFIG_VARIABLE(std::string, ui_rc_file, "ui-rc-file", "ardour3_ui_dark.rc")
|
||||
UI_CONFIG_VARIABLE(bool, flat_buttons, "flat-buttons", false)
|
||||
UI_CONFIG_VARIABLE(bool, gradient_waveforms, "gradient-waveforms", false)
|
||||
UI_CONFIG_VARIABLE(bool, all_floating_windows_are_dialogs, "all-floating-windows-are-dialogs", false)
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ WindowManager::instance ()
|
|||
}
|
||||
|
||||
WindowManager::WindowManager ()
|
||||
: current_transient_parent (0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -130,6 +131,8 @@ WindowManager::set_transient_for (Gtk::Window* parent)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
current_transient_parent = parent;
|
||||
}
|
||||
|
||||
/*-----------------------*/
|
||||
|
|
|
@ -182,11 +182,13 @@ class WindowManager
|
|||
|
||||
/* HACK HACK HACK */
|
||||
void set_transient_for (Gtk::Window*);
|
||||
Gtk::Window* transient_parent() const { return current_transient_parent; }
|
||||
|
||||
private:
|
||||
typedef std::list<ProxyBase*> Windows;
|
||||
Windows _windows;
|
||||
Glib::RefPtr<Gtk::ActionGroup> window_actions;
|
||||
Gtk::Window* current_transient_parent;
|
||||
|
||||
WindowManager();
|
||||
~WindowManager();
|
||||
|
|
Loading…
Reference in New Issue
Block a user