Two UI questions

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

 



Hello everyone.


I'm new to the list (and LO development). Please be patient with me.


Background:

I'm trying to add a button to a dialog. The button should carry the same image as the "Bold" button that appears on the main screen. To get to the dialog in question:

Calc/Format/Page Style.../Edit...


Right now, the button I'm trying to add is in the "Custom header" line.


The dialog is defined by the file sc/uiconfig/scalc/ui/headerfootercontent.ui


Question 1:

If I simply open the file with glade version 3.40.0, save and close, I get a fairly big diff. The headers suggest the file was last edited using glade version 3.36.0, and just this upgrade renames pretty much all attributes that have an underscore in them to a hyphen:

<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
+<!-- Generated with glade 3.40.0 -->
<interface domain="sc">
  <requires lib="gtk+" version="3.20"/>
  <object class="GtkImage" id="imageBTN_DATE">
    <property name="visible">True</property>
-    <property name="can_focus">False</property>
-    <property name="icon_name">sc/res/date.png</property>
+    <property name="can-focus">False</property>
+    <property name="icon-name">sc/res/date.png</property>
  </object>
  <object class="GtkImage" id="imageBTN_FILE">

Is this to be expected? Should I do anything to try and prevent this from happening?


Question 2:

I tried adding the new button using the patch attached. When I compile and run, the new button appears in the GUI where I expect it to, but no image appears inside it. Is there anything else I should have done to make the image appear?


As far as I can tell, bold.png exists in all the places that text.png exists, and I'm referencing it exactly the same way.


Thank you,

Shachar

diff --git a/sc/uiconfig/scalc/ui/headerfootercontent.ui b/sc/uiconfig/scalc/ui/headerfootercontent.ui
index 7ee0baa4a6ac..44959e462912 100644
--- a/sc/uiconfig/scalc/ui/headerfootercontent.ui
+++ b/sc/uiconfig/scalc/ui/headerfootercontent.ui
@@ -2,6 +2,11 @@
 <!-- Generated with glade 3.40.0 -->
 <interface domain="sc">
   <requires lib="gtk+" version="3.20"/>
+  <object class="GtkImage" id="imageBTN_BOLD">
+    <property name="visible">True</property>
+    <property name="can-focus">False</property>
+    <property name="icon-name">sc/res/bold.png</property>
+  </object>
   <object class="GtkImage" id="imageBTN_DATE">
     <property name="visible">True</property>
     <property name="can-focus">False</property>
@@ -452,6 +457,26 @@
                 <property name="position">6</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkButton" id="buttonBTN_BOLD">
+                <property name="visible">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
+                <property name="tooltip-text" translatable="yes" context="headerfootercontent|buttonBTN_BOLD|tooltip_text">Bold</property>
+                <property name="image">imageBTN_BOLD</property>
+                <property name="always-show-image">True</property>
+                <child internal-child="accessible">
+                  <object class="AtkObject" id="buttonBTN_BOLD-atkobject">
+                    <property name="AtkObject::accessible-description" translatable="yes" context="headerfootercontent|extended_tip|buttonBTN_BOLD">Makes the text bold.</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">7</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="left-attach">1</property>

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux