[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r1226: Try to make the behavior of the bandwidth graph a little mor (trunk/src/gui/bwgraph)



Author: edmanm
Date: 2006-09-22 18:53:15 -0400 (Fri, 22 Sep 2006)
New Revision: 1226

Modified:
   trunk/src/gui/bwgraph/bwgraph.cpp
Log:
Try to make the behavior of the bandwidth graph a little more predictable by
extending or shrinking the bottom of the window when the settings frame is
shown or hidden, so the graph itself remains the same height. This still isn't
perfect, but it's better.


Modified: trunk/src/gui/bwgraph/bwgraph.cpp
===================================================================
--- trunk/src/gui/bwgraph/bwgraph.cpp	2006-09-22 05:53:58 UTC (rev 1225)
+++ trunk/src/gui/bwgraph/bwgraph.cpp	2006-09-22 22:53:15 UTC (rev 1226)
@@ -225,15 +225,28 @@
 void
 BandwidthGraph::showSettingsFrame(bool show)
 {
+  static QSize minSize = minimumSize();
+  
+  QSize newSize = size();
   if (show) {
+    /* Extend the bottom of the bandwidth graph and show the settings */
     ui.frmSettings->setVisible(true);
     ui.btnToggleSettings->setChecked(true);
     ui.btnToggleSettings->setText(tr("Hide Settings"));
+
+    /* 6 = vertical spacing between the settings frame and graph frame */
+    newSize.setHeight(newSize.height() + ui.frmSettings->height() + 6);
   } else {
+    /* Shrink the height of the bandwidth graph and hide the settings */
     ui.frmSettings->setVisible(false);
     ui.btnToggleSettings->setChecked(false);
     ui.btnToggleSettings->setText(tr("Show Settings"));
+    
+    /* 6 = vertical spacing between the settings frame and graph frame */
+    newSize.setHeight(newSize.height() - ui.frmSettings->height() - 6);
+    setMinimumSize(minSize);
   }
+  resize(newSize);
 }
 
 /**