ZacharyZhang-NY 21249605fb Refactor: share iconAction for borderless 16 DIP icon buttons
datetimeIconButton moves to icon_button.go as iconAction(c, icon, label)
and replaces the identical copies in Dialog close, PasswordInput toggle
and AppShell collapse. Hover and press now set Text on every caller,
including the date and time pickers, which kept TextMuted on hover.
Image retry (bordered, danger ink), TagsInput remove (14 DIP icon, no
press state) and Tag close (12 DIP icon, fade) are different buttons
and stay as they are.
2026-10-05 13:37:34 -04:00
2026-10-05 12:27:55 -04:00
2026-10-05 12:59:33 -04:00
2026-10-05 13:17:47 -04:00
2026-10-05 12:11:45 -04:00
2026-10-05 12:42:50 -04:00
2026-10-05 12:59:52 -04:00
2026-10-05 12:59:52 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:18:12 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:17:01 -04:00
2026-10-05 13:02:39 -04:00
2026-10-05 12:27:55 -04:00
2026-10-05 12:45:45 -04:00
2026-10-05 13:31:15 -04:00
2026-10-05 12:17:01 -04:00
2026-10-05 13:31:15 -04:00
2026-10-05 13:11:39 -04:00
2026-10-05 12:45:45 -04:00
2026-10-05 13:02:54 -04:00
2026-10-05 13:02:54 -04:00
2026-10-05 13:31:15 -04:00
2026-10-05 12:18:49 -04:00
2026-10-05 12:18:49 -04:00
2026-10-05 12:59:33 -04:00
2026-10-05 12:45:45 -04:00
2026-10-05 12:59:33 -04:00
2026-10-05 12:32:10 -04:00
2026-10-05 12:32:10 -04:00
2026-10-05 12:25:27 -04:00
2026-10-05 13:17:47 -04:00
2026-10-05 12:59:33 -04:00
2026-10-05 12:11:45 -04:00
2026-10-05 12:42:50 -04:00
2026-10-05 12:19:28 -04:00
2026-10-05 12:37:56 -04:00
2026-10-05 12:24:13 -04:00
2026-10-05 12:37:56 -04:00
2026-10-05 12:37:56 -04:00
2026-10-05 12:37:56 -04:00
2026-10-05 13:02:54 -04:00
2026-10-05 13:02:54 -04:00
2026-10-05 12:18:49 -04:00
2026-10-05 12:18:49 -04:00
2026-10-05 12:18:12 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:59:33 -04:00
2026-10-05 12:17:01 -04:00
2026-10-05 12:18:12 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:59:42 -04:00
2026-10-05 12:59:42 -04:00
2026-10-05 12:28:40 -04:00
2026-10-05 12:59:42 -04:00
2026-10-05 13:15:30 -04:00
2026-10-05 13:15:30 -04:00
2026-10-05 13:15:22 -04:00
2026-10-05 12:33:01 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:18:12 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:19:28 -04:00
2026-10-05 12:42:50 -04:00
2026-10-05 13:15:17 -04:00
2026-10-05 13:15:17 -04:00
2026-10-05 13:11:39 -04:00
2026-10-05 12:45:45 -04:00
2026-10-05 12:11:45 -04:00
2026-10-05 12:37:56 -04:00
2026-10-05 12:17:01 -04:00
2026-10-05 12:18:49 -04:00
2026-10-05 12:40:11 -04:00
2026-10-05 13:31:15 -04:00
2026-10-05 13:04:05 -04:00
2026-10-05 12:14:31 -04:00
2026-10-05 12:33:01 -04:00
2026-10-05 13:15:22 -04:00
2026-10-05 13:17:47 -04:00
2026-10-05 12:59:33 -04:00
2026-10-05 13:17:47 -04:00
2026-10-05 13:15:22 -04:00
2026-10-05 13:02:54 -04:00
2026-10-05 13:02:54 -04:00
2026-10-05 13:17:47 -04:00
2026-10-05 13:17:47 -04:00
2026-10-05 12:59:33 -04:00
2026-10-05 12:59:33 -04:00
2026-10-05 13:17:47 -04:00
2026-10-05 12:42:50 -04:00
2026-10-05 13:01:32 -04:00
2026-10-05 12:17:01 -04:00
2026-10-05 13:11:39 -04:00
2026-10-05 13:11:39 -04:00
2026-10-05 12:11:45 -04:00
2026-10-05 12:42:50 -04:00
2026-10-05 12:32:10 -04:00
2026-10-05 12:32:10 -04:00
2026-10-05 13:02:39 -04:00
2026-10-05 12:32:37 -04:00
2026-10-05 13:31:15 -04:00
2026-10-05 12:11:45 -04:00
2026-10-05 12:42:50 -04:00
2026-10-05 13:31:15 -04:00
2026-10-05 13:11:39 -04:00
2026-10-05 13:31:15 -04:00
2026-10-05 12:14:31 -04:00
2026-10-05 12:42:50 -04:00
2026-10-05 12:18:49 -04:00
2026-10-05 12:18:49 -04:00
2026-10-05 12:45:45 -04:00
2026-10-05 12:45:45 -04:00
2026-10-05 13:06:24 -04:00
2026-10-05 12:11:45 -04:00
2026-10-05 12:42:50 -04:00
2026-10-05 12:25:18 -04:00
2026-10-05 13:11:39 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 12:31:17 -04:00
2026-10-05 13:15:30 -04:00
2026-10-05 13:02:54 -04:00
2026-10-05 13:22:19 -04:00
2026-10-05 12:17:01 -04:00
2026-10-05 13:02:39 -04:00
2026-10-05 12:17:01 -04:00
2026-10-05 12:42:29 -04:00
2026-10-05 12:42:29 -04:00
2026-10-05 13:15:30 -04:00
2026-10-05 13:15:30 -04:00
2026-10-05 12:27:55 -04:00
2026-10-05 12:45:45 -04:00
2026-10-05 12:32:10 -04:00
2026-10-05 12:32:10 -04:00
2026-10-05 12:42:50 -04:00
2026-10-05 12:42:50 -04:00
2026-10-05 13:11:39 -04:00
2026-10-05 13:11:39 -04:00
2026-10-05 12:25:18 -04:00
2026-10-05 13:04:05 -04:00
2026-10-05 12:59:33 -04:00
2026-10-05 13:02:54 -04:00
2026-10-05 13:31:15 -04:00
2026-10-05 12:40:11 -04:00

