mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 10:37:44 +00:00
LibGUI+Browser: Move GUI::UrlBox to the Browser application
Browser is the only user of this component. Move it to allow making use of LibWebView for URL highlighting.
This commit is contained in:
parent
0715ba889e
commit
55092dd164
8 changed files with 139 additions and 112 deletions
34
Userland/Applications/Browser/URLBox.h
Normal file
34
Userland/Applications/Browser/URLBox.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2023, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibGUI/TextBox.h>
|
||||
|
||||
namespace Browser {
|
||||
|
||||
class URLBox : public GUI::TextBox {
|
||||
C_OBJECT(URLBox)
|
||||
|
||||
public:
|
||||
virtual ~URLBox() override = default;
|
||||
|
||||
void set_focus_transition(bool focus_transition) { m_focus_transition = focus_transition; }
|
||||
bool is_focus_transition() const { return m_focus_transition; }
|
||||
|
||||
private:
|
||||
URLBox();
|
||||
|
||||
void highlight_url();
|
||||
|
||||
virtual void mousedown_event(GUI::MouseEvent&) override;
|
||||
virtual void focusout_event(GUI::FocusEvent&) override;
|
||||
virtual void focusin_event(GUI::FocusEvent&) override;
|
||||
|
||||
bool m_focus_transition { true };
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue