MouseOverAnimations.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. using System.Windows.Input;
  2. using static PicView.Fields;
  3. namespace PicView
  4. {
  5. internal static class MouseOverAnimations
  6. {
  7. #region MouseOver Button Events
  8. /*
  9. Adds MouseOver events for the given elements with the AnimationHelper.
  10. Changes color depending on the users settings.
  11. */
  12. // Logo Mouse Over
  13. //internal static void LogoMouseOver(object sender, MouseEventArgs e)
  14. //{
  15. // AnimationHelper.MouseEnterColorEvent(255, 245, 245, 245, pBrush, false);
  16. // AnimationHelper.MouseEnterColorEvent(255, 245, 245, 245, iBrush, false);
  17. // AnimationHelper.MouseEnterColorEvent(255, 245, 245, 245, cBrush, false);
  18. // AnimationHelper.MouseEnterColorEvent(255, 245, 245, 245, vBrush, false);
  19. // AnimationHelper.MouseEnterColorEvent(255, 245, 245, 245, iiBrush, false);
  20. // AnimationHelper.MouseEnterColorEvent(255, 245, 245, 245, eBrush, false);
  21. // AnimationHelper.MouseEnterColorEvent(255, 245, 245, 245, wBrush, false);
  22. //}
  23. //internal static void LogoMouseLeave(object sender, MouseEventArgs e)
  24. //{
  25. // AnimationHelper.MouseLeaveColorEvent(255, 245, 245, 245, pBrush, false);
  26. // AnimationHelper.MouseLeaveColorEvent(255, 245, 245, 245, iBrush, false);
  27. // AnimationHelper.MouseLeaveColorEvent(255, 245, 245, 245, cBrush, false);
  28. // AnimationHelper.MouseLeaveColorEvent(255, 245, 245, 245, vBrush, false);
  29. // AnimationHelper.MouseLeaveColorEvent(255, 245, 245, 245, iiBrush, false);
  30. // AnimationHelper.MouseLeaveColorEvent(255, 245, 245, 245, eBrush, false);
  31. // AnimationHelper.MouseLeaveColorEvent(255, 245, 245, 245, wBrush, false);
  32. //}
  33. //internal static void LogoMouseButtonDown(object sender, MouseButtonEventArgs e)
  34. //{
  35. // AnimationHelper.PreviewMouseLeftButtonDownColorEvent(pBrush, false);
  36. // AnimationHelper.PreviewMouseLeftButtonDownColorEvent(iBrush, false);
  37. // AnimationHelper.PreviewMouseLeftButtonDownColorEvent(cBrush, false);
  38. // AnimationHelper.PreviewMouseLeftButtonDownColorEvent(vBrush, false);
  39. // AnimationHelper.PreviewMouseLeftButtonDownColorEvent(iiBrush, false);
  40. // AnimationHelper.PreviewMouseLeftButtonDownColorEvent(eBrush, false);
  41. // AnimationHelper.PreviewMouseLeftButtonDownColorEvent(wBrush, false);
  42. //}
  43. // Close Button
  44. internal static void CloseButtonMouseOver(object sender, MouseEventArgs e)
  45. {
  46. AnimationHelper.MouseEnterColorEvent(0, 0, 0, 0, mainWindow.CloseButtonBrush, false);
  47. }
  48. internal static void CloseButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
  49. {
  50. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.CloseButtonBrush, false);
  51. }
  52. internal static void CloseButtonMouseLeave(object sender, MouseEventArgs e)
  53. {
  54. AnimationHelper.MouseLeaveColorEvent(0, 0, 0, 0, mainWindow.CloseButtonBrush, false);
  55. }
  56. // MaxButton
  57. internal static void MaxButtonMouseOver(object sender, MouseEventArgs e)
  58. {
  59. AnimationHelper.MouseEnterColorEvent(0, 0, 0, 0, mainWindow.MaxButtonBrush, false);
  60. }
  61. internal static void MaxButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
  62. {
  63. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.MaxButtonBrush, false);
  64. }
  65. internal static void MaxButtonMouseLeave(object sender, MouseEventArgs e)
  66. {
  67. AnimationHelper.MouseLeaveColorEvent(0, 0, 0, 0, mainWindow.MaxButtonBrush, false);
  68. }
  69. // MinButton
  70. internal static void MinButtonMouseOver(object sender, MouseEventArgs e)
  71. {
  72. AnimationHelper.MouseEnterColorEvent(0, 0, 0, 0, mainWindow.MinButtonBrush, false);
  73. }
  74. internal static void MinButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
  75. {
  76. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.MinButtonBrush, false);
  77. }
  78. internal static void MinButtonMouseLeave(object sender, MouseEventArgs e)
  79. {
  80. AnimationHelper.MouseLeaveColorEvent(0, 0, 0, 0, mainWindow.MinButtonBrush, false);
  81. }
  82. // LeftButton
  83. internal static void LeftButtonMouseOver(object sender, MouseEventArgs e)
  84. {
  85. AnimationHelper.MouseEnterColorEvent(
  86. mainColor.A,
  87. mainColor.R,
  88. mainColor.G,
  89. mainColor.B,
  90. mainWindow.LeftArrowFill,
  91. false
  92. );
  93. }
  94. internal static void LeftButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
  95. {
  96. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.LeftArrowFill, false);
  97. }
  98. internal static void LeftButtonMouseLeave(object sender, MouseEventArgs e)
  99. {
  100. AnimationHelper.MouseLeaveColorEvent(
  101. mainColor.A,
  102. mainColor.R,
  103. mainColor.G,
  104. mainColor.B,
  105. mainWindow.LeftArrowFill,
  106. false
  107. );
  108. }
  109. // RightButton
  110. internal static void RightButtonMouseOver(object sender, MouseEventArgs e)
  111. {
  112. AnimationHelper.MouseEnterColorEvent(
  113. mainColor.A,
  114. mainColor.R,
  115. mainColor.G,
  116. mainColor.B,
  117. mainWindow.RightArrowFill,
  118. false
  119. );
  120. }
  121. internal static void RightButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
  122. {
  123. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.RightArrowFill, false);
  124. }
  125. internal static void RightButtonMouseLeave(object sender, MouseEventArgs e)
  126. {
  127. AnimationHelper.MouseLeaveColorEvent(
  128. mainColor.A,
  129. mainColor.R,
  130. mainColor.G,
  131. mainColor.B,
  132. mainWindow.RightArrowFill,
  133. false
  134. );
  135. }
  136. // OpenMenuButton
  137. internal static void OpenMenuButtonMouseOver(object sender, MouseEventArgs e)
  138. {
  139. AnimationHelper.MouseEnterColorEvent(
  140. mainColor.A,
  141. mainColor.R,
  142. mainColor.G,
  143. mainColor.B,
  144. mainWindow.FolderFill,
  145. false
  146. );
  147. }
  148. internal static void OpenMenuButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
  149. {
  150. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.FolderFill, false);
  151. }
  152. internal static void OpenMenuButtonMouseLeave(object sender, MouseEventArgs e)
  153. {
  154. AnimationHelper.MouseLeaveColorEvent(
  155. mainColor.A,
  156. mainColor.R,
  157. mainColor.G,
  158. mainColor.B,
  159. mainWindow.FolderFill,
  160. false
  161. );
  162. }
  163. // ImageButton
  164. internal static void ImageButtonMouseOver(object sender, MouseEventArgs e)
  165. {
  166. AnimationHelper.MouseEnterColorEvent(
  167. mainColor.A,
  168. mainColor.R,
  169. mainColor.G,
  170. mainColor.B,
  171. mainWindow.ImagePath1Fill,
  172. false
  173. );
  174. AnimationHelper.MouseEnterColorEvent(
  175. mainColor.A,
  176. mainColor.R,
  177. mainColor.G,
  178. mainColor.B,
  179. mainWindow.ImagePath2Fill,
  180. false
  181. );
  182. AnimationHelper.MouseEnterColorEvent(
  183. mainColor.A,
  184. mainColor.R,
  185. mainColor.G,
  186. mainColor.B,
  187. mainWindow.ImagePath3Fill,
  188. false
  189. );
  190. //AnimationHelper.MouseEnterColorEvent(
  191. // mainColor.A,
  192. // mainColor.R,
  193. // mainColor.G,
  194. // mainColor.B,
  195. // ImagePath4Fill,
  196. // false
  197. //);
  198. }
  199. internal static void ImageButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
  200. {
  201. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.ImagePath1Fill, false);
  202. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.ImagePath2Fill, false);
  203. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.ImagePath3Fill, false);
  204. //AnimationHelper.PreviewMouseLeftButtonDownColorEvent(ImagePath4Fill, false);
  205. }
  206. internal static void ImageButtonMouseLeave(object sender, MouseEventArgs e)
  207. {
  208. AnimationHelper.MouseLeaveColorEvent(
  209. mainColor.A,
  210. mainColor.R,
  211. mainColor.G,
  212. mainColor.B,
  213. mainWindow.ImagePath1Fill,
  214. false
  215. );
  216. AnimationHelper.MouseLeaveColorEvent(
  217. mainColor.A,
  218. mainColor.R,
  219. mainColor.G,
  220. mainColor.B,
  221. mainWindow.ImagePath2Fill,
  222. false
  223. );
  224. AnimationHelper.MouseLeaveColorEvent(
  225. mainColor.A,
  226. mainColor.R,
  227. mainColor.G,
  228. mainColor.B,
  229. mainWindow.ImagePath3Fill,
  230. false
  231. );
  232. //AnimationHelper.MouseLeaveColorEvent(
  233. // mainColor.A,
  234. // mainColor.R,
  235. // mainColor.G,
  236. // mainColor.B,
  237. // ImagePath4Fill,
  238. // false
  239. //);
  240. }
  241. // SettingsButton
  242. internal static void SettingsButtonButtonMouseOver(object sender, MouseEventArgs e)
  243. {
  244. AnimationHelper.MouseEnterColorEvent(
  245. mainColor.A,
  246. mainColor.R,
  247. mainColor.G,
  248. mainColor.B,
  249. mainWindow.SettingsButtonFill,
  250. false
  251. );
  252. }
  253. internal static void SettingsButtonButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
  254. {
  255. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.SettingsButtonFill, false);
  256. }
  257. internal static void SettingsButtonButtonMouseLeave(object sender, MouseEventArgs e)
  258. {
  259. AnimationHelper.MouseLeaveColorEvent(
  260. mainColor.A,
  261. mainColor.R,
  262. mainColor.G,
  263. mainColor.B,
  264. mainWindow.SettingsButtonFill,
  265. false
  266. );
  267. }
  268. // FunctionMenu
  269. internal static void FunctionMenuButtonButtonMouseOver(object sender, MouseEventArgs e)
  270. {
  271. AnimationHelper.MouseEnterColorEvent(
  272. mainColor.A,
  273. mainColor.R,
  274. mainColor.G,
  275. mainColor.B,
  276. mainWindow.QuestionButtonFill1,
  277. false
  278. );
  279. }
  280. internal static void FunctionMenuButtonButtonMouseButtonDown(object sender, MouseButtonEventArgs e)
  281. {
  282. AnimationHelper.PreviewMouseLeftButtonDownColorEvent(mainWindow.QuestionButtonFill1, false);
  283. }
  284. internal static void FunctionMenuButtonButtonMouseLeave(object sender, MouseEventArgs e)
  285. {
  286. AnimationHelper.MouseLeaveColorEvent(
  287. mainColor.A,
  288. mainColor.R,
  289. mainColor.G,
  290. mainColor.B,
  291. mainWindow.QuestionButtonFill1,
  292. false
  293. );
  294. }
  295. #endregion MouseOver Button Events
  296. }
  297. }