[gnome-calculator/gnome-3-22] Fix reusing results from the history stack



commit ee58e7efbef1eb808b0843cae29b3b345cf833a0
Author: Antonio Ospite <ao2 ao2 it>
Date:   Mon Jul 11 18:02:51 2016 +0200

    Fix reusing results from the history stack
    
    Fix a regression introduced by 9bb6936ba74602ec891c1ffecdf1665dba1a1be4
    (Migrate HistoryEntry to use a GtkBuilder template)
    
    GtkLabel widgets are window-less, so they can't receive the
    "button-press-event" signal directly: they need to be wrapped inside
    a GtkEventBox. The old procedural code was doing that but in the
    transition to the GtkBuilder template this detail was forgotten.
    
    Fix that by just putting a GtkEventBox as a parent of a GtkLabel in
    data/history-entry.ui
    
    While at it also remove the deprecated GtkLabel attributes "xalign" and
    "yalign", and don't specify the "events" property explicitly since
    that's not needed anymore.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=766155

 data/history-entry.ui |   39 +++++++++++++++++++++++----------------
 1 files changed, 23 insertions(+), 16 deletions(-)
---
diff --git a/data/history-entry.ui b/data/history-entry.ui
index e7bccb8..9c4c5f7 100644
--- a/data/history-entry.ui
+++ b/data/history-entry.ui
@@ -1,23 +1,27 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.19.0 -->
+<!-- Generated with glade 3.20.0 -->
 <interface>
   <requires lib="gtk+" version="3.16"/>
   <template class="HistoryEntry" parent="GtkListBoxRow">
+    <property name="can_focus">False</property>
     <child>
       <object class="GtkGrid" id="grid">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="column_homogeneous">True</property>
         <child>
-          <object class="GtkLabel" id="equation_label">
+          <object class="GtkEventBox" id="equation_eventbox">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="events">GDK_BUTTON_PRESS_MASK | GDK_STRUCTURE_MASK</property>
-            <property name="xalign">0.0</property>
-            <property name="yalign">0.0</property>
-            <property name="ellipsize">end</property>
-            <property name="max_width_chars">1</property>
             <signal name="button-press-event" handler="equation_clicked_cb" swapped="no"/>
+            <child>
+              <object class="GtkLabel" id="equation_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="ellipsize">end</property>
+                <property name="max_width_chars">1</property>
+              </object>
+            </child>
           </object>
           <packing>
             <property name="left_attach">0</property>
@@ -26,18 +30,21 @@
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="answer_label">
+          <object class="GtkEventBox" id="answer_eventbox">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="events">GDK_BUTTON_PRESS_MASK | GDK_STRUCTURE_MASK</property>
-            <property name="xalign">0.0</property>
-            <property name="yalign">0.0</property>
-            <property name="ellipsize">end</property>
-            <property name="max_width_chars">1</property>
-            <attributes>
-              <attribute name="weight" value="bold"/>
-            </attributes>
             <signal name="button-press-event" handler="answer_clicked_cb" swapped="no"/>
+            <child>
+              <object class="GtkLabel" id="answer_label">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="ellipsize">end</property>
+                <property name="max_width_chars">1</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
           </object>
           <packing>
             <property name="left_attach">3</property>


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