Commit e50169dd authored by Matt Edman's avatar Matt Edman
Browse files

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.


svn:r1226
parent 8e7eacd8
Loading
Loading
Loading
Loading
+13 −0
Changes for src/gui/bwgraph/bwgraph.cpp: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -225,15 +225,28 @@ BandwidthGraph::cancelChanges()
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);
}

/**