MujicaUI

宫廷哥特风格的 Go 桌面组件库,建立在 MyGo 原生 UI 之上。象牙白与炭黑底色,酒红主色,旧金装饰线,衬线标题。100 个组件,浅深两套主题,三种密度。

界面由 MyGo 在 GPU 上自绘,不使用 HTML、JavaScript 或 WebView。

安装

模块路径暂为 mujicaui,尚未发布到代码托管地址。本地使用:

go mod edit -require=mujicaui@v0.0.0 -replace=mujicaui=/path/to/MujicaUI

要求 Go 1.27.1 与 MyGo v0.2.10(见 兼容表)。

最小示例

即 examples/minimal/main.go,CI 校验两者一致。

package main

import (
	"log"

	"github.com/egoist/mygo"
	"github.com/egoist/mygo/ui"

	mujica "mujicaui"
)

type app struct{ name string }

func (a *app) view(c *ui.Context) {
	mujica.Use(c, mujica.Settings{Locale: mujica.ZhCN})
	ui.Column(c).Fill().Center().Gap(12).Children(func() {
		mujica.TextInput(c, &a.name, mujica.TextInputOptions{Placeholder: "姓名"})
		if mujica.Button(c, "觐见", mujica.ButtonOptions{}).Clicked() {
			log.Println("hello", a.name)
		}
	})
}

func main() {
	a := &app{}
	mygo.App.WhenReady(func() {
		mygo.NewWindow(mygo.WindowOptions{Title: "Mujica", Width: 480, Height: 320, Content: ui.View(a.view)})
	})
	if err := mygo.App.Run(); err != nil {
		log.Fatal(err)
	}
}

主题

每帧开头调用 mujica.Use(c, settings)。Settings 决定模式(System、Light、Dark)、密度(theme.Compact、theme.Default、theme.Comfortable)、语言与文案覆盖。每个窗口各自设置,切换不重置业务状态。

mujica.Use(c, mujica.Settings{
	Mode:    mujica.Dark,
	Density: theme.Compact,
	Locale:  mujica.ZhCN,
})
k := mujica.Tokens(c) // 当前窗口的颜色

覆盖顺序:组件参数,窗口 Settings,库默认值。系统高对比度、文本缩放、减少动画始终生效。

go run ./examples/gallery            # 原生窗口
go run ./examples/gallery -web :8080 # 浏览器镜像

浏览器镜像不在浏览器里运行组件。Go 进程用 ui.NewTester 驱动同一个 Gallery 视图,把帧推给页面,再把指针、键盘、输入法和剪贴板事件送回 Go。

文档

许可

MIT。第三方声明见 THIRD_PARTY_NOTICES.md。

S
Description
Court-gothic components for MyGo native UI
Readme MIT
22 MiB
1 Stars 1 Watchers 0 Forks
Languages
Go 99.7%
CSS 0.2%