-
Notifications
You must be signed in to change notification settings - Fork 0
Icons
Randall C. O'Reilly edited this page Jan 25, 2024
·
1 revision
Icons are SVG files. SVG is split out as a sub-package, so Icon in gi is a wrapper around SVGIcon that is created as a child.
- In general, seems like icons in menus are too small and not useful, and not widely used.
- Icons work best in toolbars, but only as an adjunct to text generally (rarely are icons so clear as to stand on their own).
- Given this, one may legitimately wonder what the point of icons are.. I mean, nobody uses true pictographic languages. Just eye candy presumably.
There are a very small set of widget* icons hard-coded and always available.
In addition, a core set of Icons referred to by the gi package itself are currently just stored in the icons subdirectory, and during initialization they are loaded via the GOPATH.
These were selected from https://leungwensen.github.io/svg-icon/
- https://leungwensen.github.io/svg-icon/ -- this is a great resource -- strongly recommend
- https://fontawesome.com/
- https://joekuan.wordpress.com/2015/09/23/list-of-qt-icons/
- golang.org/x/exp/shiny/materialdesign/icons/ -- material encoded icons
- https://community.kde.org/KDE_Visual_Design_Group/HIG/IconDesign https://github.com/KDE/breeze-icons -- these are pretty messy as SVG files
This is not currently being used -- simple uncategorized names seem better. See FileKindToIcon in fileview.go for code that attempts to find an appropriate icon for different file types.
// TODO: not clear if there is actual value in organizing everything into
// these contexts, etc, as opposed to just using a flat unique name, which is
// simpler as a basic map. for the time being, using the flat map but have
// copied the context here for further consideration..
// different types of standard icon name spaces, from
// https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
// -- we organize our IconSets into these different contexts
type IconContexts int32
const (
// WidgetIcons are used as parts of standard widgets -- these are
// available built-in
WidgetIcons IconContexts = iota
// ActionIcons are generally used in menus and dialogs for interacting
// with the user.
ActionIcons
// AnimationIcons are images used to represent loading web sites, or other
// background processing which may be less suited to more verbose progress
// reporting in the user interface.
AnimationIcons
// ApplicationIcons describe what an application is, for use in the
// Programs menu, window decorations, and the task list. These may or may
// not be generic depending on the application and its purpose.
ApplicationIcons
// CategoryIcons are used for categories in the Programs menu, or the
// Control Center, for separating applications, preferences, and settings
// for display to the user.
CategoryIcons
// DeviceIcons are for hardware that is contained within or connected to the
// computing device. Naming for extended devices in this group, is of the
// form <primary function>-<manufacturer>-<model>. This allows ease of
// fallback to the primary function device name, or ones more targeted for
// a specific series of models from a manufacturer.
DeviceIcons
// EmblemIcons are for tags and properties of files, that are displayed in
// the file manager. This context contains emblems for such things as
// read-only or photos
EmblemIcons
// EmoteIcons for emotions that are expressed through text chat
// applications such as :-) or :-P in IRC or instant messengers.
EmoteIcons
// IntnlIcons for international denominations such as flags.
IntnlIcons
// MimeIcons for different types of data, such as audio or image files.
MimeIcons
// PlaceIcons used to represent locations, either on the local filesystem,
// or through remote connections. Folders, trash, and workgroups are some
// example.
PlaceIcons
// StatusIcons for presenting status to the user. This context contains
// icons for warning and error dialogs, as well as for the current
// weather, appointment alarms, and battery status
StatusIcons
IconContextsN
)
//go:generate stringer -type=IconContexts
var KiT_IconContexts = kit.Enums.AddEnum(IconContextsN, false, nil)
func (ev IconContexts) MarshalJSON() ([]byte, error) { return kit.EnumMarshalJSON(ev) }
func (ev *IconContexts) UnmarshalJSON(b []byte) error { return kit.EnumUnmarshalJSON(ev, b) }
// StdIconNames is a list of standard icon names that we expect to find in an
// IconSet -- used for loookup
var StdIconNames = [IconContextsN][]string{
{ // WidgetIcons
"widget-wedge-down",
"widget-wedge-up",
"widget-wedge-left",
"widget-wedge-right",
"widget-checkmark",
"widget-checked-box",
"widget-unchecked-box",
"widget-circlebutton-on",
"widget-circlebutton-off",
"widget-handle-circles",
}, { // ActionIcons
"edit-clear",
"edit-copy",
"edit-cut",
"edit-delete",
"edit-find",
"edit-find-replace",
"edit-paste",
"edit-redo",
"edit-select-all",
"edit-undo",
"list-add",
"list-remove",
}, { // AnimationIcons
}, { // ApplicationIcons
}, { // CategoryIcons
}, { // DeviceIcons
}, { // EmblemIcons
}, { // EmoteIcons
}, { // IntnlIcons
}, { // MimeIcons
}, { // PlaceIcons
}, { // StatusIcons
},
}