Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

theme.cpp 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. /*
  2. * PatchBay Canvas Themes
  3. * Copyright (C) 2010-2019 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #include "theme.hpp"
  18. //---------------------------------------------------------------------------------------------------------------------
  19. // Imports (Global)
  20. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  21. # pragma GCC diagnostic push
  22. # pragma GCC diagnostic ignored "-Wconversion"
  23. # pragma GCC diagnostic ignored "-Weffc++"
  24. # pragma GCC diagnostic ignored "-Wsign-conversion"
  25. #endif
  26. #include <QtGui/QColor>
  27. #include <QtGui/QFont>
  28. #include <QtGui/QPen>
  29. #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  30. # pragma GCC diagnostic pop
  31. #endif
  32. //---------------------------------------------------------------------------------------------------------------------
  33. struct Theme::PrivateData {
  34. const Theme::List idx;
  35. // Canvas
  36. QColor canvas_bg;
  37. // Boxes
  38. QPen box_pen;
  39. QPen box_pen_sel;
  40. QColor box_bg_1;
  41. QColor box_bg_2;
  42. QColor box_shadow;
  43. // box_header_pixmap
  44. int box_header_height;
  45. int box_header_spacing;
  46. QPen box_text;
  47. QPen box_text_sel;
  48. int box_text_ypos;
  49. QString box_font_name;
  50. int box_font_size;
  51. QFont::Weight box_font_state;
  52. BackgroundType box_bg_type;
  53. bool box_use_icon;
  54. // Ports
  55. QPen port_text;
  56. int port_text_ypos;
  57. // port_bg_pixmap = None;
  58. QString port_font_name;
  59. int port_font_size;
  60. QFont::Weight port_font_state;
  61. PortType port_mode;
  62. QPen port_audio_jack_pen;
  63. QPen port_audio_jack_pen_sel;
  64. QPen port_midi_jack_pen;
  65. QPen port_midi_jack_pen_sel;
  66. QPen port_midi_alsa_pen;
  67. QPen port_midi_alsa_pen_sel;
  68. QPen port_parameter_pen;
  69. QPen port_parameter_pen_sel;
  70. QColor port_audio_jack_bg;
  71. QColor port_audio_jack_bg_sel;
  72. QColor port_midi_jack_bg;
  73. QColor port_midi_jack_bg_sel;
  74. QColor port_midi_alsa_bg;
  75. QColor port_midi_alsa_bg_sel;
  76. QColor port_parameter_bg;
  77. QColor port_parameter_bg_sel;
  78. QColor port_audio_jack_text;
  79. QColor port_audio_jack_text_sel;
  80. QColor port_midi_jack_text;
  81. QColor port_midi_jack_text_sel;
  82. QColor port_midi_alsa_text;
  83. QColor port_midi_alsa_text_sel;
  84. QColor port_parameter_text;
  85. QColor port_parameter_text_sel;
  86. int port_height;
  87. int port_offset;
  88. int port_spacing;
  89. int port_spacingT;
  90. // Lines
  91. QColor line_audio_jack;
  92. QColor line_audio_jack_sel;
  93. QColor line_audio_jack_glow;
  94. QColor line_midi_jack;
  95. QColor line_midi_jack_sel;
  96. QColor line_midi_jack_glow;
  97. QColor line_midi_alsa;
  98. QColor line_midi_alsa_sel;
  99. QColor line_midi_alsa_glow;
  100. QColor line_parameter;
  101. QColor line_parameter_sel;
  102. QColor line_parameter_glow;
  103. QPen rubberband_pen;
  104. QColor rubberband_brush;
  105. //-----------------------------------------------------------------------------------------------------------------
  106. PrivateData(const Theme::List id)
  107. : idx(id),
  108. canvas_bg(),
  109. box_pen(),
  110. box_pen_sel(),
  111. box_bg_1(),
  112. box_bg_2(),
  113. box_shadow(),
  114. box_header_height(),
  115. box_header_spacing(),
  116. box_text(),
  117. box_text_sel(),
  118. box_text_ypos(),
  119. box_font_name(),
  120. box_font_size(),
  121. box_font_state(),
  122. box_bg_type(),
  123. box_use_icon(),
  124. port_text(),
  125. port_text_ypos(),
  126. port_font_name(),
  127. port_font_size(),
  128. port_font_state(),
  129. port_mode(),
  130. port_audio_jack_pen(),
  131. port_audio_jack_pen_sel(),
  132. port_midi_jack_pen(),
  133. port_midi_jack_pen_sel(),
  134. port_midi_alsa_pen(),
  135. port_midi_alsa_pen_sel(),
  136. port_parameter_pen(),
  137. port_parameter_pen_sel(),
  138. port_audio_jack_bg(),
  139. port_audio_jack_bg_sel(),
  140. port_midi_jack_bg(),
  141. port_midi_jack_bg_sel(),
  142. port_midi_alsa_bg(),
  143. port_midi_alsa_bg_sel(),
  144. port_parameter_bg(),
  145. port_parameter_bg_sel(),
  146. port_audio_jack_text(),
  147. port_audio_jack_text_sel(),
  148. port_midi_jack_text(),
  149. port_midi_jack_text_sel(),
  150. port_midi_alsa_text(),
  151. port_midi_alsa_text_sel(),
  152. port_parameter_text(),
  153. port_parameter_text_sel(),
  154. port_height(),
  155. port_offset(),
  156. port_spacing(),
  157. port_spacingT(),
  158. line_audio_jack(),
  159. line_audio_jack_sel(),
  160. line_audio_jack_glow(),
  161. line_midi_jack(),
  162. line_midi_jack_sel(),
  163. line_midi_jack_glow(),
  164. line_midi_alsa(),
  165. line_midi_alsa_sel(),
  166. line_midi_alsa_glow(),
  167. line_parameter(),
  168. line_parameter_sel(),
  169. line_parameter_glow(),
  170. rubberband_pen(),
  171. rubberband_brush()
  172. {
  173. switch (idx)
  174. {
  175. case THEME_MODERN_DARK:
  176. // Canvas
  177. canvas_bg = QColor(0, 0, 0);
  178. // Boxes
  179. box_pen = QPen(QColor(76, 77, 78), 1, Qt::SolidLine);
  180. box_pen_sel = QPen(QColor(206, 207, 208), 1, Qt::DashLine);
  181. box_bg_1 = QColor(32, 34, 35);
  182. box_bg_2 = QColor(43, 47, 48);
  183. box_shadow = QColor(89, 89, 89, 180);
  184. // box_header_pixmap = None;
  185. box_header_height = 24;
  186. box_header_spacing = 0;
  187. box_text = QPen(QColor(240, 240, 240), 0);
  188. box_text_sel = box_text;
  189. box_text_ypos = 16;
  190. box_font_name = "Deja Vu Sans";
  191. box_font_size = 11;
  192. box_font_state = QFont::Bold;
  193. box_bg_type = THEME_BG_GRADIENT;
  194. box_use_icon = true;
  195. // Ports
  196. port_text = QPen(QColor(250, 250, 250), 0);
  197. port_text_ypos = 12;
  198. // port_bg_pixmap = None;
  199. port_font_name = "Deja Vu Sans";
  200. port_font_size = 11;
  201. port_font_state = QFont::Normal;
  202. port_mode = THEME_PORT_POLYGON;
  203. port_audio_jack_pen = QPen(QColor(63, 90, 126), 1);
  204. port_audio_jack_pen_sel = QPen(QColor(63 + 30, 90 + 30, 126 + 30), 1);
  205. port_midi_jack_pen = QPen(QColor(159, 44, 42), 1);
  206. port_midi_jack_pen_sel = QPen(QColor(159 + 30, 44 + 30, 42 + 30), 1);
  207. port_midi_alsa_pen = QPen(QColor(93, 141, 46), 1);
  208. port_midi_alsa_pen_sel = QPen(QColor(93 + 30, 141 + 30, 46 + 30), 1);
  209. port_parameter_pen = QPen(QColor(137, 76, 43), 1);
  210. port_parameter_pen_sel = QPen(QColor(137 + 30, 76 + 30, 43 + 30), 1);
  211. port_audio_jack_bg = QColor(35, 61, 99);
  212. port_audio_jack_bg_sel = QColor(35 + 50, 61 + 50, 99 + 50);
  213. port_midi_jack_bg = QColor(120, 15, 16);
  214. port_midi_jack_bg_sel = QColor(120 + 50, 15 + 50, 16 + 50);
  215. port_midi_alsa_bg = QColor(64, 112, 18);
  216. port_midi_alsa_bg_sel = QColor(64 + 50, 112 + 50, 18 + 50);
  217. port_parameter_bg = QColor(101, 47, 16);
  218. port_parameter_bg_sel = QColor(101 + 50, 47 + 50, 16 + 50);
  219. /*
  220. port_audio_jack_text = port_text;
  221. port_audio_jack_text_sel = port_text;
  222. port_midi_jack_text = port_text;
  223. port_midi_jack_text_sel = port_text;
  224. port_midi_alsa_text = port_text;
  225. port_midi_alsa_text_sel = port_text;
  226. port_parameter_text = port_text;
  227. port_parameter_text_sel = port_text;
  228. */
  229. port_height = 16;
  230. port_offset = 0;
  231. port_spacing = 2;
  232. port_spacingT = 2;
  233. // Lines
  234. line_audio_jack = QColor(63, 90, 126);
  235. line_audio_jack_sel = QColor(63 + 90, 90 + 90, 126 + 90);
  236. line_audio_jack_glow = QColor(100, 100, 200);
  237. line_midi_jack = QColor(159, 44, 42);
  238. line_midi_jack_sel = QColor(159 + 90, 44 + 90, 42 + 90);
  239. line_midi_jack_glow = QColor(200, 100, 100);
  240. line_midi_alsa = QColor(93, 141, 46);
  241. line_midi_alsa_sel = QColor(93 + 90, 141 + 90, 46 + 90);
  242. line_midi_alsa_glow = QColor(100, 200, 100);
  243. line_parameter = QColor(137, 76, 43);
  244. line_parameter_sel = QColor(137 + 90, 76 + 90, 43 + 90);
  245. line_parameter_glow = QColor(166, 133, 133);
  246. rubberband_pen = QPen(QColor(206, 207, 208), 1, Qt::SolidLine);
  247. rubberband_brush = QColor(76, 77, 78, 100);
  248. break;
  249. #if 0
  250. elif idx == THEME_MODERN_DARK_TINY:
  251. # Canvas
  252. canvas_bg = QColor(0, 0, 0)
  253. # Boxes
  254. box_pen = QPen(QColor(76, 77, 78), 1, Qt::SolidLine)
  255. box_pen_sel = QPen(QColor(206, 207, 208), 1, Qt::DashLine)
  256. box_bg_1 = QColor(32, 34, 35)
  257. box_bg_2 = QColor(43, 47, 48)
  258. box_shadow = QColor(89, 89, 89, 180)
  259. box_header_pixmap = None
  260. box_header_height = 14
  261. box_header_spacing = 0
  262. box_text = QPen(QColor(240, 240, 240), 0)
  263. box_text_sel = ox_text
  264. box_text_ypos = 10
  265. box_font_name = "Deja Vu Sans"
  266. box_font_size = 10
  267. box_font_state = QFont::Bold
  268. box_bg_type = THEME_BG_GRADIENT
  269. box_use_icon = false
  270. # Ports
  271. port_text = QPen(QColor(250, 250, 250), 0)
  272. port_text_ypos = 9
  273. port_bg_pixmap = None
  274. port_font_name = "Deja Vu Sans"
  275. port_font_size = 9
  276. port_font_state = QFont::Normal
  277. port_mode = THEME_PORT_POLYGON
  278. port_audio_jack_pen = QPen(QColor(63, 90, 126), 1)
  279. port_audio_jack_pen_sel = QPen(QColor(63 + 30, 90 + 30, 126 + 30), 1)
  280. port_midi_jack_pen = QPen(QColor(159, 44, 42), 1)
  281. port_midi_jack_pen_sel = QPen(QColor(159 + 30, 44 + 30, 42 + 30), 1)
  282. port_midi_alsa_pen = QPen(QColor(93, 141, 46), 1)
  283. port_midi_alsa_pen_sel = QPen(QColor(93 + 30, 141 + 30, 46 + 30), 1)
  284. port_parameter_pen = QPen(QColor(137, 76, 43), 1)
  285. port_parameter_pen_sel = QPen(QColor(137 + 30, 76 + 30, 43 + 30), 1)
  286. port_audio_jack_bg = QColor(35, 61, 99)
  287. port_audio_jack_bg_sel = QColor(35 + 50, 61 + 50, 99 + 50)
  288. port_midi_jack_bg = QColor(120, 15, 16)
  289. port_midi_jack_bg_sel = QColor(120 + 50, 15 + 50, 16 + 50)
  290. port_midi_alsa_bg = QColor(64, 112, 18)
  291. port_midi_alsa_bg_sel = QColor(64 + 50, 112 + 50, 18 + 50)
  292. port_parameter_bg = QColor(101, 47, 16)
  293. port_parameter_bg_sel = QColor(101 + 50, 47 + 50, 16 + 50)
  294. port_audio_jack_text = port_text
  295. port_audio_jack_text_sel = port_text
  296. port_midi_jack_text = port_text
  297. port_midi_jack_text_sel = port_text
  298. port_midi_alsa_text = port_text
  299. port_midi_alsa_text_sel = port_text
  300. port_parameter_text = port_text
  301. port_parameter_text_sel = port_text
  302. port_height = 12
  303. port_offset = 0
  304. port_spacing = 1
  305. port_spacingT = 1
  306. # Lines
  307. line_audio_jack = QColor(63, 90, 126)
  308. line_audio_jack_sel = QColor(63 + 90, 90 + 90, 126 + 90)
  309. line_audio_jack_glow = QColor(100, 100, 200)
  310. line_midi_jack = QColor(159, 44, 42)
  311. line_midi_jack_sel = QColor(159 + 90, 44 + 90, 42 + 90)
  312. line_midi_jack_glow = QColor(200, 100, 100)
  313. line_midi_alsa = QColor(93, 141, 46)
  314. line_midi_alsa_sel = QColor(93 + 90, 141 + 90, 46 + 90)
  315. line_midi_alsa_glow = QColor(100, 200, 100)
  316. line_parameter = QColor(137, 76, 43)
  317. line_parameter_sel = QColor(137 + 90, 76 + 90, 43 + 90)
  318. line_parameter_glow = QColor(166, 133, 133)
  319. rubberband_pen = QPen(QColor(206, 207, 208), 1, Qt::SolidLine)
  320. rubberband_brush = QColor(76, 77, 78, 100)
  321. elif idx == THEME_MODERN_LIGHT:
  322. # Canvas
  323. canvas_bg = QColor(248, 249, 250)
  324. # Boxes
  325. box_pen = QPen(QColor(176, 177, 178), 1, Qt::SolidLine)
  326. box_pen_sel = QPen(QColor(1, 2, 3), 2, Qt::DashLine)
  327. box_bg_1 = QColor(250, 250, 250)
  328. box_bg_2 = QColor(200, 200, 200)
  329. box_shadow = QColor(1, 1, 1, 100)
  330. box_header_pixmap = None
  331. box_header_height = 24
  332. box_header_spacing = 0
  333. box_text = QPen(QColor(1, 1, 1), 0)
  334. box_text_sel = ox_text
  335. box_text_ypos = 16
  336. box_font_name = "Ubuntu"
  337. box_font_size = 11
  338. box_font_state = QFont::Bold
  339. box_bg_type = THEME_BG_GRADIENT
  340. box_use_icon = True
  341. # Ports
  342. port_text = QPen(QColor(255, 255, 255), 1)
  343. port_text_ypos = 12
  344. port_bg_pixmap = None
  345. port_font_name = "Ubuntu"
  346. port_font_size = 11
  347. port_font_state = QFont::Bold
  348. port_mode = THEME_PORT_POLYGON
  349. port_audio_jack_pen = QPen(QColor(103, 130, 166), 2)
  350. port_audio_jack_pen_sel = QPen(QColor(103 + 136, 190 + 130, 226 + 130), 1)
  351. port_midi_jack_pen = QPen(QColor(159, 44, 42), 1)
  352. port_midi_jack_pen_sel = QPen(QColor(90 + 30, 44 + 30, 42 + 30), 1)
  353. port_midi_alsa_pen = QPen(QColor(93, 141, 46), 1)
  354. port_midi_alsa_pen_sel = QPen(QColor(93 + 30, 141 + 30, 46 + 30), 1)
  355. port_parameter_pen = QPen(QColor(137, 76, 43), 1)
  356. port_parameter_pen_sel = QPen(QColor(137 + 30, 76 + 30, 43 + 30), 1)
  357. port_audio_jack_bg = QColor(0, 0, 180)
  358. port_audio_jack_bg_sel = QColor(135 + 150, 161 + 150, 199 + 150)
  359. port_midi_jack_bg = QColor(130, 15, 16)
  360. port_midi_jack_bg_sel = QColor(90 + 30, 15 + 50, 16 + 50)
  361. port_midi_alsa_bg = QColor(64, 112, 18)
  362. port_midi_alsa_bg_sel = QColor(64 + 50, 112 + 50, 18 + 50)
  363. port_parameter_bg = QColor(101, 47, 16)
  364. port_parameter_bg_sel = QColor(101 + 50, 47 + 50, 16 + 50)
  365. port_audio_jack_text = port_text
  366. port_audio_jack_text_sel = port_text
  367. port_midi_jack_text = port_text
  368. port_midi_jack_text_sel = port_text
  369. port_midi_alsa_text = port_text
  370. port_midi_alsa_text_sel = port_text
  371. port_parameter_text = port_text
  372. port_parameter_text_sel = port_text
  373. port_height = 16
  374. port_offset = 0
  375. port_spacing = 2
  376. port_spacingT = 2
  377. # Lines
  378. line_audio_jack = QColor(63, 90, 126)
  379. line_audio_jack_sel = QColor(63 + 63, 90 + 90, 126 + 90)
  380. line_audio_jack_glow = QColor(100, 100, 200)
  381. line_midi_jack = QColor(159, 44, 42)
  382. line_midi_jack_sel = QColor(159 + 44, 44 + 90, 42 + 90)
  383. line_midi_jack_glow = QColor(200, 100, 100)
  384. line_midi_alsa = QColor(93, 141, 46)
  385. line_midi_alsa_sel = QColor(93 + 90, 141 + 90, 46 + 90)
  386. line_midi_alsa_glow = QColor(100, 200, 100)
  387. line_parameter = QColor(137, 43, 43)
  388. line_parameter_sel = QColor(137 + 90, 76 + 90, 43 + 90)
  389. line_parameter_glow = QColor(166, 133, 133)
  390. rubberband_pen = QPen(QColor(206, 207, 208), 1, Qt::SolidLine)
  391. rubberband_brush = QColor(76, 77, 78, 100)
  392. elif idx == THEME_CLASSIC_DARK:
  393. # Canvas
  394. canvas_bg = QColor(0, 0, 0)
  395. # Boxes
  396. box_pen = QPen(QColor(147 - 70, 151 - 70, 143 - 70), 2, Qt::SolidLine)
  397. box_pen_sel = QPen(QColor(147, 151, 143), 2, Qt::DashLine)
  398. box_bg_1 = QColor(30, 34, 36)
  399. box_bg_2 = QColor(30, 34, 36)
  400. box_shadow = QColor(89, 89, 89, 180)
  401. box_header_pixmap = None
  402. box_header_height = 19
  403. box_header_spacing = 0
  404. box_text = QPen(QColor(255, 255, 255), 0)
  405. box_text_sel = ox_text
  406. box_text_ypos = 12
  407. box_font_name = "Sans"
  408. box_font_size = 12
  409. box_font_state = QFont::Normal
  410. box_bg_type = THEME_BG_GRADIENT
  411. box_use_icon = false
  412. # Ports
  413. port_text = QPen(QColor(250, 250, 250), 0)
  414. port_text_ypos = 11
  415. port_bg_pixmap = None
  416. port_font_name = "Sans"
  417. port_font_size = 11
  418. port_font_state = QFont::Normal
  419. port_mode = THEME_PORT_SQUARE
  420. port_audio_jack_pen = QPen(QColor(35, 61, 99), Qt::NoPen, 0)
  421. port_audio_jack_pen_sel = QPen(QColor(255, 0, 0), Qt::NoPen, 0)
  422. port_midi_jack_pen = QPen(QColor(120, 15, 16), Qt::NoPen, 0)
  423. port_midi_jack_pen_sel = QPen(QColor(255, 0, 0), Qt::NoPen, 0)
  424. port_midi_alsa_pen = QPen(QColor(63, 112, 19), Qt::NoPen, 0)
  425. port_midi_alsa_pen_sel = QPen(QColor(255, 0, 0), Qt::NoPen, 0)
  426. port_parameter_pen = QPen(QColor(101, 47, 17), Qt::NoPen, 0)
  427. port_parameter_pen_sel = QPen(QColor(255, 0, 0), Qt::NoPen, 0)
  428. port_audio_jack_bg = QColor(35, 61, 99)
  429. port_audio_jack_bg_sel = QColor(255, 0, 0)
  430. port_midi_jack_bg = QColor(120, 15, 16)
  431. port_midi_jack_bg_sel = QColor(255, 0, 0)
  432. port_midi_alsa_bg = QColor(63, 112, 19)
  433. port_midi_alsa_bg_sel = QColor(255, 0, 0)
  434. port_parameter_bg = QColor(101, 47, 17)
  435. port_parameter_bg_sel = QColor(255, 0, 0)
  436. port_audio_jack_text = port_text
  437. port_audio_jack_text_sel = port_text
  438. port_midi_jack_text = port_text
  439. port_midi_jack_text_sel = port_text
  440. port_midi_alsa_text = port_text
  441. port_midi_alsa_text_sel = port_text
  442. port_parameter_text = port_text
  443. port_parameter_text_sel = port_text
  444. port_height = 14
  445. port_offset = 0
  446. port_spacing = 1
  447. port_spacingT = 0
  448. # Lines
  449. line_audio_jack = QColor(53, 78, 116)
  450. line_audio_jack_sel = QColor(255, 0, 0)
  451. line_audio_jack_glow = QColor(255, 0, 0)
  452. line_midi_jack = QColor(139, 32, 32)
  453. line_midi_jack_sel = QColor(255, 0, 0)
  454. line_midi_jack_glow = QColor(255, 0, 0)
  455. line_midi_alsa = QColor(81, 130, 36)
  456. line_midi_alsa_sel = QColor(255, 0, 0)
  457. line_midi_alsa_glow = QColor(255, 0, 0)
  458. line_parameter = QColor(120, 65, 33)
  459. line_parameter_sel = QColor(255, 0, 0)
  460. line_parameter_glow = QColor(255, 0, 0)
  461. rubberband_pen = QPen(QColor(147, 151, 143), 2, Qt::SolidLine)
  462. rubberband_brush = QColor(35, 61, 99, 100)
  463. elif idx == THEME_OOSTUDIO:
  464. # Canvas
  465. canvas_bg = QColor(11, 11, 11)
  466. # Boxes
  467. box_pen = QPen(QColor(76, 77, 78), 1, Qt::SolidLine)
  468. box_pen_sel = QPen(QColor(189, 122, 214), 1, Qt::DashLine)
  469. box_bg_1 = QColor(46, 46, 46)
  470. box_bg_2 = QColor(23, 23, 23)
  471. box_shadow = QColor(89, 89, 89, 180)
  472. box_header_pixmap = QPixmap(":/bitmaps/canvas/frame_node_header.png")
  473. box_header_height = 22
  474. box_header_spacing = 6
  475. box_text = QPen(QColor(144, 144, 144), 0)
  476. box_text_sel = QPen(QColor(189, 122, 214), 0)
  477. box_text_ypos = 16
  478. box_font_name = "Deja Vu Sans"
  479. box_font_size = 11
  480. box_font_state = QFont::Bold
  481. box_bg_type = THEME_BG_SOLID
  482. box_use_icon = false
  483. # Ports
  484. normalPortBG = QColor(46, 46, 46)
  485. selPortBG = QColor(23, 23, 23)
  486. port_text = QPen(QColor(155, 155, 155), 0)
  487. port_text_ypos = 14
  488. port_bg_pixmap = QPixmap(":/bitmaps/canvas/frame_port_bg.png")
  489. port_font_name = "Deja Vu Sans"
  490. port_font_size = 11
  491. port_font_state = QFont::Normal
  492. port_mode = THEME_PORT_SQUARE
  493. port_audio_jack_pen = QPen(selPortBG, 2)
  494. port_audio_jack_pen_sel = QPen(QColor(1, 230, 238), 1)
  495. port_midi_jack_pen = QPen(selPortBG, 2)
  496. port_midi_jack_pen_sel = QPen(QColor(252, 118, 118), 1)
  497. port_midi_alsa_pen = QPen(selPortBG, 2)
  498. port_midi_alsa_pen_sel = QPen(QColor(129, 244, 118), 0)
  499. port_parameter_pen = QPen(selPortBG, 2)
  500. port_parameter_pen_sel = QPen(QColor(137, 76, 43), 1)
  501. port_audio_jack_bg = normalPortBG
  502. port_audio_jack_bg_sel = selPortBG
  503. port_midi_jack_bg = normalPortBG
  504. port_midi_jack_bg_sel = selPortBG
  505. port_midi_alsa_bg = normalPortBG
  506. port_midi_alsa_bg_sel = selPortBG
  507. port_parameter_bg = normalPortBG
  508. port_parameter_bg_sel = selPortBG
  509. port_audio_jack_text = port_text
  510. port_audio_jack_text_sel = port_audio_jack_pen_sel
  511. port_midi_jack_text = port_text
  512. port_midi_jack_text_sel = port_midi_jack_pen_sel
  513. port_midi_alsa_text = port_text
  514. port_midi_alsa_text_sel = port_midi_alsa_pen_sel
  515. port_parameter_text = port_text
  516. port_parameter_text_sel = port_parameter_pen_sel
  517. # missing, ports 2
  518. port_height = 21
  519. port_offset = 1
  520. port_spacing = 3
  521. port_spacingT = 0
  522. # Lines
  523. line_audio_jack = QColor(64, 64, 64)
  524. line_audio_jack_sel = QColor(1, 230, 238)
  525. line_audio_jack_glow = QColor(100, 200, 100)
  526. line_midi_jack = QColor(64, 64, 64)
  527. line_midi_jack_sel = QColor(252, 118, 118)
  528. line_midi_jack_glow = QColor(200, 100, 100)
  529. line_midi_alsa = QColor(64, 64, 64)
  530. line_midi_alsa_sel = QColor(129, 244, 118)
  531. line_midi_alsa_glow = QColor(100, 200, 100)
  532. line_parameter = QColor(64, 64, 64)
  533. line_parameter_sel = QColor(137+90, 76+90, 43+90)
  534. line_parameter_glow = QColor(166, 133, 133)
  535. rubberband_pen = QPen(QColor(1, 230, 238), 2, Qt::SolidLine)
  536. rubberband_brush = QColor(90, 90, 90, 100)
  537. #endif
  538. default:
  539. break;
  540. }
  541. }
  542. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData)
  543. };
  544. //---------------------------------------------------------------------------------------------------------------------
  545. Theme::Theme(const Theme::List idx)
  546. : self(new PrivateData(idx)) {}
  547. Theme::~Theme()
  548. {
  549. delete self;
  550. }
  551. //---------------------------------------------------------------------------------------------------------------------