diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-03-30 19:16:07 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-03-30 19:16:37 +0530 |
| commit | 4f945367ebc8e34263acbfca0416e3f75653924e (patch) | |
| tree | aff34361a2b2160aea284df9b619193917bcbc88 /src/widgets/WebViewStack.cpp | |
| parent | e690963fb6c0240171236fc2d669f95ee26b6798 (diff) | |
| download | null-browser-4f945367ebc8e34263acbfca0416e3f75653924e.tar.gz null-browser-4f945367ebc8e34263acbfca0416e3f75653924e.zip | |
Update window title on tab change + refactoring
Diffstat (limited to '')
| -rw-r--r-- | src/widgets/WebViewStack.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/widgets/WebViewStack.cpp b/src/widgets/WebViewStack.cpp index f01b75c..6de170a 100644 --- a/src/widgets/WebViewStack.cpp +++ b/src/widgets/WebViewStack.cpp @@ -17,6 +17,9 @@ WebViewStack::WebViewStack(const Configuration *configuration, layout->setContentsMargins(0, 0, 0, 0); layout->setStackingMode(QStackedLayout::StackOne); + connect(layout, &QStackedLayout::currentChanged, this, + &WebViewStack::current_webview_changed); + create_new_webview(configuration->new_tab_url, true); } @@ -50,6 +53,8 @@ WebView *WebViewStack::create_new_webview(const QUrl &url, bool focus) { if (focus) focus_webview(webview->get_id()); + emit current_webview_changed(layout->currentIndex()); + return webview; } @@ -116,6 +121,7 @@ void WebViewStack::close(WebViewId webview_id) { // TODO: Close window on empty if (webview_list.isEmpty()) { + // window()->close(); create_new_webview(configuration->new_tab_url, true); } } |
