mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-05 01:25:39 -05:00
Fixed size of the state column after switching it on.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3922 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
74f3b3d5a3
commit
d4393b8d0b
@ -122,6 +122,7 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||||||
|
|
||||||
last_status_send_time = 0 ;
|
last_status_send_time = 0 ;
|
||||||
groupsHasChanged = false;
|
groupsHasChanged = false;
|
||||||
|
correctColumnStatusSize = false;
|
||||||
|
|
||||||
m_compareRole = new RSTreeWidgetItemCompareRole;
|
m_compareRole = new RSTreeWidgetItemCompareRole;
|
||||||
m_compareRole->setRole(COLUMN_NAME, ROLE_SORT);
|
m_compareRole->setRole(COLUMN_NAME, ROLE_SORT);
|
||||||
@ -235,7 +236,11 @@ PeersDialog::PeersDialog(QWidget *parent)
|
|||||||
// load settings
|
// load settings
|
||||||
processSettings(true);
|
processSettings(true);
|
||||||
|
|
||||||
ui.peertreeWidget->header()->setStretchLastSection(true);
|
/* Set header sizes for the fixed columns and resize modes, must be set after processSettings */
|
||||||
|
QHeaderView *header = ui.peertreeWidget->header();
|
||||||
|
header->setStretchLastSection(true);
|
||||||
|
ui.peertreeWidget->setColumnWidth(COLUMN_STATE, 20); // small enough
|
||||||
|
header->setResizeMode(COLUMN_STATE, QHeaderView::Stretch);
|
||||||
|
|
||||||
// workaround for Qt bug, should be solved in next Qt release 4.7.0
|
// workaround for Qt bug, should be solved in next Qt release 4.7.0
|
||||||
// http://bugreports.qt.nokia.com/browse/QTBUG-8270
|
// http://bugreports.qt.nokia.com/browse/QTBUG-8270
|
||||||
@ -301,6 +306,11 @@ void PeersDialog::processSettings(bool bLoad)
|
|||||||
}
|
}
|
||||||
Settings->endArray();
|
Settings->endArray();
|
||||||
|
|
||||||
|
if (ui.peertreeWidget->isColumnHidden(COLUMN_STATE) && header->sectionSize(COLUMN_STATE) < 100) {
|
||||||
|
// Workaround
|
||||||
|
correctColumnStatusSize = true;
|
||||||
|
}
|
||||||
|
|
||||||
setStateColumn();
|
setStateColumn();
|
||||||
} else {
|
} else {
|
||||||
// save settings
|
// save settings
|
||||||
@ -2035,6 +2045,10 @@ void PeersDialog::setStateColumn()
|
|||||||
ui.peertreeWidget->setColumnHidden(COLUMN_STATE, false);
|
ui.peertreeWidget->setColumnHidden(COLUMN_STATE, false);
|
||||||
ui.peertreeWidget->setHeaderHidden(false);
|
ui.peertreeWidget->setHeaderHidden(false);
|
||||||
ui.action_Hide_State->setEnabled(false);
|
ui.action_Hide_State->setEnabled(false);
|
||||||
|
if (correctColumnStatusSize) {
|
||||||
|
correctColumnStatusSize = false;
|
||||||
|
ui.peertreeWidget->header()->resizeSection(COLUMN_STATE, 100);
|
||||||
|
}
|
||||||
if (wasStatusColumnHidden) {
|
if (wasStatusColumnHidden) {
|
||||||
ui.peertreeWidget->header()->resizeSection(COLUMN_NAME, ui.peertreeWidget->header()->sectionSize(COLUMN_NAME) - ui.peertreeWidget->header()->sectionSize(COLUMN_STATE));
|
ui.peertreeWidget->header()->resizeSection(COLUMN_NAME, ui.peertreeWidget->header()->sectionSize(COLUMN_NAME) - ui.peertreeWidget->header()->sectionSize(COLUMN_STATE));
|
||||||
}
|
}
|
||||||
|
@ -212,6 +212,7 @@ private:
|
|||||||
QColor newsFeedTabColor;
|
QColor newsFeedTabColor;
|
||||||
QString newsFeedText;
|
QString newsFeedText;
|
||||||
bool wasStatusColumnHidden;
|
bool wasStatusColumnHidden;
|
||||||
|
bool correctColumnStatusSize;
|
||||||
|
|
||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::PeersDialog ui;
|
Ui::PeersDialog ui;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user