Browse Source

use lambda function instead of private method

CPP-GTK4
yggverse 3 months ago
parent
commit
bdf33f1086
  1. 24
      src/app/browser/main/tab/label.cpp
  2. 6
      src/app/browser/main/tab/label.hpp

24
src/app/browser/main/tab/label.cpp

@ -20,9 +20,12 @@ Label::Label(
controller->signal_pressed().connect( controller->signal_pressed().connect(
[this](int n, double x, double y) [this](int n, double x, double y)
{ {
on_click( if (n == 2) // double click
n, x, y {
); activate_action(
"win.tab_close"
);
}
} }
); );
@ -31,17 +34,4 @@ Label::Label(
); );
} }
Label::~Label() = default; Label::~Label() = default;
void Label::on_click(
int n,
double x,
double y
) {
if (n == 2) // double click
{
activate_action(
"win.tab_close"
);
}
}

6
src/app/browser/main/tab/label.hpp

@ -13,12 +13,6 @@ namespace app::browser::main::tab
{ {
Glib::RefPtr<Gtk::GestureClick> controller; Glib::RefPtr<Gtk::GestureClick> controller;
void on_click(
int n,
double x,
double y
);
public: public:
Label( Label(

Loading…
Cancel
Save