size.go 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. package theme
  2. import "fyne.io/fyne/v2"
  3. const (
  4. // SizeNameCaptionText is the name of theme lookup for helper text size, normally smaller than regular text size.
  5. //
  6. // Since: 2.0
  7. SizeNameCaptionText fyne.ThemeSizeName = "helperText"
  8. // SizeNameInlineIcon is the name of theme lookup for inline icons size.
  9. //
  10. // Since: 2.0
  11. SizeNameInlineIcon fyne.ThemeSizeName = "iconInline"
  12. // SizeNameInnerPadding is the name of theme lookup for internal widget padding size.
  13. //
  14. // Since: 2.3
  15. SizeNameInnerPadding fyne.ThemeSizeName = "innerPadding"
  16. // SizeNameLineSpacing is the name of theme lookup for between text line spacing.
  17. //
  18. // Since: 2.3
  19. SizeNameLineSpacing fyne.ThemeSizeName = "lineSpacing"
  20. // SizeNamePadding is the name of theme lookup for padding size.
  21. //
  22. // Since: 2.0
  23. SizeNamePadding fyne.ThemeSizeName = "padding"
  24. // SizeNameScrollBar is the name of theme lookup for the scrollbar size.
  25. //
  26. // Since: 2.0
  27. SizeNameScrollBar fyne.ThemeSizeName = "scrollBar"
  28. // SizeNameScrollBarSmall is the name of theme lookup for the shrunk scrollbar size.
  29. //
  30. // Since: 2.0
  31. SizeNameScrollBarSmall fyne.ThemeSizeName = "scrollBarSmall"
  32. // SizeNameSeparatorThickness is the name of theme lookup for the thickness of a separator.
  33. //
  34. // Since: 2.0
  35. SizeNameSeparatorThickness fyne.ThemeSizeName = "separator"
  36. // SizeNameText is the name of theme lookup for text size.
  37. //
  38. // Since: 2.0
  39. SizeNameText fyne.ThemeSizeName = "text"
  40. // SizeNameHeadingText is the name of theme lookup for text size of a heading.
  41. //
  42. // Since: 2.1
  43. SizeNameHeadingText fyne.ThemeSizeName = "headingText"
  44. // SizeNameSubHeadingText is the name of theme lookup for text size of a sub-heading.
  45. //
  46. // Since: 2.1
  47. SizeNameSubHeadingText fyne.ThemeSizeName = "subHeadingText"
  48. // SizeNameInputBorder is the name of theme lookup for input border size.
  49. //
  50. // Since: 2.0
  51. SizeNameInputBorder fyne.ThemeSizeName = "inputBorder"
  52. // SizeNameInputRadius is the name of theme lookup for input corner radius.
  53. //
  54. // Since: 2.4
  55. SizeNameInputRadius fyne.ThemeSizeName = "inputRadius"
  56. // SizeNameSelectionRadius is the name of theme lookup for selection corner radius.
  57. //
  58. // Since: 2.4
  59. SizeNameSelectionRadius fyne.ThemeSizeName = "selectionRadius"
  60. )
  61. // CaptionTextSize returns the size for caption text.
  62. func CaptionTextSize() float32 {
  63. return current().Size(SizeNameCaptionText)
  64. }
  65. // IconInlineSize is the standard size of icons which appear within buttons, labels etc.
  66. func IconInlineSize() float32 {
  67. return current().Size(SizeNameInlineIcon)
  68. }
  69. // InnerPadding is the standard gap between element content and the outside edge of a widget.
  70. //
  71. // Since: 2.3
  72. func InnerPadding() float32 {
  73. return current().Size(SizeNameInnerPadding)
  74. }
  75. // InputBorderSize returns the input border size (or underline size for an entry).
  76. //
  77. // Since: 2.0
  78. func InputBorderSize() float32 {
  79. return current().Size(SizeNameInputBorder)
  80. }
  81. // InputRadiusSize returns the input radius size.
  82. //
  83. // Since: 2.4
  84. func InputRadiusSize() float32 {
  85. return current().Size(SizeNameInputRadius)
  86. }
  87. // LineSpacing is the default gap between multiple lines of text.
  88. //
  89. // Since: 2.3
  90. func LineSpacing() float32 {
  91. return current().Size(SizeNameLineSpacing)
  92. }
  93. // Padding is the standard gap between elements and the border around interface elements.
  94. func Padding() float32 {
  95. return current().Size(SizeNamePadding)
  96. }
  97. // ScrollBarSize is the width (or height) of the bars on a ScrollContainer.
  98. func ScrollBarSize() float32 {
  99. return current().Size(SizeNameScrollBar)
  100. }
  101. // ScrollBarSmallSize is the width (or height) of the minimized bars on a ScrollContainer.
  102. func ScrollBarSmallSize() float32 {
  103. return current().Size(SizeNameScrollBarSmall)
  104. }
  105. // SelectionRadiusSize returns the selection highlight radius size.
  106. //
  107. // Since: 2.4
  108. func SelectionRadiusSize() float32 {
  109. return current().Size(SizeNameSelectionRadius)
  110. }
  111. // SeparatorThicknessSize is the standard thickness of the separator widget.
  112. //
  113. // Since: 2.0
  114. func SeparatorThicknessSize() float32 {
  115. return current().Size(SizeNameSeparatorThickness)
  116. }
  117. // TextHeadingSize returns the text size for header text.
  118. //
  119. // Since: 2.1
  120. func TextHeadingSize() float32 {
  121. return current().Size(SizeNameHeadingText)
  122. }
  123. // TextSize returns the standard text size.
  124. func TextSize() float32 {
  125. return current().Size(SizeNameText)
  126. }
  127. // TextSubHeadingSize returns the text size for sub-header text.
  128. //
  129. // Since: 2.1
  130. func TextSubHeadingSize() float32 {
  131. return current().Size(SizeNameSubHeadingText)
  132. }