mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
implement multi-tab close action
This commit is contained in:
parent
daa5edcead
commit
f72bf5e723
6 changed files with 84 additions and 1 deletions
|
|
@ -45,4 +45,19 @@ void Main::tab_append()
|
|||
void Main::tab_close()
|
||||
{
|
||||
tab->close();
|
||||
};
|
||||
|
||||
void Main::tab_close_left()
|
||||
{
|
||||
tab->close_left();
|
||||
};
|
||||
|
||||
void Main::tab_close_right()
|
||||
{
|
||||
tab->close_right();
|
||||
};
|
||||
|
||||
void Main::tab_close_all()
|
||||
{
|
||||
tab->close_all();
|
||||
};
|
||||
|
|
@ -25,6 +25,9 @@ namespace app::browser
|
|||
void tab_append();
|
||||
|
||||
void tab_close();
|
||||
void tab_close_left();
|
||||
void tab_close_right();
|
||||
void tab_close_all();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,23 @@ void Tab::close()
|
|||
remove_page(
|
||||
get_current_page()
|
||||
);
|
||||
|
||||
// @TODO clean memory
|
||||
// @TODO fix GtkGizmo reported min height -3, but sizes must be >= 0
|
||||
}
|
||||
|
||||
void Tab::close_left()
|
||||
{} // @TODO
|
||||
|
||||
void Tab::close_right()
|
||||
{} // @TODO
|
||||
|
||||
void Tab::close_all()
|
||||
{
|
||||
while (0 <= get_current_page())
|
||||
{
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
||||
void Tab::on_label_click(
|
||||
|
|
@ -77,6 +94,6 @@ void Tab::on_label_click(
|
|||
) {
|
||||
if (n == 2) // double click
|
||||
{
|
||||
Tab::close();
|
||||
close();
|
||||
}
|
||||
}
|
||||
|
|
@ -50,6 +50,9 @@ namespace app::browser::main
|
|||
);
|
||||
|
||||
void close();
|
||||
void close_left();
|
||||
void close_right();
|
||||
void close_all();
|
||||
|
||||
void update();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue