Re: Glade & new GTK+ 2.5.x features



Damon Chaplin wrote:

On Tue, 2004-11-30 at 16:50, Havoc Pennington wrote:
That longstanding bug about removing the need to use GMarkup to do
bold/italic labels would be worth fixing, if it hasn't been already.

It's still there:
 http://bugzilla.gnome.org/show_bug.cgi?id=97061

We never really agreed on how it should be saved in the XML.

Matthias suggested something like this, with a fake "global_attributes"
property:

 <widget class="GtkLabel" id="label1">
    <property name="label">label1</property>
    <property name="global_attributes">&lt;b&gt; &lt;/b&gt;</property>
 </widget>


I initially preferred something like this, which looks cleaner, but only
supports a predefined number of attributes (e.g. weight/style/font
size):

 <widget class="GtkLabel" id="label1">
    <property name="label">label1</property>
    <property name="font_weight">bold</property>
 </widget>


Now I'm thinking maybe we should use attributes in the XML instead, so
it can be used for arbitrary widget/object properties:

 <widget class="GtkLabel" id="label1">
    <property name="label" markup="&lt;b&gt;">label1</property>
 </widget>


I don't know though. None of them are that great.
Having simple font-weight, font-size and font-style GObject properties on labels is probably the best option.

How many cases are there where you need more than that, but won't need full markup support? If you want to apply some attributes to only a section of the string, you are going to have to expose the markup to the translator anyway.

Going with GObject properties will also make this functionality available to UI not being constructed by glade -- translators get equally annoyed if you make them translate markup in those cases :)

James.



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