[v2] go fmt + windowIsTranslucent

This commit is contained in:
Lea Anthony
2021-09-15 08:41:38 +10:00
parent 00639677f5
commit be87d73da8
26 changed files with 79 additions and 71 deletions

View File

@@ -46,7 +46,7 @@ extern void UpdateTrayMenuLabel(struct Application*, const char* JSON);
extern void AddContextMenu(struct Application*, char *contextMenuJSON);
extern void UpdateContextMenu(struct Application*, char *contextMenuJSON);
extern void WebviewIsTransparent(struct Application*);
extern void WindowBackgroundIsTranslucent(struct Application*);
extern void WindowIsTranslucent(struct Application*);
extern void* GetWindowHandle(struct Application*);
#ifdef __cplusplus

View File

@@ -135,7 +135,7 @@ struct Application {
int fullSizeContent;
int useToolBar;
int hideToolbarSeparator;
int windowBackgroundIsTranslucent;
int WindowIsTranslucent;
int hasURLHandlers;
const char *startupURL;
@@ -293,8 +293,8 @@ void Show(struct Application *app) {
);
}
void WindowBackgroundIsTranslucent(struct Application *app) {
app->windowBackgroundIsTranslucent = 1;
void WindowIsTranslucent(struct Application *app) {
app->WindowIsTranslucent = 1;
}
// Sends messages to the backend
@@ -1534,7 +1534,7 @@ void Run(struct Application *app, int argc, char **argv) {
applyWindowColour(app);
// Process translucency
if (app->windowBackgroundIsTranslucent) {
if (app->WindowIsTranslucent) {
makeWindowBackgroundTranslucent(app);
}
@@ -1775,7 +1775,7 @@ void* NewApplication(const char *title, int width, int height, int resizable, in
result->useToolBar = 0;
result->hideToolbarSeparator = 0;
result->appearance = NULL;
result->windowBackgroundIsTranslucent = 0;
result->WindowIsTranslucent = 0;
// Window data
result->delegate = NULL;

View File

@@ -57,8 +57,8 @@ func (a *Application) processPlatformSettings() error {
}
// Check if window should be translucent
if mac.WindowBackgroundIsTranslucent {
C.WindowBackgroundIsTranslucent(a.app)
if mac.WindowIsTranslucent {
C.WindowIsTranslucent(a.app)
}
// Process menu

View File

@@ -138,7 +138,7 @@ void HideToolbarSeparator(struct Application* app);
void DisableFrame(struct Application* app);
void SetAppearance(struct Application* app, const char *);
void WebviewIsTransparent(struct Application* app);
void WindowBackgroundIsTranslucent(struct Application* app);
void WindowIsTranslucent(struct Application* app);
void SetTray(struct Application* app, const char *, const char *, const char *);
//void SetContextMenus(struct Application* app, const char *);
void AddTrayMenu(struct Application* app, const char *);

View File

@@ -862,7 +862,7 @@ void UpdateTrayMenuLabel(struct Application* app, const char* JSON) {}
void AddContextMenu(struct Application* app, char *contextMenuJSON) {}
void UpdateContextMenu(struct Application* app, char *contextMenuJSON) {}
void WebviewIsTransparent(struct Application* app) {}
void WindowBackgroundIsTranslucent(struct Application* app) {}
void WindowIsTranslucent(struct Application* app) {}
void OpenDialog(struct Application* app, char *callbackID, char *title, char *filters, char *defaultFilename, char *defaultDir, int allowFiles, int allowDirs, int allowMultiple, int showHiddenFiles, int canCreateDirectories, int resolvesAliases, int treatPackagesAsDirectories) {}
void SaveDialog(struct Application* app, char *callbackID, char *title, char *filters, char *defaultFilename, char *defaultDir, int showHiddenFiles, int canCreateDirectories, int treatPackagesAsDirectories) {}
void MessageDialog(struct Application* app, char *callbackID, char *type, char *title, char *message, char *icon, char *button1, char *button2, char *button3, char *button4, char *defaultButton, char *cancelButton) {}

View File

@@ -105,7 +105,7 @@ struct Application *NewApplication(const char *title, int width, int height, int
result->logLevel = logLevel;
result->hideWindowOnClose = hideWindowOnClose;
result->webviewIsTranparent = false;
result->windowBackgroundIsTranslucent = false;
result->WindowIsTranslucent = false;
result->disableWindowIcon = false;
// Min/Max Width/Height
@@ -465,7 +465,7 @@ bool initWebView2(struct Application *app, int debugEnabled, messageCallback cb)
wvColor.G = app->backgroundColour.G;
wvColor.B = app->backgroundColour.B;
wvColor.A = app->backgroundColour.A == 0 ? 0 : 255;
if( app->windowBackgroundIsTranslucent ) {
if( app->WindowIsTranslucent ) {
wvColor.A = 0;
}
HRESULT result = wc2->put_DefaultBackgroundColor(wvColor);
@@ -538,7 +538,7 @@ void Run(struct Application* app, int argc, char **argv) {
// Configure translucency
DWORD dwExStyle = 0;
if ( app->windowBackgroundIsTranslucent) {
if ( app->WindowIsTranslucent) {
dwExStyle = WS_EX_NOREDIRECTIONBITMAP;
wc.hbrBackground = CreateSolidBrush(RGB(255,255,255));
}
@@ -590,7 +590,7 @@ void Run(struct Application* app, int argc, char **argv) {
SetWindowPos(nullptr, nullptr, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
}
if ( app->windowBackgroundIsTranslucent ) {
if ( app->WindowIsTranslucent ) {
// Enable the translucent background effect
enableTranslucentBackground(app);
@@ -877,8 +877,8 @@ void WebviewIsTransparent(struct Application *app) {
app->webviewIsTranparent = true;
}
void WindowBackgroundIsTranslucent(struct Application *app) {
app->windowBackgroundIsTranslucent = true;
void WindowIsTranslucent(struct Application *app) {
app->WindowIsTranslucent = true;
}

View File

@@ -47,8 +47,8 @@ func (a *Application) processPlatformSettings() error {
C.WebviewIsTransparent(a.app)
}
if config.WindowBackgroundIsTranslucent {
C.WindowBackgroundIsTranslucent(a.app)
if config.WindowIsTranslucent {
C.WindowIsTranslucent(a.app)
}
if config.DisableWindowIcon {

View File

@@ -43,7 +43,7 @@ struct Application{
int frame;
char *startupURL;
bool webviewIsTranparent;
bool windowBackgroundIsTranslucent;
bool WindowIsTranslucent;
COREWEBVIEW2_COLOR backgroundColour;
bool disableWindowIcon;