Rename vibrancy to appearance

This commit is contained in:
Lea Anthony
2020-09-30 19:54:41 +10:00
parent 3f3094f0aa
commit 4e39566118
7 changed files with 36 additions and 36 deletions

View File

@@ -120,7 +120,7 @@ struct Application {
int blue;
int alpha;
int webviewIsTranparent;
const char *vibrancy;
const char *appearance;
// Features
int frame;
@@ -174,10 +174,10 @@ void WebviewIsTransparent(struct Application *app) {
app->webviewIsTranparent = 1;
}
// SetVibrancy will set the window's vibrancy to the
// SetAppearance will set the window's Appearance to the
// given value
void SetVibrancy(struct Application *app, const char *vibrancy) {
app->vibrancy = vibrancy;
void SetAppearance(struct Application *app, const char *appearance) {
app->appearance = appearance;
}
@@ -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->vibrancy = "NSAppearanceNameAqua";
result->appearance = "NSAppearanceNameAqua";
result->titlebarAppearsTransparent = 0;
result->webviewIsTranparent = 0;
@@ -856,9 +856,9 @@ void Run(void *applicationPointer, int argc, char **argv) {
msg(wkwebview, s("setValue:forKey:"), msg(c("NSNumber"), s("numberWithBool:"), 1), str("drawsTransparentBackground"));
}
// Set Vibrancy
// Set Appearance
msg(mainWindow, s("setAppearance:"),
msg(c("NSAppearance"), s("appearanceNamed:"), str(app->vibrancy))
msg(c("NSAppearance"), s("appearanceNamed:"), str(app->appearance))
);

View File

@@ -11,7 +11,7 @@ extern void FullSizeContent(void *);
extern void UseToolbar(void *);
extern void HideToolbarSeparator(void *);
extern void DisableFrame(void *);
extern void SetVibrancy(void *, const char *);
extern void SetAppearance(void *, const char *);
extern void WebviewIsTransparent(void *);
*/
import "C"
@@ -54,9 +54,9 @@ func (a *Application) processPlatformSettings() {
C.DisableFrame(a.app)
}
// Process window vibrancy
if mac.Vibrancy != "" {
C.SetVibrancy(a.app, a.string2CString(string(mac.Vibrancy)))
// Process window Appearance
if mac.Appearance != "" {
C.SetAppearance(a.app, a.string2CString(string(mac.Appearance)))
}
// Check if the webview should be transparent

View File

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

View File

@@ -0,0 +1,21 @@
package mac
// AppearanceType is a type of Appearance for Cocoa windows
type AppearanceType string
const (
// NSAppearanceNameAqua - The standard light system appearance.
NSAppearanceNameAqua AppearanceType = "NSAppearanceNameAqua"
// NSAppearanceNameDarkAqua - The standard dark system appearance.
NSAppearanceNameDarkAqua AppearanceType = "NSAppearanceNameDarkAqua"
// NSAppearanceNameVibrantLight - The light vibrant appearance
NSAppearanceNameVibrantLight AppearanceType = "NSAppearanceNameVibrantLight"
// NSAppearanceNameAccessibilityHighContrastAqua - A high-contrast version of the standard light system appearance.
NSAppearanceNameAccessibilityHighContrastAqua AppearanceType = "NSAppearanceNameAccessibilityHighContrastAqua"
// NSAppearanceNameAccessibilityHighContrastDarkAqua - A high-contrast version of the standard dark system appearance.
NSAppearanceNameAccessibilityHighContrastDarkAqua AppearanceType = "NSAppearanceNameAccessibilityHighContrastDarkAqua"
// NSAppearanceNameAccessibilityHighContrastVibrantLight - A high-contrast version of the light vibrant appearance.
NSAppearanceNameAccessibilityHighContrastVibrantLight AppearanceType = "NSAppearanceNameAccessibilityHighContrastVibrantLight"
// NSAppearanceNameAccessibilityHighContrastVibrantDark - A high-contrast version of the dark vibrant appearance.
NSAppearanceNameAccessibilityHighContrastVibrantDark AppearanceType = "NSAppearanceNameAccessibilityHighContrastVibrantDark"
)

View File

@@ -3,6 +3,6 @@ package mac
// Options ae options speific to Mac
type Options struct {
TitleBar *TitleBar
Vibrancy VibrancyType
Appearance AppearanceType
WebviewIsTransparent bool
}

View File

@@ -1,21 +0,0 @@
package mac
// VibrancyType is a type of vibrancy for Cocoa windows
type VibrancyType string
const (
// NSAppearanceNameAqua - The standard light system appearance.
NSAppearanceNameAqua VibrancyType = "NSAppearanceNameAqua"
// NSAppearanceNameDarkAqua - The standard dark system appearance.
NSAppearanceNameDarkAqua VibrancyType = "NSAppearanceNameDarkAqua"
// NSAppearanceNameVibrantLight - The light vibrant appearance
NSAppearanceNameVibrantLight VibrancyType = "NSAppearanceNameVibrantLight"
// NSAppearanceNameAccessibilityHighContrastAqua - A high-contrast version of the standard light system appearance.
NSAppearanceNameAccessibilityHighContrastAqua VibrancyType = "NSAppearanceNameAccessibilityHighContrastAqua"
// NSAppearanceNameAccessibilityHighContrastDarkAqua - A high-contrast version of the standard dark system appearance.
NSAppearanceNameAccessibilityHighContrastDarkAqua VibrancyType = "NSAppearanceNameAccessibilityHighContrastDarkAqua"
// NSAppearanceNameAccessibilityHighContrastVibrantLight - A high-contrast version of the light vibrant appearance.
NSAppearanceNameAccessibilityHighContrastVibrantLight VibrancyType = "NSAppearanceNameAccessibilityHighContrastVibrantLight"
// NSAppearanceNameAccessibilityHighContrastVibrantDark - A high-contrast version of the dark vibrant appearance.
NSAppearanceNameAccessibilityHighContrastVibrantDark VibrancyType = "NSAppearanceNameAccessibilityHighContrastVibrantDark"
)

View File

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