mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
88d134a4da
This commit adds the standard shortcuts for the Find Next and Find Previous buttons on the find in page panel. These shortcuts are usually F3 and Shift+F3 respectively, although Qt standard shortcuts may vary across platforms.
55 lines
1.2 KiB
C++
55 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2024, Tim Ledbetter <timledbetter@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "WebContentView.h"
|
|
#include <LibWebView/Forward.h>
|
|
#include <QCheckBox>
|
|
#include <QLabel>
|
|
#include <QLineEdit>
|
|
#include <QPushButton>
|
|
#include <QWidget>
|
|
|
|
namespace Ladybird {
|
|
|
|
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 void keyPressEvent(QKeyEvent*) override;
|
|
virtual void focusInEvent(QFocusEvent*) override;
|
|
virtual void showEvent(QShowEvent*) override;
|
|
virtual void hideEvent(QHideEvent*) override;
|
|
|
|
void find_text_changed();
|
|
|
|
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 };
|
|
};
|
|
|
|
}
|