File: widget_style.py

package info (click to toggle)
tryton-client 7.0.27-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,476 kB
  • sloc: python: 27,180; sh: 37; makefile: 18
file content (10 lines) | stat: -rw-r--r-- 335 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
# This file is part of Tryton.  The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.


def widget_class(widget, name, value):
    style_context = widget.get_style_context()
    if value:
        style_context.add_class(name)
    else:
        style_context.remove_class(name)