clean up tabbable state maintainance; drop Gtk::Button unintentionally used for close cross image
This commit is contained in:
parent
d6f3a006d2
commit
b6c4ae46d0
@ -87,13 +87,12 @@ class LIBGTKMM2EXT_API Tabbable : public WindowProxy {
|
|||||||
std::string _tab_title;
|
std::string _tab_title;
|
||||||
Gtk::HBox _tab_box;
|
Gtk::HBox _tab_box;
|
||||||
Gtk::Label _tab_label;
|
Gtk::Label _tab_label;
|
||||||
Gtk::Button _tab_close_button;
|
|
||||||
CairoIcon tab_close_image;
|
CairoIcon tab_close_image;
|
||||||
bool tab_requested_by_state;
|
bool tab_requested_by_state;
|
||||||
|
|
||||||
void show_tab ();
|
void show_tab ();
|
||||||
void hide_tab ();
|
void hide_tab ();
|
||||||
void tab_close_clicked ();
|
bool tab_close_clicked (GdkEventButton*);
|
||||||
void show_own_window (bool and_pack_it);
|
void show_own_window (bool and_pack_it);
|
||||||
void window_mapped ();
|
void window_mapped ();
|
||||||
void window_unmapped ();
|
void window_unmapped ();
|
||||||
|
@ -39,14 +39,14 @@ Tabbable::Tabbable (Widget& w, const string& name)
|
|||||||
, tab_close_image (ArdourIcon::CloseCross, 0xffffffff)
|
, tab_close_image (ArdourIcon::CloseCross, 0xffffffff)
|
||||||
, tab_requested_by_state (true)
|
, tab_requested_by_state (true)
|
||||||
{
|
{
|
||||||
|
/* sizes will be scaled during rendering */
|
||||||
tab_close_image.set_size_request (15,15);
|
tab_close_image.set_size_request (15,15);
|
||||||
|
|
||||||
_tab_box.set_spacing (2);
|
_tab_box.set_spacing (2);
|
||||||
_tab_box.pack_start (_tab_label, true, true);
|
_tab_box.pack_start (_tab_label, true, true);
|
||||||
_tab_box.pack_start (_tab_close_button, false, false);
|
_tab_box.pack_start (tab_close_image, false, false);
|
||||||
_tab_close_button.add (tab_close_image);
|
|
||||||
|
|
||||||
_tab_close_button.signal_clicked().connect (sigc::mem_fun (*this, &Tabbable::tab_close_clicked));
|
tab_close_image.signal_button_release_event().connect (sigc::mem_fun (*this, &Tabbable::tab_close_clicked));
|
||||||
}
|
}
|
||||||
|
|
||||||
Tabbable::~Tabbable ()
|
Tabbable::~Tabbable ()
|
||||||
@ -57,10 +57,11 @@ Tabbable::~Tabbable ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
bool
|
||||||
Tabbable::tab_close_clicked ()
|
Tabbable::tab_close_clicked (GdkEventButton*)
|
||||||
{
|
{
|
||||||
hide_tab ();
|
hide_tab ();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -337,12 +338,12 @@ Tabbable::set_state (const XMLNode& node, int version)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((ret = WindowProxy::set_state (node, version)) == 0) {
|
if ((ret = WindowProxy::set_state (node, version)) != 0) {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (_visible) {
|
if (_visible) {
|
||||||
if (use_own_window (true) == 0) {
|
show_own_window (true);
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLNodeList children = node.children ();
|
XMLNodeList children = node.children ();
|
||||||
@ -355,18 +356,14 @@ Tabbable::set_state (const XMLNode& node, int version)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_visible) {
|
||||||
if (tab_requested_by_state) {
|
if (tab_requested_by_state) {
|
||||||
|
|
||||||
std::cerr << name() << " pn " << _parent_notebook << std::endl;
|
|
||||||
if (_parent_notebook) {
|
|
||||||
std::cerr << "\t page " << _parent_notebook->page_num (_contents) << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
attach ();
|
attach ();
|
||||||
} else {
|
} else {
|
||||||
/* this does nothing if not tabbed */
|
/* this does nothing if not tabbed */
|
||||||
hide_tab ();
|
hide_tab ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user