[gnome-calculator] Use GAction for bit toggling buttons



commit 8ead11d622ae9b97bd3c9d84af751773f2210c36
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Wed Oct 12 01:06:34 2016 +0300

    Use GAction for bit toggling buttons

 data/buttons-programming.ui | 1394 ++++++++++++++++++++----------------------
 data/calculator.css         |    5 +
 src/math-buttons.vala       |   32 +-
 3 files changed, 683 insertions(+), 748 deletions(-)
---
diff --git a/data/buttons-programming.ui b/data/buttons-programming.ui
index bb2c358..6379c27 100644
--- a/data/buttons-programming.ui
+++ b/data/buttons-programming.ui
@@ -46,468 +46,523 @@
           <object class="GtkGrid" id="bit_table">
             <property name="visible">True</property>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_1">
+              <object class="GtkButton" id="toggle_bit_0_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_1">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">0</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="toggle_bit_1_button">
+                <property name="visible">True</property>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">1</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
                 <property name="left_attach">1</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_2">
+              <object class="GtkButton" id="toggle_bit_2_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_2">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">2</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
                 <property name="left_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_3">
+              <object class="GtkButton" id="toggle_bit_3_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_3">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">3</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
                 <property name="left_attach">3</property>
+                <property name="left_attach">3</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_4">
+              <object class="GtkButton" id="toggle_bit_4_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_4">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">4</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">5</property>
+                <property name="left_attach">4</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_5">
+              <object class="GtkButton" id="toggle_bit_5_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_5">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">5</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">6</property>
+                <property name="left_attach">5</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_6">
+              <object class="GtkButton" id="toggle_bit_6_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_6">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">6</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">7</property>
+                <property name="left_attach">6</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_7">
+              <object class="GtkButton" id="toggle_bit_7_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_7">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">7</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">8</property>
+                <property name="left_attach">7</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_8">
+              <object class="GtkButton" id="toggle_bit_8_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_8">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">8</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">10</property>
+                <property name="left_attach">8</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_9">
+              <object class="GtkButton" id="toggle_bit_9_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_9">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">9</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">11</property>
+                <property name="left_attach">9</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_10">
+              <object class="GtkButton" id="toggle_bit_10_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_10">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">10</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">12</property>
+                <property name="left_attach">10</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_11">
+              <object class="GtkButton" id="toggle_bit_11_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_11">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">12</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">13</property>
+                <property name="left_attach">11</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_12">
+              <object class="GtkButton" id="toggle_bit_12_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_12">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">13</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">15</property>
+                <property name="left_attach">12</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_13">
+              <object class="GtkButton" id="toggle_bit_13_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_13">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">14</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">16</property>
+                <property name="left_attach">13</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_14">
+              <object class="GtkButton" id="toggle_bit_14_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_14">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">15</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">17</property>
+                <property name="left_attach">14</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_15">
+              <object class="GtkButton" id="toggle_bit_15_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_15">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">16</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">18</property>
+                <property name="left_attach">15</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_31">
+              <object class="GtkButton" id="toggle_bit_31_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_31">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">31</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">38</property>
+                <property name="left_attach">31</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_30">
+              <object class="GtkButton" id="toggle_bit_30_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_30">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">30</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">37</property>
+                <property name="left_attach">30</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_29">
+              <object class="GtkButton" id="toggle_bit_29_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_29">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">29</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">36</property>
+                <property name="left_attach">29</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_28">
+              <object class="GtkButton" id="toggle_bit_28_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_28">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">28</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">35</property>
+                <property name="left_attach">28</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_27">
+              <object class="GtkButton" id="toggle_bit_27_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_27">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">27</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">33</property>
+                <property name="left_attach">27</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_26">
+              <object class="GtkButton" id="toggle_bit_26_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_26">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">26</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">32</property>
+                <property name="left_attach">26</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_25">
+              <object class="GtkButton" id="toggle_bit_25_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_25">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">25</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">31</property>
+                <property name="left_attach">25</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_24">
+              <object class="GtkButton" id="toggle_bit_24_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_24">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">24</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">30</property>
+                <property name="left_attach">24</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_23">
+              <object class="GtkButton" id="toggle_bit_23_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_23">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">23</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">28</property>
+                <property name="left_attach">23</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_22">
+              <object class="GtkButton" id="toggle_bit_22_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_22">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">22</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">27</property>
+                <property name="left_attach">22</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_21">
+              <object class="GtkButton" id="toggle_bit_21_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_21">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">21</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">26</property>
+                <property name="left_attach">21</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_20">
+              <object class="GtkButton" id="toggle_bit_20_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_20">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">20</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">25</property>
+                <property name="left_attach">20</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_19">
+              <object class="GtkButton" id="toggle_bit_19_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_19">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">19</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">23</property>
+                <property name="left_attach">19</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_18">
+              <object class="GtkButton" id="toggle_bit_18_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_18">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">18</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">22</property>
+                <property name="left_attach">18</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_17">
+              <object class="GtkButton" id="toggle_bit_17_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_17">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">17</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">21</property>
+                <property name="left_attach">17</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_16">
+              <object class="GtkButton" id="toggle_bit_16_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_16">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">16</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">20</property>
+                <property name="left_attach">16</property>
               </packing>
             </child>
             <child>
