Skip to content
Snippets Groups Projects
Commit 4bb58736 authored by Phil's avatar Phil Committed by Phil Colebrooke
Browse files

Re #26591 Added buttons and configured enable/disable

parent 37ee63a6
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>391</width> <width>416</width>
<height>274</height> <height>274</height>
</rect> </rect>
</property> </property>
...@@ -28,73 +28,33 @@ ...@@ -28,73 +28,33 @@
<property name="topMargin"> <property name="topMargin">
<number>5</number> <number>5</number>
</property> </property>
<item row="3" column="0"> <item row="6" column="2">
<widget class="QLabel" name="draw_style_label_3"> <widget class="QPushButton" name="apply_to_all_button">
<property name="text"> <property name="enabled">
<string>Capsize</string> <bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QDoubleSpinBox" name="width_spin_box">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>190</horstretch>
<verstretch>20</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>190</width>
<height>20</height>
</size>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="value">
<double>1.500000000000000</double>
</property> </property>
</widget>
</item>
<item row="4" column="2">
<widget class="QDoubleSpinBox" name="cap_thickness_spin_box">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>190</width> <width>200</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
<property name="decimals">
<number>2</number>
</property>
<property name="value">
<double>1.500000000000000</double>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="width_label_3">
<property name="text"> <property name="text">
<string>Cap Thickness</string> <string>Apply to All</string>
</property> </property>
</widget> <property name="checkable">
</item> <bool>false</bool>
<item row="6" column="0">
<widget class="QLabel" name="color_label_3">
<property name="text">
<string>Color (RGBA)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item row="4" column="1">
<spacer name="horizontalSpacer_18"> <spacer name="horizontalSpacer_20">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -109,21 +69,15 @@ ...@@ -109,21 +69,15 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="2" column="0"> <item row="8" column="0">
<widget class="QLabel" name="line_style_label_3"> <widget class="QLabel" name="color_label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Width</string> <string>Color (RGBA)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="3" column="1">
<spacer name="horizontalSpacer_20"> <spacer name="horizontalSpacer_19">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -138,8 +92,8 @@ ...@@ -138,8 +92,8 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="1"> <item row="2" column="1">
<spacer name="horizontalSpacer_19"> <spacer name="horizontalSpacer_18">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -154,6 +108,53 @@ ...@@ -154,6 +108,53 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="0">
<widget class="QLabel" name="draw_style_label_3">
<property name="text">
<string>Capsize</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QLabel" name="errorbar_options_label">
<property name="minimumSize">
<size>
<width>79</width>
<height>18</height>
</size>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Errorbar Options</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="width_label_3">
<property name="text">
<string>Cap Thickness</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="line_style_label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="5" column="2"> <item row="5" column="2">
<widget class="QSpinBox" name="error_every_spin_box"> <widget class="QSpinBox" name="error_every_spin_box">
<property name="sizePolicy"> <property name="sizePolicy">
...@@ -173,51 +174,75 @@ ...@@ -173,51 +174,75 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item row="5" column="0">
<spacer name="horizontalSpacer_21"> <widget class="QLabel" name="label_3">
<property name="orientation"> <property name="text">
<enum>Qt::Horizontal</enum> <string>Error Every</string>
</property> </property>
<property name="sizeType"> </widget>
<enum>QSizePolicy::Fixed</enum> </item>
<item row="3" column="2">
<widget class="QDoubleSpinBox" name="capsize_spin_box">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="minimumSize">
<size> <size>
<width>40</width> <width>190</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> <property name="decimals">
<number>2</number>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item> </item>
<item row="0" column="0" colspan="2"> <item row="2" column="2">
<widget class="QLabel" name="errorbar_options_label"> <widget class="QDoubleSpinBox" name="width_spin_box">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>190</horstretch>
<verstretch>20</verstretch>
</sizepolicy>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>79</width> <width>190</width>
<height>18</height> <height>20</height>
</size> </size>
</property> </property>
<property name="font"> <property name="decimals">
<font> <number>2</number>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property> </property>
<property name="text"> <property name="value">
<string>Errorbar Options</string> <double>1.500000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="8" column="1">
<widget class="QLabel" name="label_3"> <spacer name="horizontalSpacer_21">
<property name="text"> <property name="orientation">
<string>Error Every</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item row="3" column="2"> <item row="4" column="2">
<widget class="QDoubleSpinBox" name="capsize_spin_box"> <widget class="QDoubleSpinBox" name="cap_thickness_spin_box">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding"> <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
...@@ -234,11 +259,11 @@ ...@@ -234,11 +259,11 @@
<number>2</number> <number>2</number>
</property> </property>
<property name="value"> <property name="value">
<double>1.000000000000000</double> <double>1.500000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="2"> <item row="8" column="2">
<widget class="QWidget" name="color_dummy_widget" native="true"> <widget class="QWidget" name="color_dummy_widget" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding"> <sizepolicy hsizetype="Minimum" vsizetype="Expanding">
...@@ -277,6 +302,13 @@ ...@@ -277,6 +302,13 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="7" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="3" column="0"> <item row="3" column="0">
......
...@@ -33,6 +33,8 @@ class ErrorbarsTabWidgetView(QWidget): ...@@ -33,6 +33,8 @@ class ErrorbarsTabWidgetView(QWidget):
lambda: self.set_fields_enabled(not self.get_hide()) lambda: self.set_fields_enabled(not self.get_hide())
) )
self.multiple_curves = False
def get_hide(self): def get_hide(self):
return self.hide_errorbars_tickbox.checkState() == Qt.Checked return self.hide_errorbars_tickbox.checkState() == Qt.Checked
...@@ -80,6 +82,9 @@ class ErrorbarsTabWidgetView(QWidget): ...@@ -80,6 +82,9 @@ class ErrorbarsTabWidgetView(QWidget):
self.error_every_spin_box.setEnabled(enable) self.error_every_spin_box.setEnabled(enable)
self.color_selector_widget.setEnabled(enable) self.color_selector_widget.setEnabled(enable)
if self.multiple_curves:
self.apply_to_all_button.setEnabled(enable)
def update_fields(self, curve_props): def update_fields(self, curve_props):
self.set_hide(curve_props.hide_errors) self.set_hide(curve_props.hide_errors)
self.set_width(curve_props.elinewidth) self.set_width(curve_props.elinewidth)
...@@ -87,3 +92,6 @@ class ErrorbarsTabWidgetView(QWidget): ...@@ -87,3 +92,6 @@ class ErrorbarsTabWidgetView(QWidget):
self.set_cap_thickness(curve_props.capthick) self.set_cap_thickness(curve_props.capthick)
self.set_error_every(curve_props.errorevery) self.set_error_every(curve_props.errorevery)
self.set_color(curve_props.ecolor) self.set_color(curve_props.ecolor)
def set_plot_all_enabled(self, enable):
self.apply_to_all_button.setEnabled(enable)
\ No newline at end of file
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>387</width> <width>368</width>
<height>213</height> <height>220</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
...@@ -20,6 +20,19 @@ ...@@ -20,6 +20,19 @@
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0"> <item row="0" column="0">
<layout class="QGridLayout" name="grid_layout"> <layout class="QGridLayout" name="grid_layout">
<property name="sizeConstraint"> <property name="sizeConstraint">
...@@ -69,8 +82,15 @@ ...@@ -69,8 +82,15 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="4" column="0">
<widget class="QDoubleSpinBox" name="line_width_spin_box"> <widget class="QLabel" name="width_label">
<property name="text">
<string>Width</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QWidget" name="color_selector_dummy_widget" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
...@@ -80,71 +100,66 @@ ...@@ -80,71 +100,66 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>200</width> <width>200</width>
<height>20</height> <height>0</height>
</size> </size>
</property> </property>
<property name="decimals">
<number>2</number>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="1" column="1">
<widget class="QLabel" name="draw_style_label"> <spacer name="horizontalSpacer_14">
<property name="text"> <property name="orientation">
<string>Draw style</string> <enum>Qt::Horizontal</enum>
</property> </property>
</widget> <property name="sizeType">
</item> <enum>QSizePolicy::Fixed</enum>
<item row="5" column="0">
<widget class="QLabel" name="color_label">
<property name="text">
<string>Color (RGBA)</string>
</property> </property>
</widget> <property name="sizeHint" stdset="0">
</item> <size>
<item row="4" column="0"> <width>40</width>
<widget class="QLabel" name="width_label"> <height>20</height>
<property name="text"> </size>
<string>Width</string>
</property> </property>
</widget> </spacer>
</item> </item>
<item row="1" column="0"> <item row="4" column="2">
<widget class="QLabel" name="line_style_label"> <widget class="QDoubleSpinBox" name="line_width_spin_box">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>96</width> <width>200</width>
<height>0</height> <height>20</height>
</size> </size>
</property> </property>
<property name="text"> <property name="decimals">
<string>Line style</string> <number>2</number>
</property>
<property name="value">
<double>1.000000000000000</double>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2"> <item row="1" column="0">
<widget class="QWidget" name="color_selector_dummy_widget" native="true"> <widget class="QLabel" name="line_style_label">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>200</width> <width>96</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="text">
<string>Line style</string>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
...@@ -167,21 +182,12 @@ ...@@ -167,21 +182,12 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="3" column="0">
<spacer name="horizontalSpacer_14"> <widget class="QLabel" name="draw_style_label">
<property name="orientation"> <property name="text">
<enum>Qt::Horizontal</enum> <string>Draw style</string>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property> </property>
</spacer> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<spacer name="horizontalSpacer_15"> <spacer name="horizontalSpacer_15">
...@@ -215,22 +221,6 @@ ...@@ -215,22 +221,6 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="5" column="1">
<spacer name="horizontalSpacer_17">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QComboBox" name="line_style_combo_box"> <widget class="QComboBox" name="line_style_combo_box">
<property name="sizePolicy"> <property name="sizePolicy">
...@@ -272,21 +262,60 @@ ...@@ -272,21 +262,60 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="9" column="1">
<spacer name="horizontalSpacer_17">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="9" column="0">
<widget class="QLabel" name="color_label">
<property name="text">
<string>Color (RGBA)</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QPushButton" name="apply_to_all_button">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Apply to All</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
......
...@@ -57,3 +57,6 @@ class LineTabWidgetView(QWidget): ...@@ -57,3 +57,6 @@ class LineTabWidgetView(QWidget):
self.set_draw_style(curve_props.drawstyle) self.set_draw_style(curve_props.drawstyle)
self.set_width(curve_props.linewidth) self.set_width(curve_props.linewidth)
self.set_color(curve_props.color) self.set_color(curve_props.color)
def set_plot_all_enabled(self, enable):
self.apply_to_all_button.setEnabled(enable)
\ No newline at end of file
...@@ -234,34 +234,28 @@ ...@@ -234,34 +234,28 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="5" column="2">
<widget class="QLabel" name="marker_style_label"> <widget class="QWidget" name="face_color_dummy_widget" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Marker Style</string>
</property>
</widget> </widget>
</item> </item>
<item row="4" column="0"> <item row="6" column="2">
<widget class="QLabel" name="color_label_2"> <widget class="QWidget" name="edge_color_dummy_widget" native="true">
<property name="text"> <property name="sizePolicy">
<string>Edge Color</string> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="1" column="1">
<spacer name="horizontalSpacer_17"> <spacer name="horizontalSpacer_14">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -276,8 +270,35 @@ ...@@ -276,8 +270,35 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="2" column="1"> <item row="0" column="0" colspan="2">
<spacer name="horizontalSpacer_15"> <widget class="QLabel" name="marker_options_label">
<property name="minimumSize">
<size>
<width>79</width>
<height>18</height>
</size>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Marker Options</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="marker_size_label">
<property name="text">
<string>Marker Size</string>
</property>
</widget>
</item>
<item row="5" column="1">
<spacer name="horizontalSpacer_16">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -292,22 +313,63 @@ ...@@ -292,22 +313,63 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="0"> <item row="2" column="2">
<widget class="QDoubleSpinBox" name="marker_size_spin_box">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>190</width>
<height>20</height>
</size>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="width_label_2"> <widget class="QLabel" name="width_label_2">
<property name="text"> <property name="text">
<string>Face Color</string> <string>Face Color</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="1" column="0">
<widget class="QLabel" name="marker_size_label"> <widget class="QLabel" name="marker_style_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>96</width>
<height>0</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Marker Size</string> <string>Marker Style</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="6" column="0">
<spacer name="horizontalSpacer_14"> <widget class="QLabel" name="color_label_2">
<property name="text">
<string>Edge Color</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer_15">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -322,8 +384,8 @@ ...@@ -322,8 +384,8 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="1"> <item row="6" column="1">
<spacer name="horizontalSpacer_16"> <spacer name="horizontalSpacer_17">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
...@@ -338,28 +400,11 @@ ...@@ -338,28 +400,11 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="0" colspan="2"> <item row="3" column="2">
<widget class="QLabel" name="marker_options_label"> <widget class="QPushButton" name="apply_to_all_button">
<property name="minimumSize"> <property name="enabled">
<size> <bool>false</bool>
<width>79</width>
<height>18</height>
</size>
</property>
<property name="font">
<font>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Marker Options</string>
</property> </property>
</widget>
</item>
<item row="2" column="2">
<widget class="QDoubleSpinBox" name="marker_size_spin_box">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
...@@ -368,35 +413,19 @@ ...@@ -368,35 +413,19 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>190</width> <width>200</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
<property name="decimals"> <property name="text">
<number>2</number> <string>Apply to All</string>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QWidget" name="face_color_dummy_widget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="4" column="0" colspan="3">
<widget class="QWidget" name="edge_color_dummy_widget" native="true"> <widget class="Line" name="line">
<property name="sizePolicy"> <property name="orientation">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <enum>Qt::Horizontal</enum>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
</widget> </widget>
</item> </item>
......
...@@ -60,3 +60,6 @@ class MarkerTabWidgetView(QWidget): ...@@ -60,3 +60,6 @@ class MarkerTabWidgetView(QWidget):
self.set_size(curve_props.markersize) self.set_size(curve_props.markersize)
self.set_face_color(curve_props.markerfacecolor) self.set_face_color(curve_props.markerfacecolor)
self.set_edge_color(curve_props.markeredgecolor) self.set_edge_color(curve_props.markeredgecolor)
def set_plot_all_enabled(self, enable):
self.apply_to_all_button.setEnabled(enable)
...@@ -43,6 +43,8 @@ class CurvesTabWidgetPresenter: ...@@ -43,6 +43,8 @@ class CurvesTabWidgetPresenter:
self.curve_names_dict = {} self.curve_names_dict = {}
self.populate_curve_combo_box_and_update_view() self.populate_curve_combo_box_and_update_view()
self.check_number_of_curves()
# Signals # Signals
self.view.select_axes_combo_box.currentIndexChanged.connect( self.view.select_axes_combo_box.currentIndexChanged.connect(
self.populate_curve_combo_box_and_update_view) self.populate_curve_combo_box_and_update_view)
...@@ -188,6 +190,9 @@ class CurvesTabWidgetPresenter: ...@@ -188,6 +190,9 @@ class CurvesTabWidgetPresenter:
# Remove curve from ax and remove from curve names dictionary # Remove curve from ax and remove from curve names dictionary
remove_curve_from_ax(self.get_selected_curve()) remove_curve_from_ax(self.get_selected_curve())
self.curve_names_dict.pop(self.view.get_selected_curve_name()) self.curve_names_dict.pop(self.view.get_selected_curve_name())
self.check_number_of_curves()
ax = self.get_selected_ax()
# Update the legend and redraw # Update the legend and redraw
self.update_limits_and_legend(ax, self.legend_props) self.update_limits_and_legend(ax, self.legend_props)
ax.figure.canvas.draw() ax.figure.canvas.draw()
...@@ -289,3 +294,14 @@ class CurvesTabWidgetPresenter: ...@@ -289,3 +294,14 @@ class CurvesTabWidgetPresenter:
name = self._generate_curve_name(curve, curve.get_label()) name = self._generate_curve_name(curve, curve.get_label())
if name: if name:
self.curve_names_dict[name] = curve self.curve_names_dict[name] = curve
def check_number_of_curves(self):
if len(self.curve_names_dict) > 1:
self.view.line.set_plot_all_enabled(True)
self.view.marker.set_plot_all_enabled(True)
self.view.errorbars.multiple_curves = True
else:
self.view.line.set_plot_all_enabled(False)
self.view.marker.set_plot_all_enabled(False)
self.view.errorbars.set_plot_all_enabled(False)
self.view.errorbars.multiple_curves = False
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment