Add default appearance

This commit is contained in:
Lea Anthony
2020-09-30 20:03:08 +10:00
parent 4e39566118
commit c1155e255b
4 changed files with 11 additions and 7 deletions

View File

@@ -285,7 +285,7 @@ void* NewApplication(const char *title, int width, int height, int resizable, in
result->fullSizeContent = 0;
result->useToolBar = 0;
result->hideToolbarSeparator = 0;
result->appearance = "NSAppearanceNameAqua";
result->appearance = NULL;
result->titlebarAppearsTransparent = 0;
result->webviewIsTranparent = 0;
@@ -857,9 +857,11 @@ void Run(void *applicationPointer, int argc, char **argv) {
}
// Set Appearance
msg(mainWindow, s("setAppearance:"),
msg(c("NSAppearance"), s("appearanceNamed:"), str(app->appearance))
);
if( app->appearance != NULL ) {
msg(mainWindow, s("setAppearance:"),
msg(c("NSAppearance"), s("appearanceNamed:"), str(app->appearance))
);
}
// Finally call run

View File

@@ -11,7 +11,7 @@ var Default = &App{
RGBA: 0xFFFFFFFF,
Mac: &mac.Options{
TitleBar: mac.TitleBarDefault(),
Appearance: mac.NSAppearanceNameAqua,
Appearance: mac.DefaultAppearance,
WebviewIsTransparent: false,
},
}

View File

@@ -4,6 +4,8 @@ package mac
type AppearanceType string
const (
// DefaultAppearance uses the default system value
DefaultAppearance AppearanceType = ""
// NSAppearanceNameAqua - The standard light system appearance.
NSAppearanceNameAqua AppearanceType = "NSAppearanceNameAqua"
// NSAppearanceNameDarkAqua - The standard dark system appearance.

View File

@@ -26,8 +26,8 @@ func main() {
Mac: &mac.Options{
// TitleBar: mac.TitleBarHidden(),
// TitleBar: mac.TitleBarHiddenInset(),
TitleBar: mac.TitleBarDefault(),
Appearance: mac.NSAppearanceNameDarkAqua,
TitleBar: mac.TitleBarDefault(),
// Appearance: mac.NSAppearanceNameDarkAqua,
},
})