@@ -524,7 +579,7 @@
               <packing>
                 <property name="left_attach">0</property>
                 <property name="top_attach">1</property>
-                <property name="width">20</property>
+                <property name="width">16</property>
               </packing>
             </child>
             <child>
@@ -541,7 +596,7 @@
               <packing>
                 <property name="left_attach">0</property>
                 <property name="top_attach">3</property>
-                <property name="width">20</property>
+                <property name="width">16</property>
               </packing>
             </child>
             <child>
@@ -556,8 +611,9 @@
                 </style>
               </object>
               <packing>
-                <property name="left_attach">38</property>
+                <property name="left_attach">31</property>
                 <property name="top_attach">1</property>
+                <property name="width">2</property>
               </packing>
             </child>
             <child>
@@ -572,20 +628,22 @@
                 </style>
               </object>
               <packing>
-                <property name="left_attach">38</property>
+                <property name="left_attach">31</property>
                 <property name="top_attach">3</property>
+                <property name="width">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_32">
+              <object class="GtkButton" id="toggle_bit_32_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_32">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">32</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
                 <property name="left_attach">0</property>
@@ -593,15 +651,16 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_33">
+              <object class="GtkButton" id="toggle_bit_33_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_33">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">33</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
                 <property name="left_attach">1</property>
@@ -609,15 +668,16 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_34">
+              <object class="GtkButton" id="toggle_bit_34_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_34">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">34</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
                 <property name="left_attach">2</property>
@@ -625,15 +685,17 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_35">
+              <object class="GtkButton" id="toggle_bit_35_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_35">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">35</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
                 <property name="left_attach">3</property>
