Browse Source

implement tab close public method

CPP-GTK4
yggverse 3 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(
} }
}; };
void Tab::close()
{
remove_page(
get_current_page()
);
}
void Tab::on_label_click( void Tab::on_label_click(
int n, int n,
double x, double x,
@ -70,8 +77,6 @@ void Tab::on_label_click(
) { ) {
if (n == 2) // double click if (n == 2) // double click
{ {
remove_page( Tab::close();
get_current_page()
);
} }
} }

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

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

Loading…
Cancel
Save