mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
Support more mac window options
This commit is contained in:
parent
4bf59301e5
commit
65d591e2a6
4 changed files with 23 additions and 7 deletions
|
|
@ -5,4 +5,5 @@ type MacOptions struct {
|
|||
TitlebarAppearsTransparent bool
|
||||
HideTitle bool
|
||||
HideTitleBar bool
|
||||
FullSizeContent bool
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ struct Application {
|
|||
int titlebarAppearsTransparent;
|
||||
int hideTitle;
|
||||
int hideTitleBar;
|
||||
int fullSizeContent;
|
||||
|
||||
// User Data
|
||||
char *HTML;
|
||||
|
|
@ -144,6 +145,10 @@ void HideTitleBar(struct Application *app) {
|
|||
app->hideTitleBar = 1;
|
||||
}
|
||||
|
||||
void FullSizeContent(struct Application *app) {
|
||||
app->fullSizeContent = 1;
|
||||
}
|
||||
|
||||
void Hide(struct Application *app) {
|
||||
ON_MAIN_THREAD(
|
||||
msg(app->application, s("hide:"))
|
||||
|
|
@ -204,6 +209,7 @@ void* NewApplication(const char *title, int width, int height, int resizable, in
|
|||
result->frame = 1;
|
||||
result->hideTitle = 0;
|
||||
result->hideTitleBar = 0;
|
||||
result->fullSizeContent = 0;
|
||||
|
||||
result->titlebarAppearsTransparent = 0;
|
||||
printf("[l] setTitlebarAppearsTransparent %d\n", result->titlebarAppearsTransparent);
|
||||
|
|
@ -674,7 +680,8 @@ void Run(void *applicationPointer, int argc, char **argv) {
|
|||
decorations |= NSWindowStyleMaskFullscreen;
|
||||
}
|
||||
|
||||
if( app->frame == 0) {
|
||||
if( app->fullSizeContent || app->frame == 0) {
|
||||
Debug("FULLSIZECONTENTT!!!!!!");
|
||||
decorations |= NSWindowStyleMaskFullSizeContentView;
|
||||
}
|
||||
|
||||
|
|
@ -748,7 +755,7 @@ void Run(void *applicationPointer, int argc, char **argv) {
|
|||
// [[window standardWindowButton:NSWindowCloseButton] setHidden:YES];
|
||||
} else {
|
||||
Debug("setTitlebarAppearsTransparent %d", app->titlebarAppearsTransparent ? YES :NO);
|
||||
// msg(mainWindow, s("setTitlebarAppearsTransparent:"), app->titlebarAppearsTransparent ? YES : NO);
|
||||
msg(mainWindow, s("setTitlebarAppearsTransparent:"), app->titlebarAppearsTransparent ? YES : NO);
|
||||
msg(app->mainWindow, s("setTitleVisibility:"), app->hideTitle);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ package ffenestri
|
|||
extern void TitlebarAppearsTransparent(void *);
|
||||
extern void HideTitle(void *);
|
||||
extern void HideTitleBar(void *);
|
||||
extern void FullSizeContent(void *);
|
||||
*/
|
||||
import "C"
|
||||
|
||||
|
|
@ -22,7 +23,12 @@ func (a *Application) processPlatformSettings() {
|
|||
C.HideTitleBar(a.app)
|
||||
}
|
||||
|
||||
// if a.config.Mac.TitlebarAppearsTransparent {
|
||||
// C.TitlebarAppearsTransparent(a.app)
|
||||
// }
|
||||
// Full Size Content
|
||||
if a.config.Mac.FullSizeContent {
|
||||
C.FullSizeContent(a.app)
|
||||
}
|
||||
|
||||
if a.config.Mac.TitlebarAppearsTransparent {
|
||||
C.TitlebarAppearsTransparent(a.app)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,8 +21,10 @@ func main() {
|
|||
DisableResize: false,
|
||||
Fullscreen: false,
|
||||
Mac: wails.MacOptions{
|
||||
HideTitle: true,
|
||||
HideTitleBar: true,
|
||||
HideTitle: true,
|
||||
HideTitleBar: false,
|
||||
TitlebarAppearsTransparent: true,
|
||||
FullSizeContent: true,
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue