Empty icons, fixes.
This commit is contained in:
parent
7f1f5d1aa3
commit
a422ef6a6d
5 changed files with 12 additions and 5 deletions
|
@ -245,6 +245,8 @@ func loadFlags() []zenity.Option {
|
|||
|
||||
var ico zenity.DialogIcon
|
||||
switch icon {
|
||||
case "":
|
||||
ico = zenity.NoIcon
|
||||
case "error", "dialog-error":
|
||||
ico = zenity.ErrorIcon
|
||||
case "info", "dialog-information":
|
||||
|
|
|
@ -52,6 +52,8 @@ func message(kind messageKind, text string, opts options) (bool, error) {
|
|||
args = append(args, "--default-cancel")
|
||||
}
|
||||
switch opts.icon {
|
||||
case NoIcon:
|
||||
args = append(args, "--icon-name=")
|
||||
case ErrorIcon:
|
||||
args = append(args, "--window-icon=error", "--icon-name=dialog-error")
|
||||
case WarningIcon:
|
||||
|
|
|
@ -16,14 +16,16 @@ func notify(text string, opts options) error {
|
|||
args = append(args, "--title", *opts.title)
|
||||
}
|
||||
switch opts.icon {
|
||||
case NoIcon:
|
||||
args = append(args, "--window-icon=dialog")
|
||||
case ErrorIcon:
|
||||
args = append(args, "--window-icon=error")
|
||||
args = append(args, "--window-icon=dialog-error")
|
||||
case WarningIcon:
|
||||
args = append(args, "--window-icon=warning")
|
||||
args = append(args, "--window-icon=dialog-warning")
|
||||
case InfoIcon:
|
||||
args = append(args, "--window-icon=info")
|
||||
args = append(args, "--window-icon=dialog-information")
|
||||
case QuestionIcon:
|
||||
args = append(args, "--window-icon=question")
|
||||
args = append(args, "--window-icon=dialog-question")
|
||||
}
|
||||
|
||||
_, err := zenutil.Run(opts.ctx, args)
|
||||
|
|
|
@ -33,7 +33,7 @@ func notify(text string, opts options) error {
|
|||
}
|
||||
|
||||
switch opts.icon {
|
||||
case InfoIcon:
|
||||
case InfoIcon, QuestionIcon:
|
||||
args.InfoFlags |= 0x1 // NIIF_INFO
|
||||
case WarningIcon:
|
||||
args.InfoFlags |= 0x2 // NIIF_WARNING
|
||||
|
|
|
@ -97,6 +97,7 @@ const (
|
|||
WarningIcon
|
||||
InfoIcon
|
||||
QuestionIcon
|
||||
NoIcon
|
||||
)
|
||||
|
||||
// Icon returns an Option to set the dialog icon.
|
||||
|
|
Loading…
Reference in a new issue