mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-27 05:05:32 +03:00
Ladybird/AppKit: Remove theme color changing background color
This commit is contained in:
parent
2107ab823d
commit
980e32b4fe
Notes:
sideshowbarker
2024-07-17 16:23:06 +09:00
Author: https://github.com/bplaat Commit: https://github.com/SerenityOS/serenity/commit/980e32b4fe Pull-request: https://github.com/SerenityOS/serenity/pull/22100 Issue: https://github.com/SerenityOS/serenity/issues/21394 Reviewed-by: https://github.com/trflynn89 ✅
@ -26,7 +26,6 @@
|
||||
- (void)loadURL:(URL const&)url;
|
||||
- (void)onLoadStart:(URL const&)url isRedirect:(BOOL)is_redirect;
|
||||
- (void)onLoadFinish:(URL const&)url;
|
||||
- (void)onThemeColorChange:(Color)color;
|
||||
|
||||
- (void)onTitleChange:(DeprecatedString const&)title;
|
||||
- (void)onFaviconChange:(Gfx::Bitmap const&)bitmap;
|
||||
|
@ -668,11 +668,7 @@ static void copy_data_to_clipboard(StringView data, NSPasteboardType pasteboard_
|
||||
};
|
||||
|
||||
m_web_view_bridge->on_theme_color_change = [self](auto color) {
|
||||
self.backgroundColor = [NSColor colorWithRed:(color.red() / 255.0)
|
||||
green:(color.green() / 255.0)
|
||||
blue:(color.blue() / 255.0)
|
||||
alpha:1.0];
|
||||
[self.observer onThemeColorChange:color];
|
||||
self.backgroundColor = Ladybird::gfx_color_to_ns_color(color);
|
||||
};
|
||||
|
||||
m_web_view_bridge->on_insert_clipboard_entry = [](auto const& data, auto const&, auto const& mime_type) {
|
||||
|
@ -100,8 +100,6 @@ static constexpr CGFloat const WINDOW_HEIGHT = 800;
|
||||
object:[scroll_view contentView]];
|
||||
|
||||
[self setContentView:scroll_view];
|
||||
self.backgroundColor = [NSColor windowBackgroundColor];
|
||||
self.titlebarAppearsTransparent = YES;
|
||||
}
|
||||
|
||||
return self;
|
||||
@ -226,7 +224,6 @@ static constexpr CGFloat const WINDOW_HEIGHT = 800;
|
||||
- (void)onLoadStart:(URL const&)url isRedirect:(BOOL)is_redirect
|
||||
{
|
||||
if (url != self.last_url) {
|
||||
self.backgroundColor = [NSColor windowBackgroundColor];
|
||||
self.last_url = url;
|
||||
}
|
||||
|
||||
@ -258,23 +255,6 @@ static constexpr CGFloat const WINDOW_HEIGHT = 800;
|
||||
[self updateTabTitleAndFavicon];
|
||||
}
|
||||
|
||||
- (void)onThemeColorChange:(Color)color
|
||||
{
|
||||
auto* nscolor = [NSColor colorWithRed:((CGFloat)color.red()) / 255.0
|
||||
green:((CGFloat)color.green()) / 255.0
|
||||
blue:((CGFloat)color.blue()) / 255.0
|
||||
alpha:1.0];
|
||||
CGFloat hue = 0.0;
|
||||
CGFloat saturation = 0.0;
|
||||
CGFloat brightness = 0.0;
|
||||
[nscolor getHue:&hue saturation:&saturation brightness:&brightness alpha:nil];
|
||||
if (brightness > 0.75)
|
||||
brightness = 0.75;
|
||||
nscolor = [NSColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1.0];
|
||||
self.backgroundColor = nscolor;
|
||||
self.titlebarAppearsTransparent = YES;
|
||||
}
|
||||
|
||||
- (void)onFaviconChange:(Gfx::Bitmap const&)bitmap
|
||||
{
|
||||
static constexpr size_t FAVICON_SIZE = 16;
|
||||
|
Loading…
Reference in New Issue
Block a user