@@ -641,450 +703,484 @@
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_36">
+              <object class="GtkButton" id="toggle_bit_36_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_36">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">36</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">5</property>
+                <property name="left_attach">4</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_37">
+              <object class="GtkButton" id="toggle_bit_37_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_37">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">37</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">6</property>
+                <property name="left_attach">5</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_38">
+              <object class="GtkButton" id="toggle_bit_38_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_38">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">38</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">7</property>
+                <property name="left_attach">6</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_39">
+              <object class="GtkButton" id="toggle_bit_39_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_39">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">39</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">8</property>
+                <property name="left_attach">7</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_40">
+              <object class="GtkButton" id="toggle_bit_40_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_40">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">40</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">10</property>
+                <property name="left_attach">8</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_41">
+              <object class="GtkButton" id="toggle_bit_41_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_41">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">41</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">11</property>
+                <property name="left_attach">9</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_42">
+              <object class="GtkButton" id="toggle_bit_42_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_42">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">42</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">12</property>
+                <property name="left_attach">10</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_43">
+              <object class="GtkButton" id="toggle_bit_43_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_43">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">43</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">13</property>
+                <property name="left_attach">11</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_44">
+              <object class="GtkButton" id="toggle_bit_44_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_44">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">44</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">15</property>
+                <property name="left_attach">12</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_45">
+              <object class="GtkButton" id="toggle_bit_45_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_45">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">45</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">16</property>
+                <property name="left_attach">13</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_46">
+              <object class="GtkButton" id="toggle_bit_46_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_46">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">46</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">17</property>
+                <property name="left_attach">14</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_47">
+              <object class="GtkButton" id="toggle_bit_47_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_47">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">47</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">18</property>
+                <property name="left_attach">15</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_48">
+              <object class="GtkButton" id="toggle_bit_48_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_48">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">48</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">20</property>
+                <property name="left_attach">16</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_49">
+              <object class="GtkButton" id="toggle_bit_49_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_49">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">49</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">21</property>
+                <property name="left_attach">17</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_50">
+              <object class="GtkButton" id="toggle_bit_50_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_50">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">50</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">22</property>
+                <property name="left_attach">18</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_51">
+              <object class="GtkButton" id="toggle_bit_51_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_51">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">51</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">23</property>
+                <property name="left_attach">19</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_52">
+              <object class="GtkButton" id="toggle_bit_52_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_52">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">52</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">25</property>
+                <property name="left_attach">20</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_53">
+              <object class="GtkButton" id="toggle_bit_53_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_53">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">53</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">26</property>
+                <property name="left_attach">21</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_54">
+              <object class="GtkButton" id="toggle_bit_54_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_54">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">54</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">27</property>
+                <property name="left_attach">22</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_55">
+              <object class="GtkButton" id="toggle_bit_55_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_55">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">55</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">28</property>
+                <property name="left_attach">23</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_56">
+              <object class="GtkButton" id="toggle_bit_56_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_56">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">56</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">30</property>
+                <property name="left_attach">24</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_57">
+              <object class="GtkButton" id="toggle_bit_57_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_57">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">57</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">31</property>
+                <property name="left_attach">25</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_58">
+              <object class="GtkButton" id="toggle_bit_58_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_58">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">58</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">32</property>
+                <property name="left_attach">26</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_59">
+              <object class="GtkButton" id="toggle_bit_59_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_59">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="margin_end">10</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">59</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">33</property>
+                <property name="left_attach">27</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_60">
+              <object class="GtkButton" id="toggle_bit_60_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_60">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">60</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">35</property>
+                <property name="left_attach">28</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_61">
+              <object class="GtkButton" id="toggle_bit_61_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_61">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">61</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">36</property>
+                <property name="left_attach">29</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_62">
+              <object class="GtkButton" id="toggle_bit_62_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_62">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">62</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">37</property>
+                <property name="left_attach">30</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
             <child>
-              <object class="GtkEventBox" id="bit_eventbox_63">
+              <object class="GtkButton" id="toggle_bit_63_button">
                 <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_63">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
+                <property name="label">0</property>
+                <property name="can_focus">False</property>
+                <property name="action_name">cal.toggle-bit</property>
+                <property name="action_target">63</property>
+                <style>
+                  <class name="bit-toggle-button" />
+                  <class name="flat" />
+                </style>
               </object>
               <packing>
-                <property name="left_attach">38</property>
+                <property name="left_attach">31</property>
                 <property name="top_attach">2</property>
               </packing>
             </child>
@@ -1100,9 +1196,9 @@
                 </style>
               </object>
               <packing>
-                <property name="left_attach">20</property>
+                <property name="left_attach">16</property>
                 <property name="top_attach">1</property>
-                <property name="width">18</property>
+                <property name="width">16</property>
               </packing>
             </child>
             <child>
@@ -1117,171 +1213,9 @@
                 </style>
               </object>
               <packing>
-                <property name="left_attach">20</property>
+                <property name="left_attach">16</property>
                 <property name="top_attach">3</property>
-                <property name="width">18</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label25">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">4</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label26">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">9</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label27">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">14</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label28">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">19</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label29">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">24</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label30">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">29</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label31">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">34</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label32">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">4</property>
-                <property name="top_attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label33">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">9</property>
-                <property name="top_attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label34">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">14</property>
-                <property name="top_attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label35">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">19</property>
-                <property name="top_attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label36">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">24</property>
-                <property name="top_attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label37">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">29</property>
-                <property name="top_attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkLabel" id="label38">
-                <property name="visible">True</property>
-                <property name="halign">start</property>
-                <property name="label">  </property>
-              </object>
-              <packing>
-                <property name="left_attach">34</property>
-                <property name="top_attach">2</property>
-              </packing>
-            </child>
-            <child>
-              <object class="GtkEventBox" id="bit_eventbox_0">
-                <property name="visible">True</property>
-                <child>
-                  <object class="GtkLabel" id="bit_label_0">
-                    <property name="visible">True</property>
-                    <property name="halign">start</property>
-                    <property name="label"> 0</property>
-                  </object>
-                </child>
-              </object>
-              <packing>
-                <property name="left_attach">0</property>
+                <property name="width">16</property>
               </packing>
             </child>
           </object>
