Пример #1
0
bool Sidebar::hideWidget (ToolView *widget)
{
  if (!m_widgetToId.contains(widget))
    return false;

  bool anyVis = false;

   updateLastSize ();

  for ( QIntDictIterator<ToolView> it( m_idToWidget ); it.current(); ++it )
  {
    if (it.current() == widget)
    {
      it.current()->hide();
      continue;
    }

    if (!anyVis)
      anyVis =  it.current()->isVisible();
  }

  // lower tab
  setTab (m_widgetToId[widget], false);

  if (!anyVis)
    m_ownSplit->hide ();

  widget->setVisible (false);

  return true;
}
Пример #2
0
  bool Sidebar::hideWidget (ToolView *widget)
  {
    if (!m_widgetToId.contains(widget))
      return false;

    bool anyVis = false;

    updateLastSize ();

    QMapIterator<int, ToolView*> it( m_idToWidget );
    while ( it.hasNext() )
    {
      it.next();
      if (it.value() == widget)
      {
        // remember size and hide
        if (widget->isVisible())
          m_widgetToSize[widget] = widget->size();
        continue;
      }

      if (!anyVis)
        anyVis =  it.value()->isVisible();
    }

    // lower tab
    setTab (m_widgetToId[widget], false);

    if (!anyVis) {
      if (m_ownSplit->isVisible())
        m_preHideSize = m_ownSplit->size ();
      m_ownSplit->hide ();
    }
    
    // set minimum size == size, this avoid artifical resizes on show
    // there we will reset this again to 80,80!
    widget->setMinimumSize (widget->size());

    widget->hide ();

    widget->setToolVisible (false);

    return true;
  }