mirror of
https://github.com/taigrr/wails.git
synced 2026-04-02 05:08:54 -07:00
Add default appearance
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -11,7 +11,7 @@ var Default = &App{
|
||||
RGBA: 0xFFFFFFFF,
|
||||
Mac: &mac.Options{
|
||||
TitleBar: mac.TitleBarDefault(),
|
||||
Appearance: mac.NSAppearanceNameAqua,
|
||||
Appearance: mac.DefaultAppearance,
|
||||
WebviewIsTransparent: false,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user