105 // Top layout stretch |
106 // Top layout stretch |
106 topLayout->setRowStretch(0, 1); |
107 topLayout->setRowStretch(0, 1); |
107 topLayout->setRowStretch(1, 0); |
108 topLayout->setRowStretch(1, 0); |
108 topLayout->setColumnStretch(3, 1); |
109 topLayout->setColumnStretch(3, 1); |
109 |
110 |
|
111 // Rooms list and chat with splitter |
|
112 m_splitter = new QSplitter(); |
|
113 m_splitter->setChildrenCollapsible(false); |
|
114 pageLayout->addWidget(m_splitter, 100); |
|
115 |
110 // Room list |
116 // Room list |
|
117 QWidget * roomsListWidget = new QWidget(this); |
|
118 m_splitter->setOrientation(Qt::Vertical); |
|
119 m_splitter->addWidget(roomsListWidget); |
|
120 |
|
121 QVBoxLayout * roomsLayout = new QVBoxLayout(roomsListWidget); |
|
122 roomsLayout->setMargin(0); |
111 |
123 |
112 roomsList = new RoomTableView(this); |
124 roomsList = new RoomTableView(this); |
113 roomsList->setSelectionBehavior(QAbstractItemView::SelectRows); |
125 roomsList->setSelectionBehavior(QAbstractItemView::SelectRows); |
114 roomsList->verticalHeader()->setVisible(false); |
126 roomsList->verticalHeader()->setVisible(false); |
115 roomsList->horizontalHeader()->setResizeMode(QHeaderView::Interactive); |
127 roomsList->horizontalHeader()->setResizeMode(QHeaderView::Interactive); |
116 roomsList->setAlternatingRowColors(true); |
128 roomsList->setAlternatingRowColors(true); |
117 roomsList->setShowGrid(false); |
129 roomsList->setShowGrid(false); |
118 roomsList->setSelectionMode(QAbstractItemView::SingleSelection); |
130 roomsList->setSelectionMode(QAbstractItemView::SingleSelection); |
119 roomsList->setStyleSheet("QTableView { border-top-left-radius: 0px; }"); |
131 roomsList->setStyleSheet("QTableView { border-top-left-radius: 0px; }"); |
120 roomsList->setFocusPolicy(Qt::NoFocus); |
132 roomsList->setFocusPolicy(Qt::NoFocus); |
121 pageLayout->addWidget(roomsList, 200); |
133 roomsLayout->addWidget(roomsList, 200); |
122 |
134 |
123 // Room filters container |
135 // Room filters container |
124 |
136 |
125 QWidget * filtersContainer = new QWidget(); |
137 QWidget * filtersContainer = new QWidget(); |
126 filtersContainer->setMaximumWidth(800); |
138 filtersContainer->setMaximumWidth(800); |
127 filtersContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
139 filtersContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
128 |
140 |
129 pageLayout->addSpacing(7); |
141 roomsLayout->addSpacing(7); |
130 pageLayout->addWidget(filtersContainer, 0, Qt::AlignHCenter); |
142 roomsLayout->addWidget(filtersContainer, 0, Qt::AlignHCenter); |
131 pageLayout->addSpacing(7); |
143 roomsLayout->addSpacing(7); |
132 |
144 |
133 QHBoxLayout * filterLayout = new QHBoxLayout(filtersContainer); |
145 QHBoxLayout * filterLayout = new QHBoxLayout(filtersContainer); |
134 filterLayout->setSpacing(0); |
146 filterLayout->setSpacing(0); |
135 filterLayout->setMargin(0); |
147 filterLayout->setMargin(0); |
136 |
148 |
730 m_gameSettings = settings; |
744 m_gameSettings = settings; |
731 } |
745 } |
732 |
746 |
733 bool PageRoomsList::restoreHeaderState() |
747 bool PageRoomsList::restoreHeaderState() |
734 { |
748 { |
735 if (!m_gameSettings->contains("frontend/roomslist_header")) |
749 if (m_gameSettings->contains("frontend/roomslist_splitter")) |
736 return false; |
750 { |
737 return roomsList->horizontalHeader()->restoreState(QByteArray::fromBase64( |
751 m_splitter->restoreState(QByteArray::fromBase64( |
738 (m_gameSettings->value("frontend/roomslist_header").toByteArray()))); |
752 (m_gameSettings->value("frontend/roomslist_splitter").toByteArray()))); |
|
753 } |
|
754 |
|
755 if (m_gameSettings->contains("frontend/roomslist_header")) |
|
756 { |
|
757 return roomsList->horizontalHeader()->restoreState(QByteArray::fromBase64( |
|
758 (m_gameSettings->value("frontend/roomslist_header").toByteArray()))); |
|
759 } else return false; |
739 } |
760 } |
740 |
761 |
741 void PageRoomsList::saveHeaderState() |
762 void PageRoomsList::saveHeaderState() |
742 { |
763 { |
743 m_gameSettings->setValue("frontend/roomslist_header", |
764 m_gameSettings->setValue("frontend/roomslist_header", |
744 QString(roomsList->horizontalHeader()->saveState().toBase64())); |
765 QString(roomsList->horizontalHeader()->saveState().toBase64())); |
745 } |
766 |
|
767 m_gameSettings->setValue("frontend/roomslist_splitter", |
|
768 QString(m_splitter->saveState().toBase64())); |
|
769 } |