Use italic labels for editable fields
issue5008 review18641002
This commit is contained in:
1 parent
d8638c46cc
commit
6d3fa6fcbc
3 files changed
+19
-6
No files matched your search
@@ -1,3 +1,4 @@
|
||||
* Use italic labels for editable fields
|
||||
* Escape '_' in button string
|
||||
* Export selected records only
|
||||
* Use HTML for RichText widget
|
||||
|
||||
@@ -44,8 +44,15 @@ class Label(StateMixin, gtk.Label):
|
||||
weight = pango.WEIGHT_BOLD
|
||||
else:
|
||||
weight = pango.WEIGHT_NORMAL
|
||||
if ((field and field.attrs.get('readonly'))
|
||||
or state_changes.get('readonly')):
|
||||
style = pango.STYLE_NORMAL
|
||||
weight = pango.WEIGHT_NORMAL
|
||||
else:
|
||||
style = pango.STYLE_ITALIC
|
||||
attrlist = pango.AttrList()
|
||||
attrlist.change(pango.AttrWeight(weight, 0, -1))
|
||||
attrlist.change(pango.AttrStyle(style, 0, -1))
|
||||
self.set_attributes(attrlist)
|
||||
|
||||
|
||||
|
||||
@@ -451,15 +451,20 @@ class ViewTree(View):
|
||||
def get_widget(cls, name):
|
||||
return cls.WIDGETS[name]
|
||||
|
||||
@staticmethod
|
||||
def set_column_widget(column, field, attributes, arrow=True):
|
||||
def set_column_widget(self, column, field, attributes, arrow=True):
|
||||
tooltips = Tooltips()
|
||||
hbox = gtk.HBox(False, 2)
|
||||
label = gtk.Label(attributes['string'])
|
||||
if field and field.attrs.get('required'):
|
||||
attrlist = pango.AttrList()
|
||||
attrlist.insert(pango.AttrWeight(pango.WEIGHT_BOLD, 0, -1))
|
||||
label.set_attributes(attrlist)
|
||||
if field and self.editable:
|
||||
required = field.attrs.get('required')
|
||||
readonly = field.attrs.get('readonly')
|
||||
if required or not readonly:
|
||||
attrlist = pango.AttrList()
|
||||
if required:
|
||||
attrlist.insert(pango.AttrWeight(pango.WEIGHT_BOLD, 0, -1))
|
||||
if not readonly:
|
||||
attrlist.change(pango.AttrStyle(pango.STYLE_ITALIC, 0, -1))
|
||||
label.set_attributes(attrlist)
|
||||
label.show()
|
||||
help = attributes['string']
|
||||
if field and field.attrs.get('help'):
|
||||
|
||||
Reference in new issue
Block a user