File: list-view-header.cpp

package info (click to toggle)
higan 098-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 11,904 kB
  • ctags: 13,286
  • sloc: cpp: 108,285; ansic: 778; makefile: 32; sh: 18
file content (43 lines) | stat: -rw-r--r-- 954 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#if defined(Hiro_ListView)

namespace hiro {

auto pListViewHeader::construct() -> void {
}

auto pListViewHeader::destruct() -> void {
}

auto pListViewHeader::append(sListViewColumn column) -> void {
  _setState();
}

auto pListViewHeader::remove(sListViewColumn column) -> void {
  _setState();
}

auto pListViewHeader::setVisible(bool visible) -> void {
  _setState();
}

auto pListViewHeader::_parent() -> maybe<pListView&> {
  if(auto parent = self().parentListView()) {
    if(auto delegate = parent->self()) return *delegate;
  }
  return nothing;
}

auto pListViewHeader::_setState() -> void {
  if(auto parent = _parent()) {
  //parent->qtListView->setAlternatingRowColors(self().columnCount() >= 2);
    parent->qtListView->setColumnCount(self().columnCount());
    parent->qtListView->setHeaderHidden(!self().visible());
    for(auto& column : state().columns) {
      if(auto self = column->self()) self->_setState();
    }
  }
}

}

#endif