Browse Source

implement tab close public method

CPP-GTK4
yggverse 4 months ago
parent
commit
ea64d486a2
  1. 11
      src/app/browser/main/tab.cpp
  2. 2
      src/app/browser/main/tab.hpp

11
src/app/browser/main/tab.cpp

@ -63,6 +63,13 @@ void Tab::append( @@ -63,6 +63,13 @@ void Tab::append(
}
};
void Tab::close()
{
remove_page(
get_current_page()
);
}
void Tab::on_label_click(
int n,
double x,
@ -70,8 +77,6 @@ void Tab::on_label_click( @@ -70,8 +77,6 @@ void Tab::on_label_click(
) {
if (n == 2) // double click
{
remove_page(
get_current_page()
);
Tab::close();
}
}

2
src/app/browser/main/tab.hpp

@ -49,6 +49,8 @@ namespace app::browser::main @@ -49,6 +49,8 @@ namespace app::browser::main
bool focus
);
void close();
void update();
};
}

Loading…
Cancel
Save