Added text entry beside sliders

These automatically are updated when the slider moves, and vice versa.
Still cannot seem to fix the adjustment increment. It makes no sense.
This commit is contained in:
A.M. Rowsell 2021-06-28 00:48:02 -04:00
commit 9d98349805
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9
2 changed files with 254 additions and 139 deletions

View file

@ -10,6 +10,225 @@
<property name="page-increment">5</property>
<signal name="value-changed" handler="bigRadiusAdjustment_value_changed_cb" swapped="no"/>
</object>
<object class="GtkWindow" id="spWindow">
<property name="can-focus">False</property>
<property name="title" translatable="yes">Spirographs</property>
<property name="window-position">center</property>
<property name="default-width">800</property>
<property name="default-height">800</property>
<signal name="destroy" handler="onDestroy" swapped="no"/>
<child>
<!-- n-columns=2 n-rows=3 -->
<object class="GtkGrid" id="topGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="margin-top">5</property>
<property name="margin-bottom">5</property>
<property name="row-spacing">10</property>
<child>
<object class="GtkImage" id="epichondroidFormulaImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixbuf">img/small_epitrochoid.png</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkImage" id="hypotrochoidFormulaImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixbuf">img/small_hypotrochoid.png</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkViewport" id="plotViewport">
<property name="visible">True</property>
<property name="app-paintable">True</property>
<property name="can-focus">False</property>
<property name="hscroll-policy">natural</property>
<property name="vscroll-policy">natural</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
<property name="width">2</property>
</packing>
</child>
<child>
<!-- n-columns=3 n-rows=3 -->
<object class="GtkGrid" id="scaleGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="row-spacing">5</property>
<property name="column-spacing">5</property>
<child>
<object class="GtkScale" id="bigRadiusScale">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="adjustment">bigRadiusAdjustment</property>
<property name="show-fill-level">True</property>
<property name="fill-level">100</property>
<property name="round-digits">1</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkScale" id="distanceScale">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="adjustment">distanceAdjustment</property>
<property name="show-fill-level">True</property>
<property name="fill-level">100</property>
<property name="round-digits">1</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkScale" id="smallRadiusScale">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hexpand">True</property>
<property name="adjustment">smallRadiusAdjustment</property>
<property name="show-fill-level">True</property>
<property name="fill-level">100</property>
<property name="round-digits">1</property>
</object>
<packing>
<property name="left-attach">2</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="bigRadiusEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="halign">center</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="width-chars">10</property>
<property name="text" translatable="yes">32</property>
<property name="xalign">0.5</property>
<property name="primary-icon-activatable">False</property>
<property name="primary-icon-sensitive">False</property>
<property name="input-purpose">number</property>
<signal name="changed" handler="bigRadiusEntry_changed_cb" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="bigRadiusLabel">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Big Radius (R):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="smallRadiusLabel">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Small Radius (r):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="distanceLabel">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Distance (d):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="smallRadiusEntry">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="halign">center</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="width-chars">10</property>
<property name="max-width-chars">5</property>
<property name="text" translatable="yes">7</property>
<property name="xalign">0.5</property>
<property name="input-purpose">number</property>
<signal name="changed" handler="smallRadiusEntry_changed_cb" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="distanceEntry">
<property name="width-request">100</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="halign">center</property>
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="width-chars">10</property>
<property name="max-width-chars">5</property>
<property name="text" translatable="yes">5</property>
<property name="xalign">0.5</property>
<property name="input-purpose">number</property>
<signal name="changed" handler="distanceEntry_changed_cb" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
<property name="width">2</property>
</packing>
</child>
</object>
</child>
</object>
<object class="GtkAdjustment" id="distanceAdjustment">
<property name="lower">0.5</property>
<property name="upper">100</property>
@ -26,129 +245,4 @@
<property name="page-increment">5</property>
<signal name="value-changed" handler="smallRadiusAdjustment_value_changed_cb" swapped="no"/>
</object>
<object class="GtkWindow" id="spWindow">
<property name="can-focus">False</property>
<signal name="destroy" handler="onDestroy" swapped="no"/>
<child>
<!-- n-columns=2 n-rows=5 -->
<object class="GtkGrid" id="topGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="row-spacing">10</property>
<property name="column-homogeneous">True</property>
<child>
<object class="GtkScale" id="bigRadiusScale">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">bigRadiusAdjustment</property>
<property name="show-fill-level">True</property>
<property name="fill-level">100</property>
<property name="round-digits">1</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkScale" id="smallRadiusScale">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">smallRadiusAdjustment</property>
<property name="show-fill-level">True</property>
<property name="fill-level">100</property>
<property name="round-digits">1</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkScale" id="distanceScale">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="adjustment">distanceAdjustment</property>
<property name="show-fill-level">True</property>
<property name="fill-level">100</property>
<property name="round-digits">1</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="bigRadiusLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Big Radius (R):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="smallRadiusLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Small Radius (r):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="distanceLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Distance (d):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">3</property>
</packing>
</child>
<child>
<object class="GtkImage" id="epichondroidFormulaImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixbuf">img/small_epitrochoid.png</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkImage" id="hypotrochoidFormulaImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="pixbuf">img/small_hypotrochoid.png</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">4</property>
</packing>
</child>
<child>
<object class="GtkViewport" id="plotViewport">
<property name="visible">True</property>
<property name="app-paintable">True</property>
<property name="can-focus">False</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
<property name="width">2</property>
</packing>
</child>
</object>
</child>
</object>
</interface>