Window icons (unix).
This commit is contained in:
parent
205db7d4be
commit
550da1f8ed
5 changed files with 14 additions and 6 deletions
|
@ -403,6 +403,10 @@ func loadFlags() []zenity.Option {
|
||||||
opts = append(opts, zenity.DefaultCancel())
|
opts = append(opts, zenity.DefaultCancel())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if notification {
|
||||||
|
icon = windowIcon
|
||||||
|
}
|
||||||
|
|
||||||
switch icon {
|
switch icon {
|
||||||
case "error", "dialog-error":
|
case "error", "dialog-error":
|
||||||
opts = append(opts, zenity.ErrorIcon)
|
opts = append(opts, zenity.ErrorIcon)
|
||||||
|
|
|
@ -43,6 +43,9 @@ func message(kind messageKind, text string, opts options) error {
|
||||||
case NoIcon:
|
case NoIcon:
|
||||||
args = append(args, "--icon-name=")
|
args = append(args, "--icon-name=")
|
||||||
}
|
}
|
||||||
|
if i, ok := opts.icon.(string); ok {
|
||||||
|
args = append(args, "--icon-name", i)
|
||||||
|
}
|
||||||
|
|
||||||
out, err := zenutil.Run(opts.ctx, args)
|
out, err := zenutil.Run(opts.ctx, args)
|
||||||
_, err = strResult(opts, out, err)
|
_, err = strResult(opts, out, err)
|
||||||
|
|
|
@ -19,7 +19,10 @@ func notify(text string, opts options) error {
|
||||||
case PasswordIcon:
|
case PasswordIcon:
|
||||||
args = append(args, "--window-icon=dialog-password")
|
args = append(args, "--window-icon=dialog-password")
|
||||||
case NoIcon:
|
case NoIcon:
|
||||||
args = append(args, "--window-icon=dialog")
|
args = append(args, "--window-icon=")
|
||||||
|
}
|
||||||
|
if i, ok := opts.icon.(string); ok {
|
||||||
|
args = append(args, "--window-icon", i)
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := zenutil.Run(opts.ctx, args)
|
_, err := zenutil.Run(opts.ctx, args)
|
||||||
|
|
|
@ -42,8 +42,6 @@ func notify(text string, opts options) error {
|
||||||
args.InfoFlags |= 0x2 // NIIF_WARNING
|
args.InfoFlags |= 0x2 // NIIF_WARNING
|
||||||
case ErrorIcon:
|
case ErrorIcon:
|
||||||
args.InfoFlags |= 0x3 // NIIF_ERROR
|
args.InfoFlags |= 0x3 // NIIF_ERROR
|
||||||
case NoIcon:
|
|
||||||
//
|
|
||||||
default:
|
default:
|
||||||
icon := getIcon(opts.icon)
|
icon := getIcon(opts.icon)
|
||||||
if icon.handle != 0 {
|
if icon.handle != 0 {
|
||||||
|
|
|
@ -42,9 +42,6 @@ func appendWidthHeight(args []string, opts options) []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func appendWindowIcon(args []string, opts options) []string {
|
func appendWindowIcon(args []string, opts options) []string {
|
||||||
if i, ok := opts.windowIcon.(string); ok {
|
|
||||||
args = append(args, "--window-icon", i)
|
|
||||||
}
|
|
||||||
switch opts.windowIcon {
|
switch opts.windowIcon {
|
||||||
case ErrorIcon:
|
case ErrorIcon:
|
||||||
args = append(args, "--window-icon=error")
|
args = append(args, "--window-icon=error")
|
||||||
|
@ -55,6 +52,9 @@ func appendWindowIcon(args []string, opts options) []string {
|
||||||
case QuestionIcon:
|
case QuestionIcon:
|
||||||
args = append(args, "--window-icon=question")
|
args = append(args, "--window-icon=question")
|
||||||
}
|
}
|
||||||
|
if i, ok := opts.windowIcon.(string); ok {
|
||||||
|
args = append(args, "--window-icon", i)
|
||||||
|
}
|
||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue