style_light.go 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900
  1. // Copyright 2016 The G3N Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package gui
  5. import (
  6. "github.com/g3n/engine/gui/assets"
  7. "github.com/g3n/engine/gui/assets/icon"
  8. "github.com/g3n/engine/math32"
  9. "github.com/g3n/engine/text"
  10. )
  11. // NewLightStyle creates and returns a pointer to the a new "light" style
  12. func NewLightStyle() *Style {
  13. // Fonts to use
  14. const fontName = "fonts/FreeSans.ttf"
  15. const iconName = "fonts/MaterialIcons-Regular.ttf"
  16. s := new(Style)
  17. // Creates text font
  18. fontData := assets.MustAsset(fontName)
  19. font, err := text.NewFontFromData(fontData)
  20. if err != nil {
  21. panic(err)
  22. }
  23. font.SetLineSpacing(1.0)
  24. font.SetSize(14)
  25. font.SetDPI(72)
  26. font.SetFgColor4(math32.NewColor4("black"))
  27. font.SetBgColor4(math32.NewColor4("black", 0))
  28. s.Font = font
  29. // Creates icon font
  30. fontIconData := assets.MustAsset(iconName)
  31. fontIcon, err := text.NewFontFromData(fontIconData)
  32. if err != nil {
  33. panic(err)
  34. }
  35. fontIcon.SetLineSpacing(1.0)
  36. fontIcon.SetSize(14)
  37. fontIcon.SetDPI(72)
  38. fontIcon.SetFgColor4(math32.NewColor4("black"))
  39. fontIcon.SetBgColor4(math32.NewColor4("white", 0))
  40. s.FontIcon = fontIcon
  41. borderSizes := RectBounds{1, 1, 1, 1}
  42. borderColor := math32.Color4Name("DimGray")
  43. borderColorDis := math32.Color4Name("LightGray")
  44. bgColor := math32.Color{0.85, 0.85, 0.85}
  45. bgColor4 := math32.Color4{0, 0, 0, 0}
  46. bgColorOver := math32.Color{0.9, 0.9, 0.9}
  47. bgColor4Over := math32.Color4{1, 1, 1, 0.5}
  48. bgColor4Sel := math32.Color4{0.6, 0.6, 0.6, 1}
  49. fgColor := math32.Color{0, 0, 0}
  50. fgColorSel := math32.Color{0, 0, 0}
  51. fgColorDis := math32.Color{0.4, 0.4, 0.4}
  52. // Button styles
  53. s.Button = ButtonStyles{
  54. Normal: ButtonStyle{
  55. Border: borderSizes,
  56. Paddings: RectBounds{2, 4, 2, 4},
  57. BorderColor: borderColor,
  58. BgColor: bgColor,
  59. FgColor: fgColor,
  60. },
  61. Over: ButtonStyle{
  62. Border: borderSizes,
  63. Paddings: RectBounds{2, 4, 2, 4},
  64. BorderColor: borderColor,
  65. BgColor: bgColorOver,
  66. FgColor: fgColor,
  67. },
  68. Focus: ButtonStyle{
  69. Border: borderSizes,
  70. Paddings: RectBounds{2, 4, 2, 4},
  71. BorderColor: borderColor,
  72. BgColor: bgColorOver,
  73. FgColor: fgColor,
  74. },
  75. Pressed: ButtonStyle{
  76. Border: RectBounds{2, 2, 2, 2},
  77. Paddings: RectBounds{2, 4, 2, 4},
  78. BorderColor: borderColor,
  79. BgColor: bgColorOver,
  80. FgColor: fgColor,
  81. },
  82. Disabled: ButtonStyle{
  83. Border: borderSizes,
  84. Paddings: RectBounds{2, 4, 2, 4},
  85. BorderColor: borderColorDis,
  86. BgColor: bgColor,
  87. FgColor: fgColorDis,
  88. },
  89. }
  90. // CheckRadio styles
  91. s.CheckRadio = CheckRadioStyles{
  92. Normal: CheckRadioStyle{
  93. Border: RectBounds{0, 0, 0, 0},
  94. Paddings: RectBounds{0, 0, 0, 0},
  95. BorderColor: borderColor,
  96. BgColor: bgColor4,
  97. FgColor: fgColor,
  98. },
  99. Over: CheckRadioStyle{
  100. Border: RectBounds{0, 0, 0, 0},
  101. Paddings: RectBounds{0, 0, 0, 0},
  102. BorderColor: borderColor,
  103. BgColor: bgColor4Over,
  104. FgColor: fgColor,
  105. },
  106. Focus: CheckRadioStyle{
  107. Border: RectBounds{0, 0, 0, 0},
  108. Paddings: RectBounds{0, 0, 0, 0},
  109. BorderColor: borderColor,
  110. BgColor: bgColor4Over,
  111. FgColor: fgColor,
  112. },
  113. Disabled: CheckRadioStyle{
  114. Border: RectBounds{0, 0, 0, 0},
  115. Paddings: RectBounds{0, 0, 0, 0},
  116. BorderColor: borderColor,
  117. BgColor: bgColor4,
  118. FgColor: fgColorDis,
  119. },
  120. }
  121. // Edit styles
  122. s.Edit = EditStyles{
  123. Normal: EditStyle{
  124. Border: RectBounds{1, 1, 1, 1},
  125. Paddings: RectBounds{0, 0, 0, 0},
  126. BorderColor: borderColor,
  127. BgColor: bgColor,
  128. BgAlpha: 1.0,
  129. FgColor: fgColor,
  130. HolderColor: math32.Color{0.4, 0.4, 0.4},
  131. },
  132. Over: EditStyle{
  133. Border: RectBounds{1, 1, 1, 1},
  134. Paddings: RectBounds{0, 0, 0, 0},
  135. BorderColor: borderColor,
  136. BgColor: bgColorOver,
  137. BgAlpha: 1.0,
  138. FgColor: fgColor,
  139. HolderColor: math32.Color{0.4, 0.4, 0.4},
  140. },
  141. Focus: EditStyle{
  142. Border: RectBounds{1, 1, 1, 1},
  143. Paddings: RectBounds{0, 0, 0, 0},
  144. BorderColor: borderColor,
  145. BgColor: bgColorOver,
  146. BgAlpha: 1.0,
  147. FgColor: fgColor,
  148. HolderColor: math32.Color{0.4, 0.4, 0.4},
  149. },
  150. Disabled: EditStyle{
  151. Border: RectBounds{1, 1, 1, 1},
  152. Paddings: RectBounds{0, 0, 0, 0},
  153. BorderColor: borderColor,
  154. BgColor: bgColor,
  155. BgAlpha: 1.0,
  156. FgColor: fgColorDis,
  157. HolderColor: math32.Color{0.4, 0.4, 0.4},
  158. },
  159. }
  160. // ScrollBar style
  161. s.ScrollBar = ScrollBarStyles{
  162. Normal: ScrollBarStyle{
  163. Paddings: RectBounds{1, 1, 1, 1},
  164. Borders: RectBounds{1, 1, 1, 1},
  165. BordersColor: borderColor,
  166. Color: math32.Color{0.8, 0.8, 0.8},
  167. Button: ScrollBarButtonStyle{
  168. Borders: RectBounds{1, 1, 1, 1},
  169. BordersColor: borderColor,
  170. Color: math32.Color{0.5, 0.5, 0.5},
  171. Size: 30,
  172. },
  173. },
  174. Over: ScrollBarStyle{
  175. Paddings: RectBounds{1, 1, 1, 1},
  176. Borders: RectBounds{1, 1, 1, 1},
  177. BordersColor: borderColor,
  178. Color: math32.Color{0.8, 0.8, 0.8},
  179. Button: ScrollBarButtonStyle{
  180. Borders: RectBounds{1, 1, 1, 1},
  181. BordersColor: borderColor,
  182. Color: math32.Color{0.5, 0.5, 0.5},
  183. Size: 30,
  184. },
  185. },
  186. Disabled: ScrollBarStyle{
  187. Paddings: RectBounds{1, 1, 1, 1},
  188. Borders: RectBounds{1, 1, 1, 1},
  189. BordersColor: borderColor,
  190. Color: math32.Color{0.8, 0.8, 0.8},
  191. Button: ScrollBarButtonStyle{
  192. Borders: RectBounds{1, 1, 1, 1},
  193. BordersColor: borderColor,
  194. Color: math32.Color{0.5, 0.5, 0.5},
  195. Size: 30,
  196. },
  197. },
  198. }
  199. // Slider styles
  200. s.Slider = SliderStyles{
  201. Normal: SliderStyle{
  202. Border: borderSizes,
  203. BorderColor: borderColor,
  204. Paddings: RectBounds{0, 0, 0, 0},
  205. BgColor: math32.Color4{0.8, 0.8, 0.8, 1},
  206. FgColor: math32.Color4{0, 0.8, 0, 1},
  207. },
  208. Over: SliderStyle{
  209. Border: borderSizes,
  210. BorderColor: borderColor,
  211. Paddings: RectBounds{0, 0, 0, 0},
  212. BgColor: math32.Color4{1, 1, 1, 1},
  213. FgColor: math32.Color4{0, 1, 0, 1},
  214. },
  215. Focus: SliderStyle{
  216. Border: borderSizes,
  217. BorderColor: borderColor,
  218. Paddings: RectBounds{0, 0, 0, 0},
  219. BgColor: math32.Color4{1, 1, 1, 1},
  220. FgColor: math32.Color4{0, 1, 0, 1},
  221. },
  222. Disabled: SliderStyle{
  223. Border: borderSizes,
  224. BorderColor: borderColor,
  225. Paddings: RectBounds{0, 0, 0, 0},
  226. BgColor: math32.Color4{0.8, 0.8, 0.8, 1},
  227. FgColor: math32.Color4{0, 0.8, 0, 1},
  228. },
  229. }
  230. // Splitter styles
  231. s.Splitter = SplitterStyles{
  232. Normal: SplitterStyle{
  233. SpacerBorderColor: borderColor,
  234. SpacerColor: bgColor,
  235. SpacerSize: 6,
  236. },
  237. Over: SplitterStyle{
  238. SpacerBorderColor: borderColor,
  239. SpacerColor: bgColorOver,
  240. SpacerSize: 6,
  241. },
  242. Drag: SplitterStyle{
  243. SpacerBorderColor: borderColor,
  244. SpacerColor: bgColorOver,
  245. SpacerSize: 6,
  246. },
  247. }
  248. s.Window = WindowStyles{
  249. Normal: WindowStyle{
  250. Border: RectBounds{4, 4, 4, 4},
  251. Paddings: RectBounds{0, 0, 0, 0},
  252. BorderColor: math32.Color4{0.2, 0.2, 0.2, 1},
  253. TitleBorders: RectBounds{0, 0, 1, 0},
  254. TitleBorderColor: math32.Color4{0, 0, 0, 1},
  255. TitleBgColor: math32.Color4{0, 1, 0, 1},
  256. TitleFgColor: math32.Color4{0, 0, 0, 1},
  257. },
  258. Over: WindowStyle{
  259. Border: RectBounds{4, 4, 4, 4},
  260. Paddings: RectBounds{0, 0, 0, 0},
  261. BorderColor: math32.Color4{0.2, 0.2, 0.2, 1},
  262. TitleBorders: RectBounds{0, 0, 1, 0},
  263. TitleBorderColor: math32.Color4{0, 0, 0, 1},
  264. TitleBgColor: math32.Color4{0, 1, 0, 1},
  265. TitleFgColor: math32.Color4{0, 0, 0, 1},
  266. },
  267. Focus: WindowStyle{
  268. Border: RectBounds{4, 4, 4, 4},
  269. Paddings: RectBounds{0, 0, 0, 0},
  270. BorderColor: math32.Color4{0.2, 0.2, 0.2, 1},
  271. TitleBorders: RectBounds{0, 0, 1, 0},
  272. TitleBorderColor: math32.Color4{0, 0, 0, 1},
  273. TitleBgColor: math32.Color4{0, 1, 0, 1},
  274. TitleFgColor: math32.Color4{0, 0, 0, 1},
  275. },
  276. Disabled: WindowStyle{
  277. Border: RectBounds{4, 4, 4, 4},
  278. Paddings: RectBounds{0, 0, 0, 0},
  279. BorderColor: math32.Color4{0.2, 0.2, 0.2, 1},
  280. TitleBorders: RectBounds{0, 0, 1, 0},
  281. TitleBorderColor: math32.Color4{0, 0, 0, 1},
  282. TitleBgColor: math32.Color4{0, 1, 0, 1},
  283. TitleFgColor: math32.Color4{0, 0, 0, 1},
  284. },
  285. }
  286. // Scroller styles
  287. s.Scroller = ScrollerStyles{
  288. Normal: ScrollerStyle{
  289. Border: RectBounds{1, 1, 1, 1},
  290. Paddings: RectBounds{0, 0, 0, 0},
  291. BorderColor: borderColor,
  292. BgColor: bgColor,
  293. FgColor: fgColor,
  294. },
  295. Over: ScrollerStyle{
  296. Border: RectBounds{1, 1, 1, 1},
  297. Paddings: RectBounds{0, 0, 0, 0},
  298. BorderColor: borderColor,
  299. BgColor: bgColorOver,
  300. FgColor: fgColor,
  301. },
  302. Focus: ScrollerStyle{
  303. Border: RectBounds{1, 1, 1, 1},
  304. Paddings: RectBounds{0, 0, 0, 0},
  305. BorderColor: borderColor,
  306. BgColor: bgColorOver,
  307. FgColor: fgColor,
  308. },
  309. Disabled: ScrollerStyle{
  310. Border: RectBounds{1, 1, 1, 1},
  311. Paddings: RectBounds{0, 0, 0, 0},
  312. BorderColor: borderColor,
  313. BgColor: bgColor,
  314. FgColor: fgColor,
  315. },
  316. }
  317. // List styles
  318. s.List = ListStyles{
  319. Scroller: &ScrollerStyles{
  320. Normal: ScrollerStyle{
  321. Border: RectBounds{1, 1, 1, 1},
  322. Paddings: RectBounds{0, 0, 0, 0},
  323. BorderColor: borderColor,
  324. BgColor: bgColor,
  325. FgColor: fgColor,
  326. },
  327. Over: ScrollerStyle{
  328. Border: RectBounds{1, 1, 1, 1},
  329. Paddings: RectBounds{0, 0, 0, 0},
  330. BorderColor: borderColor,
  331. BgColor: bgColorOver,
  332. FgColor: fgColor,
  333. },
  334. Focus: ScrollerStyle{
  335. Border: RectBounds{1, 1, 1, 1},
  336. Paddings: RectBounds{0, 0, 0, 0},
  337. BorderColor: borderColor,
  338. BgColor: bgColorOver,
  339. FgColor: fgColor,
  340. },
  341. Disabled: ScrollerStyle{
  342. Border: RectBounds{1, 1, 1, 1},
  343. Paddings: RectBounds{0, 0, 0, 0},
  344. BorderColor: borderColor,
  345. BgColor: bgColor,
  346. FgColor: fgColor,
  347. },
  348. },
  349. Item: &ListItemStyles{
  350. Normal: ListItemStyle{
  351. Border: RectBounds{1, 0, 1, 0},
  352. Paddings: RectBounds{0, 0, 0, 2},
  353. BorderColor: math32.Color4{0, 0, 0, 0},
  354. BgColor: bgColor4,
  355. FgColor: fgColor,
  356. },
  357. Selected: ListItemStyle{
  358. Border: RectBounds{1, 0, 1, 0},
  359. Paddings: RectBounds{0, 0, 0, 2},
  360. BorderColor: math32.Color4{0, 0, 0, 0},
  361. BgColor: bgColor4Sel,
  362. FgColor: fgColorSel,
  363. },
  364. Highlighted: ListItemStyle{
  365. Border: RectBounds{1, 0, 1, 0},
  366. Paddings: RectBounds{0, 0, 0, 2},
  367. BorderColor: math32.Color4{0, 0, 0, 1},
  368. BgColor: bgColor4Over,
  369. FgColor: fgColor,
  370. },
  371. SelHigh: ListItemStyle{
  372. Border: RectBounds{1, 0, 1, 0},
  373. Paddings: RectBounds{0, 0, 0, 2},
  374. BorderColor: math32.Color4{0, 0, 0, 1},
  375. BgColor: bgColor4Sel,
  376. FgColor: fgColorSel,
  377. },
  378. },
  379. }
  380. s.DropDown = DropDownStyles{
  381. Normal: &DropDownStyle{
  382. Border: RectBounds{1, 1, 1, 1},
  383. Paddings: RectBounds{0, 0, 0, 2},
  384. BorderColor: borderColor,
  385. BgColor: bgColor,
  386. FgColor: fgColor,
  387. },
  388. Over: &DropDownStyle{
  389. Border: RectBounds{1, 1, 1, 1},
  390. Paddings: RectBounds{0, 0, 0, 2},
  391. BorderColor: borderColor,
  392. BgColor: bgColorOver,
  393. FgColor: fgColor,
  394. },
  395. Focus: &DropDownStyle{
  396. Border: RectBounds{1, 1, 1, 1},
  397. Paddings: RectBounds{0, 0, 0, 2},
  398. BorderColor: borderColor,
  399. BgColor: bgColorOver,
  400. FgColor: fgColor,
  401. },
  402. Disabled: &DropDownStyle{
  403. Border: RectBounds{1, 1, 1, 1},
  404. Paddings: RectBounds{0, 0, 0, 2},
  405. BorderColor: borderColor,
  406. BgColor: bgColor,
  407. FgColor: fgColor,
  408. },
  409. }
  410. s.Folder = FolderStyles{
  411. Normal: &FolderStyle{
  412. Margins: RectBounds{0, 0, 0, 0},
  413. Border: RectBounds{1, 1, 1, 1},
  414. Paddings: RectBounds{2, 0, 2, 2},
  415. BorderColor: borderColor,
  416. BgColor: bgColor,
  417. FgColor: fgColor,
  418. Icons: [2]string{icon.ExpandMore, icon.ExpandLess},
  419. },
  420. Over: &FolderStyle{
  421. Margins: RectBounds{0, 0, 0, 0},
  422. Border: RectBounds{1, 1, 1, 1},
  423. Paddings: RectBounds{2, 0, 2, 2},
  424. BorderColor: borderColor,
  425. BgColor: bgColorOver,
  426. FgColor: fgColor,
  427. Icons: [2]string{icon.ExpandMore, icon.ExpandLess},
  428. },
  429. Focus: &FolderStyle{
  430. Margins: RectBounds{0, 0, 0, 0},
  431. Border: RectBounds{1, 1, 1, 1},
  432. Paddings: RectBounds{2, 2, 2, 2},
  433. BorderColor: borderColor,
  434. BgColor: bgColorOver,
  435. FgColor: fgColor,
  436. Icons: [2]string{icon.ExpandMore, icon.ExpandLess},
  437. },
  438. Disabled: &FolderStyle{
  439. Margins: RectBounds{0, 0, 0, 0},
  440. Border: RectBounds{1, 1, 1, 1},
  441. Paddings: RectBounds{2, 2, 2, 2},
  442. BorderColor: borderColor,
  443. BgColor: bgColorOver,
  444. FgColor: fgColor,
  445. Icons: [2]string{icon.ExpandMore, icon.ExpandLess},
  446. },
  447. }
  448. s.Tree = TreeStyles{
  449. List: &ListStyles{
  450. Scroller: &ScrollerStyles{
  451. Normal: ScrollerStyle{
  452. Border: RectBounds{1, 1, 1, 1},
  453. Paddings: RectBounds{0, 0, 0, 0},
  454. BorderColor: borderColor,
  455. BgColor: bgColor,
  456. FgColor: fgColor,
  457. },
  458. Over: ScrollerStyle{
  459. Border: RectBounds{1, 1, 1, 1},
  460. Paddings: RectBounds{0, 0, 0, 0},
  461. BorderColor: borderColor,
  462. BgColor: bgColorOver,
  463. FgColor: fgColor,
  464. },
  465. Focus: ScrollerStyle{
  466. Border: RectBounds{1, 1, 1, 1},
  467. Paddings: RectBounds{0, 0, 0, 0},
  468. BorderColor: borderColor,
  469. BgColor: bgColorOver,
  470. FgColor: fgColor,
  471. },
  472. Disabled: ScrollerStyle{
  473. Border: RectBounds{1, 1, 1, 1},
  474. Paddings: RectBounds{0, 0, 0, 0},
  475. BorderColor: borderColor,
  476. BgColor: bgColor,
  477. FgColor: fgColor,
  478. },
  479. },
  480. Item: &ListItemStyles{
  481. Normal: ListItemStyle{
  482. Border: RectBounds{1, 0, 1, 0},
  483. Paddings: RectBounds{0, 0, 0, 2},
  484. BorderColor: math32.Color4{0, 0, 0, 0},
  485. BgColor: bgColor4,
  486. FgColor: fgColor,
  487. },
  488. Selected: ListItemStyle{
  489. Border: RectBounds{1, 0, 1, 0},
  490. Paddings: RectBounds{0, 0, 0, 2},
  491. BorderColor: math32.Color4{0, 0, 0, 0},
  492. BgColor: bgColor4Sel,
  493. FgColor: fgColorSel,
  494. },
  495. Highlighted: ListItemStyle{
  496. Border: RectBounds{1, 0, 1, 0},
  497. Paddings: RectBounds{0, 0, 0, 2},
  498. BorderColor: math32.Color4{0, 0, 0, 1},
  499. BgColor: bgColor4Over,
  500. FgColor: fgColor,
  501. },
  502. SelHigh: ListItemStyle{
  503. Border: RectBounds{1, 0, 1, 0},
  504. Paddings: RectBounds{0, 0, 0, 2},
  505. BorderColor: math32.Color4{0, 0, 0, 1},
  506. BgColor: bgColor4Sel,
  507. FgColor: fgColorSel,
  508. },
  509. },
  510. },
  511. Node: &TreeNodeStyles{
  512. Normal: TreeNodeStyle{
  513. Border: RectBounds{0, 0, 0, 0},
  514. Paddings: RectBounds{0, 0, 0, 0},
  515. BorderColor: borderColor,
  516. BgColor: bgColor4,
  517. FgColor: fgColor,
  518. Icons: [2]string{icon.ExpandMore, icon.ExpandLess},
  519. },
  520. },
  521. Padlevel: 16.0,
  522. }
  523. s.ControlFolder = ControlFolderStyles{
  524. Folder: &FolderStyles{
  525. Normal: &FolderStyle{
  526. Margins: RectBounds{0, 0, 0, 0},
  527. Border: RectBounds{1, 1, 1, 1},
  528. Paddings: RectBounds{2, 0, 2, 2},
  529. BorderColor: math32.Color4{0, 0, 0, 0},
  530. BgColor: math32.Color{0, 0.5, 1},
  531. FgColor: fgColor,
  532. Icons: [2]string{icon.ExpandMore, icon.ExpandLess},
  533. },
  534. Over: &FolderStyle{
  535. Margins: RectBounds{0, 0, 0, 0},
  536. Border: RectBounds{1, 1, 1, 1},
  537. Paddings: RectBounds{2, 0, 2, 2},
  538. BorderColor: math32.Color4{0, 0, 0, 0},
  539. BgColor: math32.Color{0, 0.5, 1},
  540. FgColor: fgColor,
  541. Icons: [2]string{icon.ExpandMore, icon.ExpandLess},
  542. },
  543. Focus: &FolderStyle{
  544. Margins: RectBounds{0, 0, 0, 0},
  545. Border: RectBounds{1, 1, 1, 1},
  546. Paddings: RectBounds{2, 2, 2, 2},
  547. BorderColor: math32.Color4{0, 0, 0, 0},
  548. BgColor: math32.Color{0, 0.5, 1},
  549. FgColor: fgColor,
  550. Icons: [2]string{icon.ExpandMore, icon.ExpandLess},
  551. },
  552. Disabled: &FolderStyle{
  553. Margins: RectBounds{0, 0, 0, 0},
  554. Border: RectBounds{1, 1, 1, 1},
  555. Paddings: RectBounds{2, 2, 2, 2},
  556. BorderColor: math32.Color4{0, 0, 0, 0},
  557. BgColor: math32.Color{0, 0.5, 1},
  558. FgColor: fgColor,
  559. Icons: [2]string{icon.ExpandMore, icon.ExpandLess},
  560. },
  561. },
  562. Tree: &TreeStyles{
  563. List: &ListStyles{
  564. Scroller: &ScrollerStyles{
  565. Normal: ScrollerStyle{
  566. Border: RectBounds{1, 1, 1, 1},
  567. Paddings: RectBounds{0, 2, 0, 0},
  568. BorderColor: borderColor,
  569. BgColor: bgColor,
  570. FgColor: fgColor,
  571. },
  572. Over: ScrollerStyle{
  573. Border: RectBounds{1, 1, 1, 1},
  574. Paddings: RectBounds{0, 2, 0, 0},
  575. BorderColor: borderColor,
  576. BgColor: bgColorOver,
  577. FgColor: fgColor,
  578. },
  579. Focus: ScrollerStyle{
  580. Border: RectBounds{1, 1, 1, 1},
  581. Paddings: RectBounds{0, 2, 0, 0},
  582. BorderColor: borderColor,
  583. BgColor: bgColorOver,
  584. FgColor: fgColor,
  585. },
  586. Disabled: ScrollerStyle{
  587. Border: RectBounds{1, 1, 1, 1},
  588. Paddings: RectBounds{0, 2, 0, 0},
  589. BorderColor: borderColor,
  590. BgColor: bgColor,
  591. FgColor: fgColor,
  592. },
  593. },
  594. Item: &ListItemStyles{
  595. Normal: ListItemStyle{
  596. Border: RectBounds{1, 0, 1, 0},
  597. Paddings: RectBounds{0, 0, 0, 2},
  598. BorderColor: math32.Color4{0, 0, 0, 0},
  599. BgColor: bgColor4,
  600. FgColor: fgColor,
  601. },
  602. Selected: ListItemStyle{
  603. Border: RectBounds{1, 0, 1, 0},
  604. Paddings: RectBounds{0, 0, 0, 2},
  605. BorderColor: math32.Color4{0, 0, 0, 0},
  606. BgColor: bgColor4,
  607. FgColor: fgColor,
  608. },
  609. Highlighted: ListItemStyle{
  610. Border: RectBounds{1, 0, 1, 0},
  611. Paddings: RectBounds{0, 0, 0, 2},
  612. BorderColor: math32.Color4{0, 0, 0, 1},
  613. BgColor: bgColor4Over,
  614. FgColor: fgColor,
  615. },
  616. SelHigh: ListItemStyle{
  617. Border: RectBounds{1, 0, 1, 0},
  618. Paddings: RectBounds{0, 0, 0, 2},
  619. BorderColor: math32.Color4{0, 0, 0, 1},
  620. BgColor: bgColor4Sel,
  621. FgColor: fgColorSel,
  622. },
  623. },
  624. },
  625. Node: &TreeNodeStyles{
  626. Normal: TreeNodeStyle{
  627. Border: RectBounds{0, 0, 0, 0},
  628. Paddings: RectBounds{0, 0, 0, 0},
  629. BorderColor: borderColor,
  630. BgColor: bgColor4,
  631. FgColor: fgColor,
  632. Icons: [2]string{icon.ExpandMore, icon.ExpandLess},
  633. },
  634. },
  635. Padlevel: 2.0,
  636. },
  637. }
  638. // Menu styles
  639. s.Menu = MenuStyles{
  640. Body: &MenuBodyStyles{
  641. Normal: MenuBodyStyle{
  642. Border: RectBounds{1, 1, 1, 1},
  643. Paddings: RectBounds{2, 2, 2, 2},
  644. BorderColor: borderColor,
  645. BgColor: bgColor,
  646. FgColor: fgColor,
  647. },
  648. Over: MenuBodyStyle{
  649. Border: RectBounds{1, 1, 1, 1},
  650. Paddings: RectBounds{2, 2, 2, 2},
  651. BorderColor: borderColor,
  652. BgColor: bgColorOver,
  653. FgColor: fgColor,
  654. },
  655. Focus: MenuBodyStyle{
  656. Border: RectBounds{1, 1, 1, 1},
  657. Paddings: RectBounds{2, 2, 2, 2},
  658. BorderColor: borderColor,
  659. BgColor: bgColorOver,
  660. FgColor: fgColor,
  661. },
  662. Disabled: MenuBodyStyle{
  663. Border: RectBounds{1, 1, 1, 1},
  664. Paddings: RectBounds{2, 2, 2, 2},
  665. BorderColor: borderColor,
  666. BgColor: bgColor,
  667. FgColor: fgColor,
  668. },
  669. },
  670. Item: &MenuItemStyles{
  671. Normal: MenuItemStyle{
  672. Border: RectBounds{0, 0, 0, 0},
  673. Paddings: RectBounds{2, 4, 2, 2},
  674. BorderColor: borderColor,
  675. BgColor: bgColor,
  676. FgColor: fgColor,
  677. IconPaddings: RectBounds{0, 6, 0, 4},
  678. ShortcutPaddings: RectBounds{0, 0, 0, 10},
  679. RiconPaddings: RectBounds{2, 0, 0, 4},
  680. },
  681. Over: MenuItemStyle{
  682. Border: RectBounds{0, 0, 0, 0},
  683. Paddings: RectBounds{2, 4, 2, 2},
  684. BorderColor: borderColor,
  685. BgColor: math32.Color{0.6, 0.6, 0.6},
  686. FgColor: fgColor,
  687. IconPaddings: RectBounds{0, 6, 0, 4},
  688. ShortcutPaddings: RectBounds{0, 0, 0, 10},
  689. RiconPaddings: RectBounds{2, 0, 0, 4},
  690. },
  691. Disabled: MenuItemStyle{
  692. Border: RectBounds{0, 0, 0, 0},
  693. Paddings: RectBounds{2, 4, 2, 2},
  694. BorderColor: borderColor,
  695. BgColor: bgColor,
  696. FgColor: fgColorDis,
  697. IconPaddings: RectBounds{0, 6, 0, 4},
  698. ShortcutPaddings: RectBounds{0, 0, 0, 10},
  699. RiconPaddings: RectBounds{2, 0, 0, 4},
  700. },
  701. Separator: MenuItemStyle{
  702. Border: RectBounds{2, 2, 2, 2},
  703. Paddings: RectBounds{0, 0, 0, 0},
  704. BorderColor: math32.Color4{0, 0, 0, 0},
  705. BgColor: math32.Color{0.6, 0.6, 0.6},
  706. FgColor: fgColor,
  707. },
  708. },
  709. }
  710. // Table styles
  711. s.Table = TableStyles{
  712. Header: &TableHeaderStyle{
  713. Border: RectBounds{0, 1, 1, 0},
  714. Paddings: RectBounds{2, 2, 2, 2},
  715. BorderColor: borderColor,
  716. BgColor: math32.Color{0.7, 0.7, 0.7},
  717. FgColor: fgColor,
  718. },
  719. RowEven: &TableRowStyle{
  720. Border: RectBounds{0, 1, 1, 0},
  721. Paddings: RectBounds{2, 2, 2, 2},
  722. BorderColor: math32.Color4{0.6, 0.6, 0.6, 1},
  723. BgColor: math32.Color{0.90, 0.90, 0.90},
  724. FgColor: fgColor,
  725. },
  726. RowOdd: &TableRowStyle{
  727. Border: RectBounds{0, 1, 1, 0},
  728. Paddings: RectBounds{2, 2, 2, 2},
  729. BorderColor: math32.Color4{0.6, 0.6, 0.6, 1},
  730. BgColor: math32.Color{0.88, 0.88, 0.88},
  731. FgColor: fgColor,
  732. },
  733. RowCursor: &TableRowStyle{
  734. Border: RectBounds{0, 1, 1, 0},
  735. Paddings: RectBounds{2, 2, 2, 2},
  736. BorderColor: math32.Color4{0.6, 0.6, 0.6, 1},
  737. BgColor: math32.Color{0.75, 0.75, 0.75},
  738. FgColor: fgColor,
  739. },
  740. RowSel: &TableRowStyle{
  741. Border: RectBounds{0, 1, 1, 0},
  742. Paddings: RectBounds{2, 2, 2, 2},
  743. BorderColor: math32.Color4{0.6, 0.6, 0.6, 1},
  744. BgColor: math32.Color{0.70, 0.70, 0.70},
  745. FgColor: fgColor,
  746. },
  747. Status: &TableStatusStyle{
  748. Border: RectBounds{1, 0, 0, 0},
  749. Paddings: RectBounds{2, 2, 2, 2},
  750. BorderColor: borderColor,
  751. BgColor: math32.Color{0.9, 0.9, 0.9},
  752. FgColor: fgColor,
  753. },
  754. Resizer: &TableResizerStyle{
  755. Width: 4,
  756. Border: RectBounds{0, 0, 0, 0},
  757. BorderColor: borderColor,
  758. BgColor: math32.Color4{0.4, 0.4, 0.4, 0.6},
  759. },
  760. }
  761. // Button styles
  762. s.ImageButton = ImageButtonStyles{
  763. Normal: ImageButtonStyle{
  764. Border: borderSizes,
  765. Paddings: RectBounds{0, 0, 0, 0},
  766. BorderColor: borderColor,
  767. BgColor: bgColor4,
  768. FgColor: fgColor,
  769. },
  770. Over: ImageButtonStyle{
  771. Border: borderSizes,
  772. Paddings: RectBounds{0, 0, 0, 0},
  773. BorderColor: borderColor,
  774. BgColor: bgColor4Over,
  775. FgColor: fgColor,
  776. },
  777. Focus: ImageButtonStyle{
  778. Border: borderSizes,
  779. Paddings: RectBounds{0, 0, 0, 0},
  780. BorderColor: borderColor,
  781. BgColor: bgColor4Over,
  782. FgColor: fgColor,
  783. },
  784. Pressed: ImageButtonStyle{
  785. Border: RectBounds{2, 2, 2, 2},
  786. Paddings: RectBounds{0, 0, 0, 0},
  787. BorderColor: borderColor,
  788. BgColor: bgColor4Over,
  789. FgColor: fgColor,
  790. },
  791. Disabled: ImageButtonStyle{
  792. Border: borderSizes,
  793. Paddings: RectBounds{0, 0, 0, 0},
  794. BorderColor: borderColorDis,
  795. BgColor: bgColor4,
  796. FgColor: fgColorDis,
  797. },
  798. }
  799. // TabBar styles
  800. s.TabBar = TabBarStyles{
  801. SepHeight: 1,
  802. ListButtonIcon: icon.MoreVert,
  803. ListButtonPaddings: RectBounds{2, 4, 0, 0},
  804. Normal: TabBarStyle{
  805. Border: borderSizes,
  806. Paddings: RectBounds{2, 0, 0, 0},
  807. BorderColor: borderColor,
  808. BgColor: math32.Color4{0.7, 0.7, 0.7, 1},
  809. },
  810. Over: TabBarStyle{
  811. Border: borderSizes,
  812. Paddings: RectBounds{2, 0, 0, 0},
  813. BorderColor: borderColor,
  814. BgColor: bgColor4Over,
  815. },
  816. Focus: TabBarStyle{
  817. Border: borderSizes,
  818. Paddings: RectBounds{2, 0, 0, 0},
  819. BorderColor: borderColor,
  820. BgColor: bgColor4,
  821. },
  822. Disabled: TabBarStyle{
  823. Border: borderSizes,
  824. Paddings: RectBounds{2, 0, 0, 0},
  825. BorderColor: borderColor,
  826. BgColor: bgColor4,
  827. },
  828. Tab: TabStyles{
  829. IconPaddings: RectBounds{2, 2, 0, 0},
  830. ImagePaddings: RectBounds{0, 2, 0, 0},
  831. IconClose: icon.Clear,
  832. Normal: TabStyle{
  833. Margins: RectBounds{0, 2, 0, 2},
  834. Border: RectBounds{1, 1, 0, 1},
  835. Paddings: RectBounds{2, 2, 2, 2},
  836. BorderColor: borderColor,
  837. BgColor: bgColor4,
  838. FgColor: fgColor,
  839. },
  840. Over: TabStyle{
  841. Margins: RectBounds{0, 2, 0, 2},
  842. Border: RectBounds{1, 1, 0, 1},
  843. Paddings: RectBounds{2, 2, 2, 2},
  844. BorderColor: borderColor,
  845. BgColor: bgColor4Over,
  846. FgColor: fgColor,
  847. },
  848. Focus: TabStyle{
  849. Margins: RectBounds{0, 2, 0, 2},
  850. Border: RectBounds{1, 1, 0, 1},
  851. Paddings: RectBounds{2, 2, 2, 2},
  852. BorderColor: borderColor,
  853. BgColor: bgColor4,
  854. FgColor: fgColor,
  855. },
  856. Disabled: TabStyle{
  857. Margins: RectBounds{0, 2, 0, 2},
  858. Border: RectBounds{1, 1, 0, 1},
  859. Paddings: RectBounds{2, 2, 2, 2},
  860. BorderColor: borderColor,
  861. BgColor: bgColor4,
  862. FgColor: fgColor,
  863. },
  864. Selected: TabStyle{
  865. Margins: RectBounds{0, 2, 0, 2},
  866. Border: RectBounds{1, 1, 0, 1},
  867. Paddings: RectBounds{2, 2, 2, 2},
  868. BorderColor: borderColor,
  869. BgColor: math32.Color4{0.85, 0.85, 0.85, 1},
  870. FgColor: fgColor,
  871. },
  872. },
  873. }
  874. return s
  875. }