ladybird/UI/Qt/FindInPageWidget.h
Andreas Kling 328d89f3c1 UI/Qt: Draw custom browser window chrome
Add shared chrome styling helpers and use them to paint the Linux
browser tab strip and surrounding toolbar widgets. Make the browser
window frameless on Qt so the tabs, toolbar, and window controls can
share one integrated chrome surface.
2026-05-26 01:18:51 +02:00

60 lines
1.4 KiB
C++

/*
* Copyright (c) 2024, Tim Ledbetter <timledbetter@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWebView/Forward.h>
#include <UI/Qt/WebContentView.h>
#include <QCheckBox>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QWidget>
namespace Ladybird {
class Tab;
class WebContentView;
class FindInPageWidget final : public QWidget {
Q_OBJECT
public:
FindInPageWidget(Tab* tab, WebContentView* content_view);
void update_result_label(size_t current_match_index, Optional<size_t> const& total_match_count);
void find_previous();
void find_next();
virtual ~FindInPageWidget() override;
public slots:
private:
virtual bool event(QEvent*) override;
virtual void keyPressEvent(QKeyEvent*) override;
virtual void focusInEvent(QFocusEvent*) override;
virtual void showEvent(QShowEvent*) override;
virtual void hideEvent(QHideEvent*) override;
void find_text_changed();
void update_chrome_style();
Tab* m_tab { nullptr };
WebContentView* m_content_view { nullptr };
QLineEdit* m_find_text { nullptr };
QPushButton* m_previous_button { nullptr };
QPushButton* m_next_button { nullptr };
QPushButton* m_exit_button { nullptr };
QCheckBox* m_match_case { nullptr };
QLabel* m_result_label { nullptr };
bool m_is_updating_chrome_style { false };
};
}