mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
hide tabs in main window when there's only 1 tab left.
This helps with space and also prevents tearing off the last tab
This commit is contained in:
parent
552e995297
commit
77b6b25f2d
2 changed files with 24 additions and 0 deletions
|
|
@ -825,6 +825,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
||||||
void grab_focus_after_dialog ();
|
void grab_focus_after_dialog ();
|
||||||
|
|
||||||
void tabs_switch (GtkNotebookPage*, guint page_number);
|
void tabs_switch (GtkNotebookPage*, guint page_number);
|
||||||
|
void tabs_page_added (Gtk::Widget*, guint page_number);
|
||||||
|
void tabs_page_removed (Gtk::Widget*, guint page_number);
|
||||||
bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev, Gtkmm2ext::Bindings*);
|
bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev, Gtkmm2ext::Bindings*);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,8 @@ ARDOUR_UI::setup_windows ()
|
||||||
rc_option_editor->contents().show_all ();
|
rc_option_editor->contents().show_all ();
|
||||||
|
|
||||||
_tabs.signal_switch_page().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_switch));
|
_tabs.signal_switch_page().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_switch));
|
||||||
|
_tabs.signal_page_removed().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_page_removed));
|
||||||
|
_tabs.signal_page_added().connect (sigc::mem_fun (*this, &ARDOUR_UI::tabs_page_added));
|
||||||
|
|
||||||
/* It would be nice if Gtkmm had wrapped this rather than just
|
/* It would be nice if Gtkmm had wrapped this rather than just
|
||||||
* deprecating the old set_window_creation_hook() method, but oh well...
|
* deprecating the old set_window_creation_hook() method, but oh well...
|
||||||
|
|
@ -158,6 +160,26 @@ ARDOUR_UI::setup_windows ()
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::tabs_page_removed (Gtk::Widget*, guint)
|
||||||
|
{
|
||||||
|
if (_tabs.get_n_pages() == 1) {
|
||||||
|
_tabs.set_show_tabs (false);
|
||||||
|
} else {
|
||||||
|
_tabs.set_show_tabs (true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::tabs_page_added (Gtk::Widget*, guint)
|
||||||
|
{
|
||||||
|
if (_tabs.get_n_pages() == 1) {
|
||||||
|
_tabs.set_show_tabs (false);
|
||||||
|
} else {
|
||||||
|
_tabs.set_show_tabs (true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page_number)
|
ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page_number)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue