mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
FIX: [STUDIO-1570] wkwebview background color
Change-Id: I6b18a2dbf654b71bff88e0c14317d4479358218a
This commit is contained in:
parent
4132711f4c
commit
a1fcd05baa
4 changed files with 14 additions and 0 deletions
|
@ -95,6 +95,8 @@ WebViewPanel::WebViewPanel(wxWindow *parent)
|
||||||
}
|
}
|
||||||
GetSizer()->Add(m_browser, wxSizerFlags().Expand().Proportion(1));
|
GetSizer()->Add(m_browser, wxSizerFlags().Expand().Proportion(1));
|
||||||
GetSizer()->Layout();
|
GetSizer()->Layout();
|
||||||
|
#else
|
||||||
|
(void) this;
|
||||||
#endif
|
#endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,10 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
|
||||||
webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s (%s) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)", SLIC3R_VERSION,
|
webView->SetUserAgent(wxString::Format("BBL-Slicer/v%s (%s) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)", SLIC3R_VERSION,
|
||||||
Slic3r::GUI::wxGetApp().dark_mode() ? "dark" : "light"));
|
Slic3r::GUI::wxGetApp().dark_mode() ? "dark" : "light"));
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
WKWebView * wkWebView = (WKWebView *) webView->GetNativeBackend();
|
||||||
|
Slic3r::GUI::WKWebView_setTransparentBackground(wkWebView);
|
||||||
|
#endif
|
||||||
#ifndef __WIN32__
|
#ifndef __WIN32__
|
||||||
Slic3r::GUI::wxGetApp().CallAfter([webView] {
|
Slic3r::GUI::wxGetApp().CallAfter([webView] {
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,6 +11,7 @@ extern bool mac_dark_mode();
|
||||||
extern double mac_max_scaling_factor();
|
extern double mac_max_scaling_factor();
|
||||||
extern void set_miniaturizable(void * window);
|
extern void set_miniaturizable(void * window);
|
||||||
void WKWebView_evaluateJavaScript(void * web, wxString const & script, void (*callback)(wxString const &));
|
void WKWebView_evaluateJavaScript(void * web, wxString const & script, void (*callback)(wxString const &));
|
||||||
|
void WKWebView_setTransparentBackground(void * web);
|
||||||
void set_tag_when_enter_full_screen(bool isfullscreen);
|
void set_tag_when_enter_full_screen(bool isfullscreen);
|
||||||
void set_title_colour_after_set_title(void * window);
|
void set_title_colour_after_set_title(void * window);
|
||||||
void initGestures(void * view, wxEvtHandler * handler);
|
void initGestures(void * view, wxEvtHandler * handler);
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <AppKit/NSScreen.h>
|
#import <AppKit/NSScreen.h>
|
||||||
|
#import <WebKit/WebKit.h>
|
||||||
|
|
||||||
#include <objc/runtime.h>
|
#include <objc/runtime.h>
|
||||||
|
|
||||||
|
@ -92,6 +93,12 @@ void WKWebView_evaluateJavaScript(void * web, wxString const & script, void (*ca
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WKWebView_setTransparentBackground(void * web)
|
||||||
|
{
|
||||||
|
WKWebView * webView = (WKWebView*)web;
|
||||||
|
[webView layer].backgroundColor = [NSColor clearColor].CGColor;
|
||||||
|
}
|
||||||
|
|
||||||
void openFolderForFile(wxString const & file)
|
void openFolderForFile(wxString const & file)
|
||||||
{
|
{
|
||||||
NSArray *fileURLs = [NSArray arrayWithObjects:wxCFStringRef(file).AsNSString(), /* ... */ nil];
|
NSArray *fileURLs = [NSArray arrayWithObjects:wxCFStringRef(file).AsNSString(), /* ... */ nil];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue