Commit 7cb4ddad authored by Dirk Wilden's avatar Dirk Wilden
Browse files

add collapsing to toolboxes

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10539 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4b94489f
...@@ -179,10 +179,21 @@ void DataControlPlugin::initializePlugin() ...@@ -179,10 +179,21 @@ void DataControlPlugin::initializePlugin()
connect( viewHeader_, SIGNAL(customContextMenuRequested ( const QPoint & ) ), connect( viewHeader_, SIGNAL(customContextMenuRequested ( const QPoint & ) ),
this, SLOT(slotHeaderCustomContextMenuRequested ( const QPoint & ) )); this, SLOT(slotHeaderCustomContextMenuRequested ( const QPoint & ) ));
emit addToolbox("Data Control", tool_); toolIcon_ = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"datacontrol-toolbox.png");
emit addToolbox("Data Control", tool_, toolIcon_);
onlyDown_ = 0; onlyDown_ = 0;
onlyUp_ = 0; onlyUp_ = 0;
QIcon icon = QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"datacontrol-boundingBox.png");
tool_->boundingBoxBtn->setIcon( icon );
icon = QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"datacontrol-hide-object.png");
tool_->visibleDataBtn->setIcon( icon );
//hide additional boxes
tool_->visibleDataBtn->setChecked(false);
tool_->boundingBoxBtn->setChecked(false);
} }
...@@ -321,6 +332,7 @@ void DataControlPlugin::fileOpened(int _id){ ...@@ -321,6 +332,7 @@ void DataControlPlugin::fileOpened(int _id){
model_->objectAdded(obj); model_->objectAdded(obj);
slotShowLightSources(tool_->lightSources->checkState()); slotShowLightSources(tool_->lightSources->checkState());
view_->resizeColumnToContents(0);
} }
......
...@@ -99,7 +99,7 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn ...@@ -99,7 +99,7 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
void copyObject( int _oldId, int& _newId); void copyObject( int _oldId, int& _newId);
// ToolboxInterface // ToolboxInterface
void addToolbox( QString _name , QWidget* _widget ); void addToolbox( QString _name , QWidget* _widget, QIcon* _icon );
private slots : private slots :
// BaseInterface // BaseInterface
...@@ -136,6 +136,7 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn ...@@ -136,6 +136,7 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
private : private :
/// Widget for Toolbox /// Widget for Toolbox
DatacontrolToolboxWidget* tool_; DatacontrolToolboxWidget* tool_;
QIcon* toolIcon_;
/// Layout for Toolbox /// Layout for Toolbox
QGridLayout* MeshDialogLayout_; QGridLayout* MeshDialogLayout_;
......
...@@ -483,6 +483,7 @@ void DataControlPlugin::slotRename(){ ...@@ -483,6 +483,7 @@ void DataControlPlugin::slotRename(){
item->name(), &ok); item->name(), &ok);
if (ok && !newName.isEmpty()){ if (ok && !newName.isEmpty()){
item->setName(newName); item->setName(newName);
view_->resizeColumnToContents(0);
} }
} }
} }
......
...@@ -6,14 +6,17 @@ ...@@ -6,14 +6,17 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>333</width> <width>268</width>
<height>560</height> <height>456</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="margin">
<number>2</number>
</property>
<item> <item>
<widget class="DataControlTreeView" name="treeView"> <widget class="DataControlTreeView" name="treeView">
<property name="minimumSize"> <property name="minimumSize">
...@@ -37,11 +40,24 @@ ...@@ -37,11 +40,24 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QPushButton" name="visibleDataBtn">
<property name="title"> <property name="text">
<string>Visible Data</string> <string>Object Visibility</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="visibleDataWidget" native="true">
<layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QCheckBox" name="lightSources"> <widget class="QCheckBox" name="lightSources">
<property name="text"> <property name="text">
...@@ -53,35 +69,51 @@ ...@@ -53,35 +69,51 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="Line" name="line_2">
<property name="title"> <property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="boundingBoxBtn">
<property name="text">
<string>Object Bounding Box</string> <string>Object Bounding Box</string>
</property> </property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="flat">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="boundingBoxWidget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <widget class="QCheckBox" name="notSelected">
<item> <property name="text">
<widget class="QCheckBox" name="notSelected"> <string>Show always</string>
<property name="text"> </property>
<string>Not selected</string> </widget>
</property> </item>
</widget> <item>
</item> <widget class="QCheckBox" name="sourceSelected">
<item> <property name="text">
<widget class="QCheckBox" name="sourceSelected"> <string>Show on source objects</string>
<property name="text"> </property>
<string>Source</string> </widget>
</property> </item>
</widget> <item>
</item> <widget class="QCheckBox" name="targetSelected">
<item> <property name="text">
<widget class="QCheckBox" name="targetSelected"> <string>Show on target objects</string>
<property name="text"> </property>
<string>Target</string> </widget>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
...@@ -96,5 +128,38 @@ ...@@ -96,5 +128,38 @@
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources/> <resources/>
<connections/> <connections>
<connection>
<sender>visibleDataBtn</sender>
<signal>toggled(bool)</signal>
<receiver>visibleDataWidget</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>161</x>
<y>276</y>
</hint>
<hint type="destinationlabel">
<x>160</x>
<y>302</y>
</hint>
</hints>
</connection>
<connection>
<sender>boundingBoxBtn</sender>
<signal>toggled(bool)</signal>
<receiver>boundingBoxWidget</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>138</x>
<y>345</y>
</hint>
<hint type="destinationlabel">
<x>133</x>
<y>373</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment