Skip to content
Snippets Groups Projects
Commit 740ac08d authored by Dirk Wilden's avatar Dirk Wilden
Browse files

updated viewMode Interface to allow setting of viewmodes

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9949 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7d18c52e
No related branches found
No related tags found
No related merge requests found
......@@ -433,7 +433,7 @@ public:
void slotSetViewModeIcon(QString _mode, bool _custom, QString _iconName);
/// Slot for Changing visible toolWidgets
void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus);
void slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus, bool _expandAll = false);
private slots:
/// Remove viewMode
......@@ -451,7 +451,7 @@ public:
/// Set the view Mode to the given Mode
public slots :
void setViewMode( QString _mode );
void setViewMode( QString _mode, bool _expandAll = false );
/** @} */
......
......@@ -88,6 +88,16 @@ void SideArea::clear ()
//-----------------------------------------------------------------------------
void SideArea::expandAll()
{
foreach (SideElement *e, items_)
{
e->setActive(true);
}
}
//-----------------------------------------------------------------------------
void SideArea::saveState (QSettings &_settings)
{
_settings.beginGroup ("SideArea");
......
......@@ -86,6 +86,9 @@ class SideArea : public QWidget {
/// clears the whole tool widget area
void clear ();
//expand all elements
void expandAll();
/// returns the current state
void saveState (QSettings &_settings);
......
......@@ -146,6 +146,29 @@ void SideElement::labelPress ()
//-----------------------------------------------------------------------------
void SideElement::setActive(bool _active)
{
if ( dialog_ )
{
dialog_->raise ();
dialog_->activateWindow ();
}
else
{
active_ = _active;
if (active_)
widget_->show ();
else
widget_->hide ();
QFont font;
font.setBold (active_);
label_->setFont (font);
}
}
//-----------------------------------------------------------------------------
void SideElement::detachPressed (bool checked_)
{
if (checked_)
......
......@@ -89,6 +89,9 @@ class SideElement : public QWidget
/// Destructor
~SideElement ();
/// Set the element as active
void setActive(bool _active);
/// saves the current state
void saveState (QSettings &_settings);
......
......@@ -304,8 +304,8 @@ void CoreWidget::slotSetViewMode( QAction* action){
}
/// Slot for setting the viewMode from menu
void CoreWidget::setViewMode( QString _mode ){
slotChangeView(_mode, QStringList(), QStringList(), QStringList());
void CoreWidget::setViewMode( QString _mode, bool _expandAll ){
slotChangeView(_mode, QStringList(), QStringList(), QStringList(), _expandAll);
}
void CoreWidget::slotAddViewModeComplete(QString _mode , bool _custom, QStringList _toolboxes, QStringList _toolbars, QStringList _contextmenus) {
......@@ -349,7 +349,7 @@ void CoreWidget::slotViewChangeDialog() {
}
/// Slot for Changing visible toolWidgets
void CoreWidget::slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus ){
void CoreWidget::slotChangeView(QString _mode, QStringList _toolboxWidgets, QStringList _toolbars, QStringList _contextmenus, bool _expandAll ){
//try to find Widgets if they aren't given
if (_mode != "" && _toolboxWidgets.size() == 0 && _toolbars.size() == 0)
......@@ -371,6 +371,9 @@ void CoreWidget::slotChangeView(QString _mode, QStringList _toolboxWidgets, QStr
toolBox_->addItem (plugins_[p].toolboxWidgets[j].second, plugins_[p].toolboxWidgets[j].first);
}
if (_expandAll)
toolBox_->expandAll();
//find all Toolbars that should be visible and hide the others
for (uint p=0; p < plugins_.size(); p++)
for ( uint j = 0 ; j < plugins_[p].toolbars.size(); ++j )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment