mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:47:34 +00:00
Ladybird: Set 'device pixels per CSS pixel' to device pixel ratio :^)
This commit is contained in:
parent
f3b6b50ee0
commit
05ef6c9b64
2 changed files with 5 additions and 1 deletions
|
@ -60,7 +60,8 @@ WebContentView::WebContentView(StringView webdriver_content_ipc_path)
|
|||
|
||||
setFocusPolicy(Qt::FocusPolicy::StrongFocus);
|
||||
|
||||
m_inverse_pixel_scaling_ratio = 1.0 / devicePixelRatio();
|
||||
m_device_pixel_ratio = devicePixelRatio();
|
||||
m_inverse_pixel_scaling_ratio = 1.0 / m_device_pixel_ratio;
|
||||
|
||||
verticalScrollBar()->setSingleStep(24);
|
||||
horizontalScrollBar()->setSingleStep(24);
|
||||
|
@ -672,6 +673,7 @@ void WebContentView::create_client()
|
|||
});
|
||||
};
|
||||
|
||||
client().async_set_device_pixels_per_css_pixel(m_device_pixel_ratio);
|
||||
client().async_update_system_theme(MUST(Gfx::load_system_theme(DeprecatedString::formatted("{}/res/themes/Default.ini", s_serenity_resource_root))));
|
||||
client().async_update_system_fonts(Gfx::FontDatabase::default_font_query(), Gfx::FontDatabase::fixed_width_font_query(), Gfx::FontDatabase::window_title_font_query());
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2023, Linus Groh <linusg@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -196,6 +197,7 @@ private:
|
|||
void close_sub_widgets();
|
||||
ErrorOr<Ladybird::DOMNodeProperties> inspect_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement> pseudo_element);
|
||||
|
||||
float m_device_pixel_ratio { 1.0 };
|
||||
qreal m_inverse_pixel_scaling_ratio { 1.0 };
|
||||
bool m_should_show_line_box_borders { false };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue