mirror of
https://github.com/taigrr/wails.git
synced 2026-04-02 05:08:54 -07:00
Add HideTitleBar
This commit is contained in:
@@ -4,4 +4,5 @@ package appoptions
|
||||
type MacOptions struct {
|
||||
TitlebarAppearsTransparent bool
|
||||
HideTitle bool
|
||||
HideTitleBar bool
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ struct Application {
|
||||
int minimised;
|
||||
int titlebarAppearsTransparent;
|
||||
int hideTitle;
|
||||
int hideTitleBar;
|
||||
|
||||
// User Data
|
||||
char *HTML;
|
||||
@@ -139,6 +140,10 @@ void HideTitle(struct Application *app) {
|
||||
app->hideTitle = 1;
|
||||
}
|
||||
|
||||
void HideTitleBar(struct Application *app) {
|
||||
app->hideTitleBar = 1;
|
||||
}
|
||||
|
||||
void Hide(struct Application *app) {
|
||||
ON_MAIN_THREAD(
|
||||
msg(app->application, s("hide:"))
|
||||
@@ -198,6 +203,7 @@ void* NewApplication(const char *title, int width, int height, int resizable, in
|
||||
// Features
|
||||
result->frame = 1;
|
||||
result->hideTitle = 0;
|
||||
result->hideTitleBar = 0;
|
||||
|
||||
result->titlebarAppearsTransparent = 0;
|
||||
printf("[l] setTitlebarAppearsTransparent %d\n", result->titlebarAppearsTransparent);
|
||||
@@ -651,10 +657,13 @@ void disableBoolConfig(id config, const char *setting) {
|
||||
void Run(void *applicationPointer, int argc, char **argv) {
|
||||
struct Application *app = (struct Application*) applicationPointer;
|
||||
|
||||
int decorations;
|
||||
int decorations = 0;
|
||||
|
||||
if (app->frame == 1 ) {
|
||||
decorations = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable;
|
||||
if( app->hideTitleBar == 0) {
|
||||
decorations |= NSWindowStyleMaskTitled;
|
||||
}
|
||||
decorations |= NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable;
|
||||
}
|
||||
|
||||
if (app->resizable) {
|
||||
|
||||
@@ -6,6 +6,7 @@ package ffenestri
|
||||
|
||||
extern void TitlebarAppearsTransparent(void *);
|
||||
extern void HideTitle(void *);
|
||||
extern void HideTitleBar(void *);
|
||||
*/
|
||||
import "C"
|
||||
|
||||
@@ -16,6 +17,11 @@ func (a *Application) processPlatformSettings() {
|
||||
C.HideTitle(a.app)
|
||||
}
|
||||
|
||||
// HideTitleBar
|
||||
if a.config.Mac.HideTitleBar {
|
||||
C.HideTitleBar(a.app)
|
||||
}
|
||||
|
||||
// if a.config.Mac.TitlebarAppearsTransparent {
|
||||
// C.TitlebarAppearsTransparent(a.app)
|
||||
// }
|
||||
|
||||
@@ -21,7 +21,8 @@ func main() {
|
||||
DisableResize: false,
|
||||
Fullscreen: false,
|
||||
Mac: wails.MacOptions{
|
||||
HideTitle: true,
|
||||
HideTitle: true,
|
||||
HideTitleBar: true,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user