From e972ddea3ed824c90210606905fd3fdfec2aafba Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 4 Feb 2011 00:53:44 +0000 Subject: [PATCH] Removed maximum size of the splitter in ForumsDialog and ChannelFeed. Save and load the splitter state of the ChannelFeed. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4012 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/ChannelFeed.cpp | 11 +++ retroshare-gui/src/gui/ChannelFeed.ui | 81 +++++-------------- retroshare-gui/src/gui/ForumsDialog.cpp | 5 ++ retroshare-gui/src/gui/ForumsDialog.ui | 34 +------- .../src/gui/common/GroupTreeWidget.ui | 23 ++---- 5 files changed, 43 insertions(+), 111 deletions(-) diff --git a/retroshare-gui/src/gui/ChannelFeed.cpp b/retroshare-gui/src/gui/ChannelFeed.cpp index 51569c788..6e911d6f2 100644 --- a/retroshare-gui/src/gui/ChannelFeed.cpp +++ b/retroshare-gui/src/gui/ChannelFeed.cpp @@ -71,6 +71,11 @@ ChannelFeed::ChannelFeed(QWidget *parent) mChannelId.clear(); + /* Set initial size the splitter */ + QList sizes; + sizes << 300 << width(); // Qt calculates the right sizes + splitter->setSizes(sizes); + /* Initialize group tree */ treeWidget->initDisplayMenu(displayButton); @@ -109,8 +114,14 @@ void ChannelFeed::processSettings(bool load) if (load) { // load settings + + // state of splitter + splitter->restoreState(Settings->value("Splitter").toByteArray()); } else { // save settings + + // state of splitter + Settings->setValue("Splitter", splitter->saveState()); } treeWidget->processSettings(Settings, load); diff --git a/retroshare-gui/src/gui/ChannelFeed.ui b/retroshare-gui/src/gui/ChannelFeed.ui index 8e35a7329..f267ec062 100644 --- a/retroshare-gui/src/gui/ChannelFeed.ui +++ b/retroshare-gui/src/gui/ChannelFeed.ui @@ -35,30 +35,6 @@ 0 - - - 0 - 0 - - - - - 240 - 16777215 - - - - - 0 - 0 - - - - - 221 - 0 - - QFrame#chanFrame{border: none;} @@ -81,30 +57,19 @@ 0 - + + + + 0 + 0 + + + - - - 220 - 0 - - - - - 240 - 38 - - - - - 220 - 0 - - QFrame#chheaderframe{ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, @@ -389,14 +354,14 @@ p, li { white-space: pre-wrap; } - + 0 0 - 26 + 0 26 @@ -431,14 +396,14 @@ border-image: url(:/images/btn_26_pressed.png) 4; - + 0 0 - 26 + 0 26 @@ -495,9 +460,15 @@ border-image: url(:/images/btn_26_pressed.png) 4; + + + 0 + 0 + + - 26 + 0 26 @@ -533,18 +504,6 @@ border-image: url(:/images/btn_26_pressed.png) 4; - - - 1 - 0 - - - - - 0 - 0 - - @@ -574,7 +533,7 @@ border-image: url(:/images/btn_26_pressed.png) 4; 0 0 - 412 + 404 331 diff --git a/retroshare-gui/src/gui/ForumsDialog.cpp b/retroshare-gui/src/gui/ForumsDialog.cpp index 3c6d998cd..5a3c1bd1a 100644 --- a/retroshare-gui/src/gui/ForumsDialog.cpp +++ b/retroshare-gui/src/gui/ForumsDialog.cpp @@ -150,6 +150,11 @@ ForumsDialog::ForumsDialog(QWidget *parent) connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged())); connect(ui.filterColumnComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterColumnChanged())); + /* Set initial size the splitter */ + QList sizes; + sizes << 300 << width(); // Qt calculates the right sizes + ui.splitter->setSizes(sizes); + /* Set own item delegate */ RSItemDelegate *itemDelegate = new RSItemDelegate(this); itemDelegate->removeFocusRect(COLUMN_THREAD_READ); diff --git a/retroshare-gui/src/gui/ForumsDialog.ui b/retroshare-gui/src/gui/ForumsDialog.ui index 7a856f6bb..3f0aefaad 100644 --- a/retroshare-gui/src/gui/ForumsDialog.ui +++ b/retroshare-gui/src/gui/ForumsDialog.ui @@ -518,16 +518,10 @@ Qt::Horizontal - - - 300 - 16777215 - - - 220 - 0 + 300 + 300 @@ -548,24 +542,6 @@ - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - 0 - 0 - - QFrame#chheaderframe{ background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, @@ -739,12 +715,6 @@ p, li { white-space: pre-wrap; } 0 - - - 300 - 0 - - 9 diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.ui b/retroshare-gui/src/gui/common/GroupTreeWidget.ui index 833f7b4c4..8436fa84e 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.ui +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.ui @@ -190,24 +190,6 @@ border-image: url(:/images/closepressed.png) 0 - - - 0 - 0 - - - - - 0 - 0 - - - - - 300 - 0 - - 9 @@ -237,6 +219,11 @@ border-image: url(:/images/closepressed.png) false + + + 1 + +