mirror of
https://github.com/taigrr/wails.git
synced 2026-04-06 15:12:40 -07:00
Compare commits
8 Commits
linux-dial
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6d7ec3d50 | ||
|
|
d2a116fe55 | ||
|
|
eb3cf9d130 | ||
|
|
7e2258be7d | ||
|
|
bb5d446001 | ||
|
|
e9aba4795f | ||
|
|
c16bb9715f | ||
|
|
0f09e8d433 |
@@ -74,6 +74,8 @@ const (
|
|||||||
NixOS
|
NixOS
|
||||||
// Artix linux distribution
|
// Artix linux distribution
|
||||||
ArtixLinux
|
ArtixLinux
|
||||||
|
//Uos distribution
|
||||||
|
Uos
|
||||||
)
|
)
|
||||||
|
|
||||||
// DistroInfo contains all the information relating to a linux distribution
|
// DistroInfo contains all the information relating to a linux distribution
|
||||||
@@ -190,6 +192,8 @@ func parseOsRelease(osRelease string) *DistroInfo {
|
|||||||
result.Distribution = NixOS
|
result.Distribution = NixOS
|
||||||
case "artix":
|
case "artix":
|
||||||
result.Distribution = ArtixLinux
|
result.Distribution = ArtixLinux
|
||||||
|
case "uos":
|
||||||
|
result.Distribution = Uos
|
||||||
default:
|
default:
|
||||||
result.Distribution = Unknown
|
result.Distribution = Unknown
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,6 +100,15 @@ distributions:
|
|||||||
gccversioncommand: *gccdumpfullversion
|
gccversioncommand: *gccdumpfullversion
|
||||||
programs: *debiandefaultprograms
|
programs: *debiandefaultprograms
|
||||||
libraries: *debiandefaultlibraries
|
libraries: *debiandefaultlibraries
|
||||||
|
uos:
|
||||||
|
id: uos
|
||||||
|
releases:
|
||||||
|
default:
|
||||||
|
version: default
|
||||||
|
name: Uos
|
||||||
|
gccversioncommand: *gccdumpfullversion
|
||||||
|
programs: *debiandefaultprograms
|
||||||
|
libraries: *debiandefaultlibraries
|
||||||
void:
|
void:
|
||||||
id: void
|
id: void
|
||||||
releases:
|
releases:
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ func CheckDependencies(logger *Logger) (bool, error) {
|
|||||||
distroInfo := GetLinuxDistroInfo()
|
distroInfo := GetLinuxDistroInfo()
|
||||||
|
|
||||||
switch distroInfo.Distribution {
|
switch distroInfo.Distribution {
|
||||||
case Ubuntu, Debian, Zorin, Parrot, Linuxmint, Elementary, Kali, Neon, Deepin, Raspbian, PopOS:
|
case Ubuntu, Debian, Zorin, Parrot, Linuxmint, Elementary, Kali, Neon, Deepin, Raspbian, PopOS, Uos:
|
||||||
libraryChecker = DpkgInstalled
|
libraryChecker = DpkgInstalled
|
||||||
case Arch, ArcoLinux, ArchLabs, Ctlos, Manjaro, ManjaroARM, EndeavourOS, ArtixLinux:
|
case Arch, ArcoLinux, ArchLabs, Ctlos, Manjaro, ManjaroARM, EndeavourOS, ArtixLinux:
|
||||||
libraryChecker = PacmanInstalled
|
libraryChecker = PacmanInstalled
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ extern void processMessage(char*);
|
|||||||
|
|
||||||
static void sendMessageToBackend(WebKitUserContentManager *contentManager,
|
static void sendMessageToBackend(WebKitUserContentManager *contentManager,
|
||||||
WebKitJavascriptResult *result,
|
WebKitJavascriptResult *result,
|
||||||
void*)
|
void* data)
|
||||||
{
|
{
|
||||||
#if WEBKIT_MAJOR_VERSION >= 2 && WEBKIT_MINOR_VERSION >= 22
|
#if WEBKIT_MAJOR_VERSION >= 2 && WEBKIT_MINOR_VERSION >= 22
|
||||||
JSCValue *value = webkit_javascript_result_get_js_value(result);
|
JSCValue *value = webkit_javascript_result_get_js_value(result);
|
||||||
@@ -145,7 +145,7 @@ void connectButtons(void* webview) {
|
|||||||
extern void processURLRequest(WebKitURISchemeRequest *request);
|
extern void processURLRequest(WebKitURISchemeRequest *request);
|
||||||
|
|
||||||
// This is called when the close button on the window is pressed
|
// This is called when the close button on the window is pressed
|
||||||
gboolean close_button_pressed(GtkWidget *widget, GdkEvent *event, void*)
|
gboolean close_button_pressed(GtkWidget *widget, GdkEvent *event, void* data)
|
||||||
{
|
{
|
||||||
processMessage("Q");
|
processMessage("Q");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|||||||
@@ -57,10 +57,10 @@ func NewWindow(parent winc.Controller, appoptions *options.App) *Window {
|
|||||||
result.SetText(appoptions.Title)
|
result.SetText(appoptions.Title)
|
||||||
if appoptions.Frameless == false && !appoptions.Fullscreen {
|
if appoptions.Frameless == false && !appoptions.Fullscreen {
|
||||||
result.EnableMaxButton(!appoptions.DisableResize)
|
result.EnableMaxButton(!appoptions.DisableResize)
|
||||||
result.EnableSizable(!appoptions.DisableResize)
|
|
||||||
result.SetMinSize(appoptions.MinWidth, appoptions.MinHeight)
|
result.SetMinSize(appoptions.MinWidth, appoptions.MinHeight)
|
||||||
result.SetMaxSize(appoptions.MaxWidth, appoptions.MaxHeight)
|
result.SetMaxSize(appoptions.MaxWidth, appoptions.MaxHeight)
|
||||||
}
|
}
|
||||||
|
result.EnableSizable(!appoptions.DisableResize)
|
||||||
|
|
||||||
if appoptions.Windows != nil {
|
if appoptions.Windows != nil {
|
||||||
if appoptions.Windows.WindowIsTranslucent {
|
if appoptions.Windows.WindowIsTranslucent {
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ package runtime
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"github.com/wailsapp/wails/v2/internal/frontend"
|
"github.com/wailsapp/wails/v2/internal/frontend"
|
||||||
|
"github.com/wailsapp/wails/v2/internal/fs"
|
||||||
)
|
)
|
||||||
|
|
||||||
// FileFilter defines a filter for dialog boxes
|
// FileFilter defines a filter for dialog boxes
|
||||||
@@ -29,24 +31,44 @@ type MessageDialogOptions = frontend.MessageDialogOptions
|
|||||||
// OpenDirectoryDialog prompts the user to select a directory
|
// OpenDirectoryDialog prompts the user to select a directory
|
||||||
func OpenDirectoryDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error) {
|
func OpenDirectoryDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error) {
|
||||||
appFrontend := getFrontend(ctx)
|
appFrontend := getFrontend(ctx)
|
||||||
|
if dialogOptions.DefaultDirectory != "" {
|
||||||
|
if !fs.DirExists(dialogOptions.DefaultDirectory) {
|
||||||
|
return "", fmt.Errorf("default directory '%s' does not exist", dialogOptions.DefaultDirectory)
|
||||||
|
}
|
||||||
|
}
|
||||||
return appFrontend.OpenDirectoryDialog(dialogOptions)
|
return appFrontend.OpenDirectoryDialog(dialogOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenFileDialog prompts the user to select a file
|
// OpenFileDialog prompts the user to select a file
|
||||||
func OpenFileDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error) {
|
func OpenFileDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error) {
|
||||||
appFrontend := getFrontend(ctx)
|
appFrontend := getFrontend(ctx)
|
||||||
|
if dialogOptions.DefaultDirectory != "" {
|
||||||
|
if !fs.DirExists(dialogOptions.DefaultDirectory) {
|
||||||
|
return "", fmt.Errorf("default directory '%s' does not exist", dialogOptions.DefaultDirectory)
|
||||||
|
}
|
||||||
|
}
|
||||||
return appFrontend.OpenFileDialog(dialogOptions)
|
return appFrontend.OpenFileDialog(dialogOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// OpenMultipleFilesDialog prompts the user to select a file
|
// OpenMultipleFilesDialog prompts the user to select a file
|
||||||
func OpenMultipleFilesDialog(ctx context.Context, dialogOptions OpenDialogOptions) ([]string, error) {
|
func OpenMultipleFilesDialog(ctx context.Context, dialogOptions OpenDialogOptions) ([]string, error) {
|
||||||
appFrontend := getFrontend(ctx)
|
appFrontend := getFrontend(ctx)
|
||||||
|
if dialogOptions.DefaultDirectory != "" {
|
||||||
|
if !fs.DirExists(dialogOptions.DefaultDirectory) {
|
||||||
|
return nil, fmt.Errorf("default directory '%s' does not exist", dialogOptions.DefaultDirectory)
|
||||||
|
}
|
||||||
|
}
|
||||||
return appFrontend.OpenMultipleFilesDialog(dialogOptions)
|
return appFrontend.OpenMultipleFilesDialog(dialogOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SaveFileDialog prompts the user to select a file
|
// SaveFileDialog prompts the user to select a file
|
||||||
func SaveFileDialog(ctx context.Context, dialogOptions SaveDialogOptions) (string, error) {
|
func SaveFileDialog(ctx context.Context, dialogOptions SaveDialogOptions) (string, error) {
|
||||||
appFrontend := getFrontend(ctx)
|
appFrontend := getFrontend(ctx)
|
||||||
|
if dialogOptions.DefaultDirectory != "" {
|
||||||
|
if !fs.DirExists(dialogOptions.DefaultDirectory) {
|
||||||
|
return "", fmt.Errorf("default directory '%s' does not exist", dialogOptions.DefaultDirectory)
|
||||||
|
}
|
||||||
|
}
|
||||||
return appFrontend.SaveFileDialog(dialogOptions)
|
return appFrontend.SaveFileDialog(dialogOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,3 +27,13 @@ sidebar_position: 1
|
|||||||
## Angular
|
## Angular
|
||||||
|
|
||||||
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - 带有 TypeScript, Sass, 热重载, 代码拆分和 i18n 的 Angular
|
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - 带有 TypeScript, Sass, 热重载, 代码拆分和 i18n 的 Angular
|
||||||
|
|
||||||
|
## React
|
||||||
|
|
||||||
|
- [wails-react-template](https://github.com/AlienRecall/wails-react-template) - 基于 reactjs 的模板
|
||||||
|
- [wails-react-template](https://github.com/flin7/wails-react-template) - 基于 React 并支持实时开发模式的轻量级模板
|
||||||
|
|
||||||
|
## Svelte
|
||||||
|
|
||||||
|
- [wails-svelte-template](https://github.com/raitonoberu/wails-svelte-template) - 基于 Svelte 的模板
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user