Skip to content

Commit 980e32b

Browse files
bplaattrflynn89
authored andcommitted
Ladybird/AppKit: Remove theme color changing background color
1 parent 2107ab8 commit 980e32b

File tree

3 files changed

+1
-26
lines changed

3 files changed

+1
-26
lines changed

Ladybird/AppKit/UI/LadybirdWebView.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
- (void)loadURL:(URL const&)url;
2727
- (void)onLoadStart:(URL const&)url isRedirect:(BOOL)is_redirect;
2828
- (void)onLoadFinish:(URL const&)url;
29-
- (void)onThemeColorChange:(Color)color;
3029

3130
- (void)onTitleChange:(DeprecatedString const&)title;
3231
- (void)onFaviconChange:(Gfx::Bitmap const&)bitmap;

Ladybird/AppKit/UI/LadybirdWebView.mm

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,11 +668,7 @@ - (void)setWebViewCallbacks
668668
};
669669

670670
m_web_view_bridge->on_theme_color_change = [self](auto color) {
671-
self.backgroundColor = [NSColor colorWithRed:(color.red() / 255.0)
672-
green:(color.green() / 255.0)
673-
blue:(color.blue() / 255.0)
674-
alpha:1.0];
675-
[self.observer onThemeColorChange:color];
671+
self.backgroundColor = Ladybird::gfx_color_to_ns_color(color);
676672
};
677673

678674
m_web_view_bridge->on_insert_clipboard_entry = [](auto const& data, auto const&, auto const& mime_type) {

Ladybird/AppKit/UI/Tab.mm

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ - (instancetype)init
100100
object:[scroll_view contentView]];
101101

102102
[self setContentView:scroll_view];
103-
self.backgroundColor = [NSColor windowBackgroundColor];
104-
self.titlebarAppearsTransparent = YES;
105103
}
106104

107105
return self;
@@ -226,7 +224,6 @@ - (void)loadURL:(URL const&)url
226224
- (void)onLoadStart:(URL const&)url isRedirect:(BOOL)is_redirect
227225
{
228226
if (url != self.last_url) {
229-
self.backgroundColor = [NSColor windowBackgroundColor];
230227
self.last_url = url;
231228
}
232229

@@ -258,23 +255,6 @@ - (void)onTitleChange:(DeprecatedString const&)title
258255
[self updateTabTitleAndFavicon];
259256
}
260257

261-
- (void)onThemeColorChange:(Color)color
262-
{
263-
auto* nscolor = [NSColor colorWithRed:((CGFloat)color.red()) / 255.0
264-
green:((CGFloat)color.green()) / 255.0
265-
blue:((CGFloat)color.blue()) / 255.0
266-
alpha:1.0];
267-
CGFloat hue = 0.0;
268-
CGFloat saturation = 0.0;
269-
CGFloat brightness = 0.0;
270-
[nscolor getHue:&hue saturation:&saturation brightness:&brightness alpha:nil];
271-
if (brightness > 0.75)
272-
brightness = 0.75;
273-
nscolor = [NSColor colorWithHue:hue saturation:saturation brightness:brightness alpha:1.0];
274-
self.backgroundColor = nscolor;
275-
self.titlebarAppearsTransparent = YES;
276-
}
277-
278258
- (void)onFaviconChange:(Gfx::Bitmap const&)bitmap
279259
{
280260
static constexpr size_t FAVICON_SIZE = 16;

0 commit comments

Comments
 (0)