mirror of
https://github.com/taigrr/wails.git
synced 2026-04-17 04:05:12 -07:00
Compare commits
12 Commits
v2.0.0-alp
...
v2.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ce3e1d1bf | ||
|
|
e5f2746810 | ||
|
|
92ebf506dd | ||
|
|
9ab06152c5 | ||
|
|
bf36b6a59d | ||
|
|
4b9f6c4fb1 | ||
|
|
b1a42c8dea | ||
|
|
cbd98b5a1a | ||
|
|
c8e0aea69c | ||
|
|
7c0b236eb0 | ||
|
|
16debbd109 | ||
|
|
39bfa5d910 |
@@ -40,4 +40,5 @@ Wails is what it is because of the time and effort given by these great people.
|
|||||||
* [Balakrishna Prasad Ganne](https://github.com/aayush420)
|
* [Balakrishna Prasad Ganne](https://github.com/aayush420)
|
||||||
* [Charaf Rezrazi](https://github.com/Rezrazi)
|
* [Charaf Rezrazi](https://github.com/Rezrazi)
|
||||||
* [misitebao](https://github.com/misitebao)
|
* [misitebao](https://github.com/misitebao)
|
||||||
* [Elie Grenon](https://github.com/DrunkenPoney)
|
* [Elie Grenon](https://github.com/DrunkenPoney)
|
||||||
|
* [Amaury Tobias Quiroz](https://github.com/amaury-tobias)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
echo "**** Checking if Wails passes unit tests ****"
|
echo "**** Checking if Wails passes unit tests ****"
|
||||||
if ! go test ./...
|
if ! go test ./lib/... ./runtime/... ./cmd/...
|
||||||
then
|
then
|
||||||
echo ""
|
echo ""
|
||||||
echo "ERROR: Unit tests failed!"
|
echo "ERROR: Unit tests failed!"
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
var version = "v2.0.0-alpha.52"
|
var version = "v2.0.0-alpha.55"
|
||||||
|
|||||||
@@ -5,10 +5,6 @@
|
|||||||
#ifndef COMMON_H
|
#ifndef COMMON_H
|
||||||
#define COMMON_H
|
#define COMMON_H
|
||||||
|
|
||||||
#define OBJC_OLD_DISPATCH_PROTOTYPES 1
|
|
||||||
#include <objc/objc-runtime.h>
|
|
||||||
#include <CoreGraphics/CoreGraphics.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ void Hide(struct Application *app) {
|
|||||||
if( app->shuttingDown ) return;
|
if( app->shuttingDown ) return;
|
||||||
|
|
||||||
ON_MAIN_THREAD(
|
ON_MAIN_THREAD(
|
||||||
msg(app->application, s("hide:"));
|
msg(app->mainWindow, s("orderOut:"));
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1237,12 +1237,12 @@ void createDelegate(struct Application *app) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool windowShouldClose(id self, SEL cmd, id sender) {
|
bool windowShouldClose(id self, SEL cmd, id sender) {
|
||||||
msg(sender, s("orderBack:"));
|
msg(sender, s("orderOut:"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool windowShouldExit(id self, SEL cmd, id sender) {
|
bool windowShouldExit(id self, SEL cmd, id sender) {
|
||||||
msg(sender, s("orderBack:"));
|
msg(sender, s("orderOut:"));
|
||||||
messageFromWindowCallback("WC");
|
messageFromWindowCallback("WC");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
78
v2/internal/ffenestri/ffenestri_windows.c
Normal file
78
v2/internal/ffenestri/ffenestri_windows.c
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
|
||||||
|
typedef struct {
|
||||||
|
} Application;
|
||||||
|
|
||||||
|
struct Application *NewApplication(const char *title, int width, int height, int resizable, int devtools, int fullscreen, int startHidden, int logLevel, int hideWindowOnClose) {
|
||||||
|
}
|
||||||
|
void SetMinWindowSize(struct Application* app, int minWidth, int minHeight) {
|
||||||
|
}
|
||||||
|
void SetMaxWindowSize(struct Application* app, int maxWidth, int maxHeight) {
|
||||||
|
}
|
||||||
|
void Run(struct Application* app, int argc, char **argv) {
|
||||||
|
}
|
||||||
|
void DestroyApplication(struct Application* app) {
|
||||||
|
}
|
||||||
|
void SetDebug(struct Application* app, int flag) {
|
||||||
|
}
|
||||||
|
void SetBindings(struct Application* app, const char *bindings) {
|
||||||
|
}
|
||||||
|
void ExecJS(struct Application* app, const char *script) {
|
||||||
|
}
|
||||||
|
void Hide(struct Application* app) {
|
||||||
|
}
|
||||||
|
void Show(struct Application* app) {
|
||||||
|
}
|
||||||
|
void Center(struct Application* app) {
|
||||||
|
}
|
||||||
|
void Maximise(struct Application* app) {
|
||||||
|
}
|
||||||
|
void Unmaximise(struct Application* app) {
|
||||||
|
}
|
||||||
|
void ToggleMaximise(struct Application* app) {
|
||||||
|
}
|
||||||
|
void Minimise(struct Application* app) {
|
||||||
|
}
|
||||||
|
void Unminimise(struct Application* app) {
|
||||||
|
}
|
||||||
|
void ToggleMinimise(struct Application* app) {
|
||||||
|
}
|
||||||
|
void SetColour(struct Application* app, int red, int green, int blue, int alpha) {
|
||||||
|
}
|
||||||
|
void SetSize(struct Application* app, int width, int height) {
|
||||||
|
}
|
||||||
|
void SetPosition(struct Application* app, int x, int y) {
|
||||||
|
}
|
||||||
|
void Quit(struct Application* app) {
|
||||||
|
}
|
||||||
|
void SetTitle(struct Application* app, const char *title) {
|
||||||
|
}
|
||||||
|
void Fullscreen(struct Application* app) {
|
||||||
|
}
|
||||||
|
void UnFullscreen(struct Application* app) {
|
||||||
|
}
|
||||||
|
void ToggleFullscreen(struct Application* app) {
|
||||||
|
}
|
||||||
|
void DisableFrame(struct Application* app) {
|
||||||
|
}
|
||||||
|
void OpenDialog(struct Application* app, char *callbackID, char *title, char *filters, char *defaultFilename, char *defaultDir, int allowFiles, int allowDirs, int allowMultiple, int showHiddenFiles, int canCreateDirectories, int resolvesAliases, int treatPackagesAsDirectories) {
|
||||||
|
}
|
||||||
|
void SaveDialog(struct Application* app, char *callbackID, char *title, char *filters, char *defaultFilename, char *defaultDir, int showHiddenFiles, int canCreateDirectories, int treatPackagesAsDirectories) {
|
||||||
|
}
|
||||||
|
void MessageDialog(struct Application* app, char *callbackID, char *type, char *title, char *message, char *icon, char *button1, char *button2, char *button3, char *button4, char *defaultButton, char *cancelButton) {
|
||||||
|
}
|
||||||
|
void DarkModeEnabled(struct Application* app, char *callbackID) {
|
||||||
|
}
|
||||||
|
void SetApplicationMenu(struct Application* app, const char *applicationMenuJSON) {
|
||||||
|
}
|
||||||
|
void AddTrayMenu(struct Application* app, const char *menuTrayJSON) {
|
||||||
|
}
|
||||||
|
void SetTrayMenu(struct Application* app, const char *menuTrayJSON) {
|
||||||
|
}
|
||||||
|
void DeleteTrayMenuByID(struct Application* app, const char *id) {
|
||||||
|
}
|
||||||
|
void UpdateTrayMenuLabel(struct Application* app, const char* JSON) {
|
||||||
|
}
|
||||||
|
void AddContextMenu(struct Application* app, char *contextMenuJSON) {
|
||||||
|
}
|
||||||
|
void UpdateContextMenu(struct Application* app, char *contextMenuJSON) {
|
||||||
|
}
|
||||||
14
v2/internal/ffenestri/ffenestri_windows.go
Normal file
14
v2/internal/ffenestri/ffenestri_windows.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package ffenestri
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
#include "ffenestri.h"
|
||||||
|
#include "ffenestri_windows.h"
|
||||||
|
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
func (a *Application) processPlatformSettings() error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
5
v2/internal/ffenestri/ffenestri_windows.h
Normal file
5
v2/internal/ffenestri/ffenestri_windows.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
#ifndef _FFENESTRI_WINDOWS_
|
||||||
|
#define _FFENESTRI_WINDOWS_
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -587,11 +587,8 @@ id createAttributedString(const char* title, const char* fontName, int fontSize,
|
|||||||
|
|
||||||
// Check if valid
|
// Check if valid
|
||||||
id fontNameAsNSString = str(fontName);
|
id fontNameAsNSString = str(fontName);
|
||||||
id fontsOnSystem = msg(msg(c("NSFontManager"), s("sharedFontManager")), s("availableFonts"));
|
font = msg(c("NSFont"), s("fontWithName:size:"), fontNameAsNSString, fontSizeFloat);
|
||||||
bool valid = msg(fontsOnSystem, s("containsObject:"), fontNameAsNSString);
|
if( font == NULL ) {
|
||||||
if( valid ) {
|
|
||||||
font = msg(c("NSFont"), s("fontWithName:size:"), fontNameAsNSString, fontSizeFloat);
|
|
||||||
} else {
|
|
||||||
bool supportsMonospacedDigitSystemFont = (bool) msg(c("NSFont"), s("respondsToSelector:"), s("monospacedDigitSystemFontOfSize:weight:"));
|
bool supportsMonospacedDigitSystemFont = (bool) msg(c("NSFont"), s("respondsToSelector:"), s("monospacedDigitSystemFontOfSize:weight:"));
|
||||||
if( supportsMonospacedDigitSystemFont ) {
|
if( supportsMonospacedDigitSystemFont ) {
|
||||||
font = msg(c("NSFont"), s("monospacedDigitSystemFontOfSize:weight:"), fontSizeFloat, NSFontWeightRegular);
|
font = msg(c("NSFont"), s("monospacedDigitSystemFontOfSize:weight:"), fontSizeFloat, NSFontWeightRegular);
|
||||||
@@ -603,7 +600,6 @@ id createAttributedString(const char* title, const char* fontName, int fontSize,
|
|||||||
// Add font to dictionary
|
// Add font to dictionary
|
||||||
msg(dictionary, s("setObject:forKey:"), font, lookupStringConstant(str("NSFontAttributeName")));
|
msg(dictionary, s("setObject:forKey:"), font, lookupStringConstant(str("NSFontAttributeName")));
|
||||||
|
|
||||||
// Add offset to dictionary
|
|
||||||
id offset = msg(c("NSNumber"), s("numberWithFloat:"), 0.0);
|
id offset = msg(c("NSNumber"), s("numberWithFloat:"), 0.0);
|
||||||
msg(dictionary, s("setObject:forKey:"), offset, lookupStringConstant(str("NSBaselineOffsetAttributeName")));
|
msg(dictionary, s("setObject:forKey:"), offset, lookupStringConstant(str("NSBaselineOffsetAttributeName")));
|
||||||
|
|
||||||
@@ -767,7 +763,7 @@ void processMenuItem(Menu *menu, id parentMenu, JsonNode *item) {
|
|||||||
bool templateImage = false;
|
bool templateImage = false;
|
||||||
getJSONBool(item, "MacTemplateImage", &templateImage);
|
getJSONBool(item, "MacTemplateImage", &templateImage);
|
||||||
|
|
||||||
int fontSize = 13;
|
int fontSize = 0;
|
||||||
getJSONInt(item, "FontSize", &fontSize);
|
getJSONInt(item, "FontSize", &fontSize);
|
||||||
|
|
||||||
// If we have an accelerator
|
// If we have an accelerator
|
||||||
|
|||||||
@@ -35,8 +35,12 @@ TrayMenu* NewTrayMenu(const char* menuJSON) {
|
|||||||
result->fontName = getJSONString(processedJSON, "FontName");
|
result->fontName = getJSONString(processedJSON, "FontName");
|
||||||
result->RGBA = getJSONString(processedJSON, "RGBA");
|
result->RGBA = getJSONString(processedJSON, "RGBA");
|
||||||
getJSONBool(processedJSON, "MacTemplateImage", &result->templateImage);
|
getJSONBool(processedJSON, "MacTemplateImage", &result->templateImage);
|
||||||
result->fontSize = 13;
|
result->fontSize = 0;
|
||||||
getJSONInt(processedJSON, "FontSize", &result->fontSize);
|
getJSONInt(processedJSON, "FontSize", &result->fontSize);
|
||||||
|
result->tooltip = NULL;
|
||||||
|
result->tooltip = getJSONString(processedJSON, "Tooltip");
|
||||||
|
result->disabled = false;
|
||||||
|
getJSONBool(processedJSON, "Disabled", &result->disabled);
|
||||||
|
|
||||||
// Create the menu
|
// Create the menu
|
||||||
JsonNode* processedMenu = mustJSONObject(processedJSON, "ProcessedMenu");
|
JsonNode* processedMenu = mustJSONObject(processedJSON, "ProcessedMenu");
|
||||||
@@ -59,7 +63,7 @@ void DumpTrayMenu(TrayMenu* trayMenu) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UpdateTrayLabel(TrayMenu *trayMenu, const char *label, const char *fontName, int fontSize, const char *RGBA) {
|
void UpdateTrayLabel(TrayMenu *trayMenu, const char *label, const char *fontName, int fontSize, const char *RGBA, const char *tooltip, bool disabled) {
|
||||||
|
|
||||||
// Exit early if NULL
|
// Exit early if NULL
|
||||||
if( trayMenu->label == NULL ) {
|
if( trayMenu->label == NULL ) {
|
||||||
@@ -68,6 +72,13 @@ void UpdateTrayLabel(TrayMenu *trayMenu, const char *label, const char *fontName
|
|||||||
// Update button label
|
// Update button label
|
||||||
id statusBarButton = msg(trayMenu->statusbaritem, s("button"));
|
id statusBarButton = msg(trayMenu->statusbaritem, s("button"));
|
||||||
id attributedString = createAttributedString(label, fontName, fontSize, RGBA);
|
id attributedString = createAttributedString(label, fontName, fontSize, RGBA);
|
||||||
|
|
||||||
|
if( tooltip != NULL ) {
|
||||||
|
msg(statusBarButton, s("setToolTip:"), str(tooltip));
|
||||||
|
}
|
||||||
|
|
||||||
|
msg(statusBarButton, s("setEnabled:"), !disabled);
|
||||||
|
|
||||||
msg(statusBarButton, s("setAttributedTitle:"), attributedString);
|
msg(statusBarButton, s("setAttributedTitle:"), attributedString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +133,7 @@ void ShowTrayMenu(TrayMenu* trayMenu) {
|
|||||||
UpdateTrayIcon(trayMenu);
|
UpdateTrayIcon(trayMenu);
|
||||||
|
|
||||||
// Update the label if needed
|
// Update the label if needed
|
||||||
UpdateTrayLabel(trayMenu, trayMenu->label, trayMenu->fontName, trayMenu->fontSize, trayMenu->RGBA);
|
UpdateTrayLabel(trayMenu, trayMenu->label, trayMenu->fontName, trayMenu->fontSize, trayMenu->RGBA, trayMenu->tooltip, trayMenu->disabled);
|
||||||
|
|
||||||
// Update the menu
|
// Update the menu
|
||||||
id menu = GetMenu(trayMenu->menu);
|
id menu = GetMenu(trayMenu->menu);
|
||||||
|
|||||||
@@ -13,12 +13,15 @@ typedef struct {
|
|||||||
const char *label;
|
const char *label;
|
||||||
const char *icon;
|
const char *icon;
|
||||||
const char *ID;
|
const char *ID;
|
||||||
|
const char *tooltip;
|
||||||
|
|
||||||
bool templateImage;
|
bool templateImage;
|
||||||
const char *fontName;
|
const char *fontName;
|
||||||
int fontSize;
|
int fontSize;
|
||||||
const char *RGBA;
|
const char *RGBA;
|
||||||
|
|
||||||
|
bool disabled;
|
||||||
|
|
||||||
Menu* menu;
|
Menu* menu;
|
||||||
|
|
||||||
id statusbaritem;
|
id statusbaritem;
|
||||||
@@ -35,7 +38,7 @@ void DumpTrayMenu(TrayMenu* trayMenu);
|
|||||||
void ShowTrayMenu(TrayMenu* trayMenu);
|
void ShowTrayMenu(TrayMenu* trayMenu);
|
||||||
void UpdateTrayMenuInPlace(TrayMenu* currentMenu, TrayMenu* newMenu);
|
void UpdateTrayMenuInPlace(TrayMenu* currentMenu, TrayMenu* newMenu);
|
||||||
void UpdateTrayIcon(TrayMenu *trayMenu);
|
void UpdateTrayIcon(TrayMenu *trayMenu);
|
||||||
void UpdateTrayLabel(TrayMenu *trayMenu, const char *label, const char *fontName, int fontSize, const char *RGBA);
|
void UpdateTrayLabel(TrayMenu *trayMenu, const char *label, const char *fontName, int fontSize, const char *RGBA, const char *tooltip, bool disabled);
|
||||||
|
|
||||||
void LoadTrayIcons();
|
void LoadTrayIcons();
|
||||||
void UnloadTrayIcons();
|
void UnloadTrayIcons();
|
||||||
|
|||||||
@@ -121,10 +121,14 @@ void UpdateTrayMenuLabelInStore(TrayMenuStore* store, const char* JSON) {
|
|||||||
|
|
||||||
const char *fontName = getJSONString(parsedUpdate, "FontName");
|
const char *fontName = getJSONString(parsedUpdate, "FontName");
|
||||||
const char *RGBA = getJSONString(parsedUpdate, "RGBA");
|
const char *RGBA = getJSONString(parsedUpdate, "RGBA");
|
||||||
int fontSize = 13;
|
int fontSize = 0;
|
||||||
getJSONInt(parsedUpdate, "FontSize", &fontSize);
|
getJSONInt(parsedUpdate, "FontSize", &fontSize);
|
||||||
|
const char *tooltip = getJSONString(parsedUpdate, "Tooltip");
|
||||||
|
bool disabled = false;
|
||||||
|
getJSONBool(parsedUpdate, "Disabled", &disabled);
|
||||||
|
|
||||||
|
UpdateTrayLabel(menu, Label, fontName, fontSize, RGBA, tooltip, disabled);
|
||||||
|
|
||||||
UpdateTrayLabel(menu, Label, fontName, fontSize, RGBA);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,9 @@ func (a *AssetBundle) processHTML(htmldata string) error {
|
|||||||
if attr.Key == "as" && attr.Val == "script" {
|
if attr.Key == "as" && attr.Val == "script" {
|
||||||
asset.Type = AssetTypes.JS
|
asset.Type = AssetTypes.JS
|
||||||
}
|
}
|
||||||
|
if attr.Key == "rel" && attr.Val == "modulepreload" {
|
||||||
|
asset.Type = AssetTypes.JS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure we don't include duplicates
|
// Ensure we don't include duplicates
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ type TrayMenu struct {
|
|||||||
Label string
|
Label string
|
||||||
FontSize int
|
FontSize int
|
||||||
FontName string
|
FontName string
|
||||||
|
Disabled bool
|
||||||
|
Tooltip string `json:",omitempty"`
|
||||||
Image string
|
Image string
|
||||||
MacTemplateImage bool
|
MacTemplateImage bool
|
||||||
RGBA string
|
RGBA string
|
||||||
@@ -50,6 +52,8 @@ func NewTrayMenu(trayMenu *menu.TrayMenu) *TrayMenu {
|
|||||||
Label: trayMenu.Label,
|
Label: trayMenu.Label,
|
||||||
FontName: trayMenu.FontName,
|
FontName: trayMenu.FontName,
|
||||||
FontSize: trayMenu.FontSize,
|
FontSize: trayMenu.FontSize,
|
||||||
|
Disabled: trayMenu.Disabled,
|
||||||
|
Tooltip: trayMenu.Tooltip,
|
||||||
Image: trayMenu.Image,
|
Image: trayMenu.Image,
|
||||||
MacTemplateImage: trayMenu.MacTemplateImage,
|
MacTemplateImage: trayMenu.MacTemplateImage,
|
||||||
menu: trayMenu.Menu,
|
menu: trayMenu.Menu,
|
||||||
@@ -145,13 +149,27 @@ func (m *Manager) UpdateTrayMenuLabel(trayMenu *menu.TrayMenu) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type LabelUpdate struct {
|
type LabelUpdate struct {
|
||||||
ID string
|
ID string
|
||||||
Label string
|
Label string
|
||||||
|
FontName string
|
||||||
|
FontSize int
|
||||||
|
RGBA string
|
||||||
|
Disabled bool
|
||||||
|
Tooltip string
|
||||||
|
Image string
|
||||||
|
MacTemplateImage bool
|
||||||
}
|
}
|
||||||
|
|
||||||
update := &LabelUpdate{
|
update := &LabelUpdate{
|
||||||
ID: trayID,
|
ID: trayID,
|
||||||
Label: trayMenu.Label,
|
Label: trayMenu.Label,
|
||||||
|
FontName: trayMenu.FontName,
|
||||||
|
FontSize: trayMenu.FontSize,
|
||||||
|
Disabled: trayMenu.Disabled,
|
||||||
|
Tooltip: trayMenu.Tooltip,
|
||||||
|
Image: trayMenu.Image,
|
||||||
|
MacTemplateImage: trayMenu.MacTemplateImage,
|
||||||
|
RGBA: trayMenu.RGBA,
|
||||||
}
|
}
|
||||||
|
|
||||||
data, err := json.Marshal(update)
|
data, err := json.Marshal(update)
|
||||||
|
|||||||
@@ -17,13 +17,14 @@ func platformInfo() (*OS, error) {
|
|||||||
// Ignore errors as it isn't a showstopper
|
// Ignore errors as it isn't a showstopper
|
||||||
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
|
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
|
||||||
|
|
||||||
defer key.Close()
|
|
||||||
|
|
||||||
fmt.Printf("%+v\n", key)
|
|
||||||
|
|
||||||
// Ignore errors as it isn't a showstopper
|
|
||||||
productName, _, _ := key.GetStringValue("ProductName")
|
productName, _, _ := key.GetStringValue("ProductName")
|
||||||
fmt.Println(productName)
|
currentBuild, _, _ := key.GetStringValue("CurrentBuildNumber")
|
||||||
|
displayVersion, _, _ := key.GetStringValue("DisplayVersion")
|
||||||
|
releaseId, _, _ := key.GetStringValue("ReleaseId")
|
||||||
|
|
||||||
return nil, nil
|
result.Name = productName
|
||||||
|
result.Version = fmt.Sprintf("%s (Build: %s)", releaseId, currentBuild)
|
||||||
|
result.ID = displayVersion
|
||||||
|
|
||||||
|
return &result, key.Close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,5 @@ func (i *Info) discover() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
i.OS = osinfo
|
i.OS = osinfo
|
||||||
|
|
||||||
// dll := syscall.MustLoadDLL("kernel32.dll")
|
|
||||||
// p := dll.MustFindProc("GetVersion")
|
|
||||||
// v, _, _ := p.Call()
|
|
||||||
// fmt.Printf("Windows version %d.%d (Build %d)\n", byte(v), uint8(v>>8), uint16(v>>16))
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ func Build(options *Options) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check platform
|
// Check platform
|
||||||
validPlatforms := slicer.String([]string{"linux", "darwin"})
|
validPlatforms := slicer.String([]string{"linux", "darwin", "windows"})
|
||||||
if !validPlatforms.Contains(options.Platform) {
|
if !validPlatforms.Contains(options.Platform) {
|
||||||
return "", fmt.Errorf("platform %s not supported", options.Platform)
|
return "", fmt.Errorf("platform %s is not supported", options.Platform)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load project
|
// Load project
|
||||||
|
|||||||
@@ -23,6 +23,15 @@ type TrayMenu struct {
|
|||||||
FontSize int
|
FontSize int
|
||||||
FontName string
|
FontName string
|
||||||
|
|
||||||
|
// Tooltip
|
||||||
|
Tooltip string
|
||||||
|
|
||||||
|
// Callback function when menu clicked
|
||||||
|
//Click Callback `json:"-"`
|
||||||
|
|
||||||
|
// Disabled makes the item unselectable
|
||||||
|
Disabled bool
|
||||||
|
|
||||||
// Menu is the initial menu we wish to use for the tray
|
// Menu is the initial menu we wish to use for the tray
|
||||||
Menu *Menu
|
Menu *Menu
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user