diff --git a/data/calculator.css b/data/calculator.css
index dc2147f..625cbd6 100644
--- a/data/calculator.css
+++ b/data/calculator.css
@@ -14,6 +14,11 @@
   .math-buttons .fx-button {
   }
 
+.bit-toggle-button {
+  padding: 1px;
+  min-width: 9px;
+}
+
 .bit-marker-label {
 }
 
diff --git a/src/math-buttons.vala b/src/math-buttons.vala
index b395410..38d0f02 100644
--- a/src/math-buttons.vala
+++ b/src/math-buttons.vala
@@ -69,7 +69,7 @@ public class MathButtons : Gtk.Box
     private Gtk.ComboBox base_combo;
     private Gtk.Label base_label;
     private Gtk.Widget bit_panel;
-    private List<Gtk.Label> bit_labels;
+    private List<Gtk.Button> toggle_bit_buttons;
 
     private Gtk.Dialog character_code_dialog;
     private Gtk.Entry character_code_entry;
@@ -98,6 +98,7 @@ public class MathButtons : Gtk.Box
         {"factorize",            on_factorize                                },
         {"insert-exponent",      on_insert_exponent                          },
         {"bitshift",             on_bitshift,             "i"                },
+        {"toggle-bit",           on_toggle_bit,           "i"                },
         {"insert-character",     on_insert_character                         },
         {"insert-numeric-point", on_insert_numeric_point                     },
         {"set-number-mode",      on_set_number_mode,      "s", "'normal'"    },
@@ -231,12 +232,12 @@ public class MathButtons : Gtk.Box
             return;
 
         var i = 0;
-        foreach (var label in bit_labels)
+        foreach (var button in toggle_bit_buttons)
         {
-            var text = " 0";
+            var text = "0";
             if ((bits & (1ULL << i)) != 0)
-                text = " 1";
-            label.set_text (text);
+                text = "1";
+            button.label = text;
             i++;
         }
 
@@ -367,22 +368,18 @@ public class MathButtons : Gtk.Box
             character_code_entry.activate.connect (character_code_dialog_activate_cb);
 
             bit_panel = builder.get_object ("bit_table") as Gtk.Widget;
-            bit_labels = new List<Gtk.Label> ();
+            toggle_bit_buttons = new List<Gtk.Button> ();
             var i = 0;
             while (true)
             {
-                var name = "bit_label_%d".printf (i);
-                var label = builder.get_object (name) as Gtk.Label;
-                if (label == null)
+                var name = "toggle_bit_%d_button".printf (i);
+                var toggle_bit_button = builder.get_object (name) as Gtk.Button;
+                if (toggle_bit_button == null)
                     break;
-                bit_labels.append (label);
-                name = "bit_eventbox_%d".printf (i);
-                var box = builder.get_object (name) as Gtk.EventBox;
-                box.set_data<int> ("bit_index", i);
-                box.button_press_event.connect (on_toggle_bit);
+                toggle_bit_buttons.append (toggle_bit_button);
                 i++;
             }
-            bit_labels.reverse ();
+            toggle_bit_buttons.reverse ();
 
             base_combo = builder.get_object ("base_combo") as Gtk.ComboBox;
             base_combo.changed.connect (base_combobox_changed_cb);
@@ -614,10 +611,9 @@ public class MathButtons : Gtk.Box
         return true;
     }
 
-    private bool on_toggle_bit (Gtk.Widget event_box, Gdk.EventButton event)
+    private void on_toggle_bit (SimpleAction action, Variant? param)
     {
-        equation.toggle_bit (event_box.get_data<int> ("bit_index"));
-        return true;
+        equation.toggle_bit (param.get_int32 ());
     }
 
     private void on_set_number_mode (SimpleAction action, Variant? param)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]