_treeviews.scss 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /**************
  2. * Tree Views *
  3. **************/
  4. treeview.view {
  5. border-left-color: mix($fg_color, $base_color, 50%); // this is actually the tree lines color,
  6. border-top-color: $bg_color; // while this is the grid lines color, better then nothing
  7. rubberband { @extend rubberband; } // to avoid borders being overridden by the previously set props
  8. &:selected {
  9. &:focus, & {
  10. border-radius: 0;
  11. @extend %selected_items;
  12. }
  13. &:backdrop, & {
  14. border-left-color: mix($selected_fg_color, $selected_bg_color, 50%);
  15. border-top-color: transparentize($fg_color, 0.9); // doesn't work unfortunatelly
  16. }
  17. }
  18. &:disabled {
  19. color: $insensitive_fg_color;
  20. &:selected {
  21. color: mix($selected_fg_color, $selected_bg_color, 40%);
  22. &:backdrop { color: mix($backdrop_selected_fg_color, $selected_bg_color, 30%); }
  23. }
  24. &:backdrop { color: $backdrop_insensitive_color; }
  25. }
  26. &.separator {
  27. min-height: 2px;
  28. color: $bg_color;
  29. &:backdrop { color: transparentize($bg_color, 0.9); }
  30. }
  31. &:backdrop {
  32. border-left-color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
  33. border-top: $backdrop_bg_color;
  34. }
  35. &:drop(active) {
  36. border-style: solid none;
  37. border-width: 1px;
  38. border-color: $selected_borders_color;
  39. &.after { border-top-style: none; }
  40. &.before { border-bottom-style: none; }
  41. }
  42. &.expander {
  43. -gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
  44. &:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-end-symbolic-rtl'); }
  45. color: mix($fg_color, $base_color, 70%);
  46. &:hover { color: $fg_color; }
  47. &:selected {
  48. color: mix($selected_fg_color, $selected_bg_color, 70%);
  49. &:hover { color: $selected_fg_color; }
  50. &:backdrop { color: mix($backdrop_selected_fg_color, $selected_bg_color, 70%); }
  51. }
  52. &:checked { -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); }
  53. &:backdrop { color: mix($backdrop_fg_color, $backdrop_base_color, 70%); }
  54. }
  55. &.progressbar { // progress bar in treeviews
  56. @if $variant == light { color: $base_color; }
  57. border: 1px solid $selected_borders_color;
  58. border-radius: 4px;
  59. background-color: $selected_bg_color;
  60. background-image: linear-gradient(to bottom,
  61. $selected_bg_color,
  62. darken($selected_bg_color,10%));
  63. box-shadow: inset 0 1px if($variant=='light', transparentize(white,0.7),
  64. transparentize(white,0.85)),
  65. 0 1px if($variant=='light', transparentize(black, 0.8),
  66. transparentize(black,0.9));
  67. &:selected {
  68. &:focus, & {
  69. border-radius: 4px;
  70. @if $variant == 'light' {
  71. color: $selected_bg_color;
  72. box-shadow: none;
  73. }
  74. @else { box-shadow: inset 0 1px transparentize(white, 0.95); }
  75. background-image: linear-gradient(to bottom,
  76. $base_color,
  77. darken($base_color,10%));
  78. &:backdrop {
  79. @if $variant == 'light' {
  80. color: $selected_bg_color;
  81. border-color: $selected_borders_color; // otherwise it gets inherited by .view(?!?)
  82. }
  83. @else { border-color: $backdrop_base_color; }
  84. background-color: $backdrop_base_color;
  85. }
  86. }
  87. }
  88. &:backdrop {
  89. @if $variant == 'light' { color: $backdrop_base_color; }
  90. @else { border-color: $backdrop_base_color; }
  91. background-image: none;
  92. box-shadow: none;
  93. }
  94. }
  95. &.trough { // progress bar trough in treeviews
  96. background-color: transparentize($fg_color,0.9);
  97. border-radius: 4px;
  98. &:selected {
  99. &:focus, & {
  100. background-color: if($variant == 'light',
  101. transparentize($selected_fg_color, 0.7),
  102. darken($selected_bg_color, 10%));
  103. border-radius: 4px;
  104. @if $variant == 'light' {
  105. border-width: 1px 0;
  106. border-style: solid;
  107. border-color: $selected_bg_color;
  108. }
  109. }
  110. }
  111. }
  112. header {
  113. button {
  114. $_column_header_color: mix($fg_color, $base_color, 50%);
  115. @extend %column_header_button;
  116. color: $_column_header_color;
  117. background-color: $base_color;
  118. font-weight: bold;
  119. text-shadow: none;
  120. box-shadow: none;
  121. &:hover {
  122. @extend %column_header_button;
  123. color: mix($_column_header_color, $fg_color, 50%);
  124. box-shadow: none;
  125. transition: none; //I shouldn't need this
  126. }
  127. &:active {
  128. @extend %column_header_button;
  129. color: $fg_color;
  130. transition: none; //I shouldn't need this
  131. }
  132. }
  133. button:last-child { &:backdrop, & { border-right-style: none; }}
  134. }
  135. button.dnd,
  136. header.button.dnd { // for treeview-like derive widgets
  137. &:active, &:selected, &:hover, & {
  138. padding: 0 6px;
  139. transition: none;
  140. background-image: none;
  141. background-color: $selected_bg_color;
  142. color: $base_color;
  143. border-radius: 0;
  144. border-style: none;
  145. box-shadow: inset 0 0 0 1px $base_color;
  146. text-shadow: none;
  147. }
  148. }
  149. acceleditor > label { background-color: $selected_bg_color; } // see tests/testaccel to test
  150. }
  151. %column_header_button {
  152. padding: 0 6px;
  153. border-radius: 0;
  154. background-image: none;
  155. text-shadow: none;
  156. border-width: 1px;
  157. border-style: none solid solid none;
  158. border-color: $bg_color;
  159. &:disabled {
  160. border-color: $bg_color;
  161. background-image: none;
  162. }
  163. &:backdrop {
  164. border-color: $backdrop_bg_color;
  165. border-style: none solid solid none;
  166. color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
  167. background-image: none;
  168. background-color: $backdrop_base_color;
  169. &:disabled {
  170. border-color: $backdrop_bg_color;
  171. background-image: none;
  172. }
  173. }
  174. }