_treeviews.scss 6.1 KB

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