Commit 00ab4ba4 authored by finetjul's avatar finetjul
Browse files

ENH: Replace complicated arrow QPushButton with simpler QToolButton

QToolButton::ArrowType does what we want here.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@14693 3bd1e089-480b-0410-8dfb-8563597acbee
parent fbd0f43b
...@@ -30,7 +30,13 @@ ...@@ -30,7 +30,13 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QPushButton" name="SliceCollapsibleButton"> <widget class="QToolButton" name="SliceCollapsibleButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
...@@ -44,10 +50,10 @@ ...@@ -44,10 +50,10 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string/> <string>...</string>
</property> </property>
<property name="checked"> <property name="arrowType">
<bool>false</bool> <enum>Qt::DownArrow</enum>
</property> </property>
</widget> </widget>
</item> </item>
......
...@@ -52,7 +52,7 @@ qMRMLSliceControllerWidgetPrivate::qMRMLSliceControllerWidgetPrivate() ...@@ -52,7 +52,7 @@ qMRMLSliceControllerWidgetPrivate::qMRMLSliceControllerWidgetPrivate()
qMRMLSliceControllerWidgetPrivate::~qMRMLSliceControllerWidgetPrivate() qMRMLSliceControllerWidgetPrivate::~qMRMLSliceControllerWidgetPrivate()
{ {
} }
/*
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class qMRMLSliceCollapsibleButtonStyle:public QProxyStyle class qMRMLSliceCollapsibleButtonStyle:public QProxyStyle
{ {
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
} }
} }
}; };
*/
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void qMRMLSliceControllerWidgetPrivate::setupUi(qMRMLWidget* widget) void qMRMLSliceControllerWidgetPrivate::setupUi(qMRMLWidget* widget)
{ {
...@@ -88,7 +88,7 @@ void qMRMLSliceControllerWidgetPrivate::setupUi(qMRMLWidget* widget) ...@@ -88,7 +88,7 @@ void qMRMLSliceControllerWidgetPrivate::setupUi(qMRMLWidget* widget)
this->Ui_qMRMLSliceControllerWidget::setupUi(widget); this->Ui_qMRMLSliceControllerWidget::setupUi(widget);
// Set a ProxyStyle responsible for drawing the arrow // Set a ProxyStyle responsible for drawing the arrow
this->SliceCollapsibleButton->setStyle(new qMRMLSliceCollapsibleButtonStyle(p->style())); //this->SliceCollapsibleButton->setStyle(new qMRMLSliceCollapsibleButtonStyle(p->style()));
// Set selector attributes // Set selector attributes
this->LabelMapSelector->addAttribute("vtkMRMLVolumeNode", "LabelMap", "1"); this->LabelMapSelector->addAttribute("vtkMRMLVolumeNode", "LabelMap", "1");
...@@ -140,7 +140,10 @@ void qMRMLSliceControllerWidgetPrivate::onImageDataModifiedEvent() ...@@ -140,7 +140,10 @@ void qMRMLSliceControllerWidgetPrivate::onImageDataModifiedEvent()
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
void qMRMLSliceControllerWidgetPrivate::toggleControllerWidgetGroupVisibility() void qMRMLSliceControllerWidgetPrivate::toggleControllerWidgetGroupVisibility()
{ {
this->ControllerWidgetGroup->setVisible(!this->ControllerWidgetGroup->isVisible()); this->ControllerWidgetGroup->setVisible(
!this->ControllerWidgetGroup->isVisible());
this->SliceCollapsibleButton->setArrowType(
this->ControllerWidgetGroup->isVisible() ? Qt::UpArrow : Qt::DownArrow);
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
......
Supports Markdown
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